NAME
Apache::VimColor - Apache mod_perl Handler for syntax highlighting in HTML.
SYNOPSIS
This module requires mod_perl2 (see http://perl.apache.org/) and Text::VimColor.
The apache configuration neccessary might look a bit like this:
# in httpd.conf (or any other apache configuration file)
<Location /source>
SetHandler perl-script
PerlHandler Apache::VimColor
# Below here is optional
PerlSetVar AllowDownload "True"
PerlSetVar CacheSize 20
PerlSetVar StyleSheet "http://domain.com/stylesheet.css"
PerlSetVar TabSize 8
</Location>
DESCRIPTION
This apache handler converts text files in syntax highlighted HTML output using Text::VimColor. If allowed by the configuration the visitor can also download the text-file in it's original form.
CONFIGURATION DIRECTIVES
All features of the this PerlHandler can be set in the apache configuration using the PerlSetVar directive. For example:
PerlSetVar AllowDownload true # inside <Files>, <Location>, ...
# apache directives
- AllowDownload
-
Setting this option to true will allow plaintext downloads of the files. A link will be included in the output.
- CacheSize
-
If this option is set to a positive value this many pages will be cached. The cache uses a LRU (least recently used) algorithm to remove entries from the cache. Most likely there is one cache for each child, but this depends on your configuration. If a file changes it is automatically re-parsed. The default is not to cache any files.
- TabStop
-
Sets the width of one tab symbol. The default is eight spaces.
- StyleSheet
-
If you want to include a custom stylesheet you can set this option. The string will be included in the html-output as-is, you will have to take care of relative filenames yourself.
All highlighted text is withing a
span
-tag with one of the following classes:Comment Constant Error Identifier PreProc Special Statement Todo Type Underlined
SEE ALSO
perl(1), mod_perl(3), Apache(3), Text::VimColor
AUTHOR
Florian octo Forster
octo(at)verplant.org
http://verplant.org/
COPYRIGHT
Copyright (c) 2005 Florian Forster.
All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.