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.