ngx-fancyindex/HACKING.rst

54 lines
1.3 KiB
ReStructuredText
Raw Normal View History

2007-08-22 19:27:11 +00:00
===================================
Fancy Index module Hacking HOW-TO
===================================
.. contents::
2007-08-24 11:47:59 +00:00
How to modify the template
==========================
2007-08-22 19:27:11 +00:00
2007-08-24 11:47:59 +00:00
The template is in the ``template.html`` file. Note that comment markers are
used to control how the ``split-template`` Awk script generates the C header
which gets ultimately included in the compiled object code. Comment markers
have the ``<!-- var identifier -->`` format. Here ``identifier`` must be
a valid C identifier. All the text following the marker until the next
marker will be flattened into a C string.
2007-08-22 19:27:11 +00:00
2007-08-24 11:47:59 +00:00
Regenerating the C header
~~~~~~~~~~~~~~~~~~~~~~~~~
You will need Awk. I hope any decent implementation will do, but the GNU one
is known to work flawlessly. Just do::
2007-08-22 19:27:11 +00:00
2007-08-24 11:47:59 +00:00
$ awk -f template.awk template.html > template.h
Template identifier order
~~~~~~~~~~~~~~~~~~~~~~~~~
t01_head1
2007-08-22 19:27:11 +00:00
Outputs the HTML header and must end with something like
``<title>Index of``, because the code inserts the path of the URI just
after this piece.
2007-08-24 11:47:59 +00:00
t02_head2
2007-08-22 19:27:11 +00:00
Outputs the rest of the header, usually will close the ``</title>`` tag
opened in the previous template and add further output until the closing
``</head>`` tag.
2007-08-24 11:47:59 +00:00
t03_body1
2007-08-22 19:27:11 +00:00
-
2007-08-24 11:47:59 +00:00
t04_body2
2007-08-22 19:27:11 +00:00
-
2007-08-24 11:47:59 +00:00
t05_list1
2007-08-22 19:27:11 +00:00
-
2007-08-24 11:47:59 +00:00
t06_list2
2007-08-22 19:27:11 +00:00
-
2007-08-24 11:47:59 +00:00
t07_body3
2007-08-22 19:27:11 +00:00
-
2007-08-24 11:47:59 +00:00
t08_body4
2007-08-22 19:27:11 +00:00
-
2007-08-24 11:47:59 +00:00
t09_foot1
2007-08-22 19:27:11 +00:00
-
.. vim: spell spelllang=en expandtab