mod_txt

mod_txt is a simple output filter module to display plain text files as HTML (or XHTML) with a header and footer. When a text file is requested, it escapes the text as required for HTML, and displays it between the header and the footer.

How to use it

Apart from setting the Header and Footer, you will need to insert the filter in the output chain, and set the Content Type to HTML. So a configuration to use this module looks like:

	AddOutputFilter	text-filter	.txt
	AddType	text/html	.txt
	TextHeader	/path/to/header-file
	TextFooter	/path/to/footer-file

Note that this is not a smart text filter, so the text should be enclosed in HTML <pre>. End the header file by opening PRE, and start the footer by closing it.

Configuration Directives

TextHeader

Syntax: TextHeader filename

Specifies a path to use as header for the text file.

TextFooter

Syntax: TextFooter filename

Specifies a path to use as footer for the text file.

Availability

mod_txt.c source code is available under the GNU General Public License (GPL). As with other opensource modules, we can consider alternative licenses by request.