views:

110

answers:

1

I would like to add a preprocessor to HTML pages. Basically, I have a program that takes the name of an HTML file containing preprocessor instructions and outputs the contents of the file after preprocessing to stdout. This mechanism could change if it makes things easier. All I want to do is hook this into Apache so that all the files that my website serves get put through the preprocessor before going out to the browser. A solution that works with other HTTP servers than Apache would be preferred, but is not required.

If my understanding is correct, this is roughly what PHP does.

If it makes any difference, the preprocessor is written in Python.

+4  A: 

If you have Apache and a "preprocessor" written in python, why not go for mod_python?

innaM
Becuase mod_python doesn't do what I described. mod_python does essentially what I want my preprocessor to do.
Imagist
Take another look. With mod_pyhton, you can write filter handlers and unless your question doesn't describe what you really want, I'd say that the ability to plug in a filter is exactly what you want: http://www.modpython.org/live/current/doc-html/pyapi-filter.html
innaM
Ah, you're correct. Thanks for your response.
Imagist