I'm fishing around for knowledge and ideas about things that I'm not very knowledgeable about here so be gentle! :-)
I'm looking for a simple direct way of dynamically converting reStructured text to HTML. I.e. I want to create text files in rst format (so they're reasonably readable "as is") and point my web browser at them and see them in HTML.
I can already do this using pyBlosxom and one of its plugins but it's a rather roundabout way of achieving something simple and all the blog type extras are a nuisance.
The pyBlosxom plugin uses Docutils' /usr/bin/rst2html to translate the reStructured Text to HTML, what I'm looking for is some way to tell apache that when it sees a file xxxxx.rst it should run it through /usr/bin/rst2html and display the resulting HTML.
Is there a standard apache way of doing things like this? Or am I talking CGI? Or what?
On Thu, Dec 27, 2007 at 12:06:06PM +0000, Chris G wrote:
I'm fishing around for knowledge and ideas about things that I'm not very knowledgeable about here so be gentle! :-)
I'm looking for a simple direct way of dynamically converting reStructured text to HTML. I.e. I want to create text files in rst format (so they're reasonably readable "as is") and point my web browser at them and see them in HTML.
I can already do this using pyBlosxom and one of its plugins but it's a rather roundabout way of achieving something simple and all the blog type extras are a nuisance.
The pyBlosxom plugin uses Docutils' /usr/bin/rst2html to translate the reStructured Text to HTML, what I'm looking for is some way to tell apache that when it sees a file xxxxx.rst it should run it through /usr/bin/rst2html and display the resulting HTML.
Is there a standard apache way of doing things like this? Or am I talking CGI? Or what?
Turns out that it's dead easy with apache 2.2 at least (maybe earlier, I'm not quite sure) using the mod_ext_filter directive. All that's needed in the apache httpd.conf file is:-
ExtFilterDefine rst-to-html mode=output \ intype=text/rst outtype=text/html \ cmd="/usr/bin/rst2html"
... and inside the appropriate <Directory> :-
SetOutputFilter rst-to-html AddType text/rst .rst # ExtFilterOptions DebugLevel=4
How simple is that! Now I can write .rst files to my hearts content and view them as HTML.