How to Personalize the Created Web Page
The web page is created from three template files: a head (contains
more than just the html head section): head.html, a body
element: body_el#.html, and a tail: tail.html. The head &
tail are used once, and the body element is repeated for each comic
strip. The files are installed by default under
/usr/share/netcomics/html_tmpl/.
There are multiple body_el#.html files. The number indicates
the number of image files in a comic that template handles. For
example, some comic strips provide each panel on Sunday in a seperate
file. If there are 5 frames total, then body_el5.html will be used.
Inside it are 5 places for the file names to be inserted. (Yes, I
don't like this design, but it was quick. At some point, I'll change
it so that there's 2 templates for the body elements--a template
wrapper around a set of file element templates, and a file element
template.)
Since you are allowed to specify a different directory to contain
these files with the -m option, if you do use that option, you
must create a set of template html files, or the web page will not be
created when using the -w or -W options. I suggest
copying the template files and modifying them instead of starting from
scratch.
What's replaced in the template files when writing out index.html
- head.html:
- The string "<DATE>" is replaced with
the date of the form "Month day Year".
- If <DATE> is provided with the optional attribute,
FORMAT="", the text between the quotes is used
as the format specifier for the POSIX::strftime() function.
The whole <DATE FORMAT=""> is replaced with the
string produced by strftime(). Escaped double quotes are
not allowed between the quotes. See the man page for
strftime() on your system.
- body_el#.html:
- "<COMIC_FILE#>" is replaced with the filename of
the comic.
- "<COMIC_NAME>" is replaced with the name of
the comic.
- "<SIZE>" is replaced with the <IMG> attributes
HEIGHT=# and WEIGHT=#. This will help make rendering the web page
happen more quickly in most browsers.
- tail.html: The string "<CTIME>" is replaced with
the date as returned by POSIX::ctime().
- links.html:
- "<FILE=PREV>" is replaced with the filename
of the previous webpage file.
- "<FILE=NEXT>" is replaced with the filename
of the next webpage file.
links_index.html: Both of the file types in links.html
are also replaced in this one, plus "<FILE=NEXT>"
which is replaced with the filename of the next webpage
index. This template is used instead of links.html if an index
is created (by default).
- index_body_el.html: When created, an index webpage is
constructed using head.html, an instance of this template for
each comic, and tail.html.
- "<FILE=CURRENT>" is replaced with the
name of the webpage in which the comic is included.
- "<COMIC_ID>" is replaced with the id of the
comic so that it can be uniquely hyperlinked to (the date
is also attached to the id).
- "<COMIC_DATE>" is replaced with the date of
the comic.
- "<COMIC_NAME>" is replaced with the name of
the comic.
- "<COMIC_AUTHOR>" is replaced with author of
the comic.
- "<COMIC_STATUS>" is replaced with the status
of the comic. If it a local file, "local"; if it is a URL,
"remote".
- "<PAGE=CURRENT>" is replaced with number of
the webpage in which the comic is included.
Ben Hochstedler <hochstrb@cs.rose-hulman.edu>
Last modified: Wed Dec 1 10:56:25 CST 1999