1 Server Side Includes Compiler
2 =============================
4 This is ssic, a Server Side Includes Compiler.
6 ssic processes HTML documents with SSI directives formatted as SGML
7 comments. It can be used to process documents without an HTTP server
8 for local browsing or to generate static HTML documents to be
9 efficiently served by an HTTP server. Documents could even be
10 preprocessed, e.g. by a Markdown processor, before being parsed with
13 The set of commands, tags, and variables supported by ssic is mostly a
14 superset of those supported by the old NCSA HTTPd and a subset of those
15 supported by Apache HTTPd's `mod_include`:
17 http://web.archive.org/web/19971210170837/http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html
18 http://httpd.apache.org/docs/current/mod/mod_include.html
20 ssic uses the `CGI::SSI` Perl module for directive processing.
25 SSI directives are formatted as follows:
27 <!--#command tag1="value1" tag2="value2" -->
29 Most commands take only one tag.
31 The following commands are supported:
33 * `config` controls various aspects of processing. There are three
35 - `errmsg` controls the message that is substituted into the
36 document when an error occurs.
37 - `timefmt` is a format string used by `strftime` that controls the
39 - `sizefmt` controls the units of file sizes. Valid values are
40 `bytes` for sizes in bytes and `abbrev` for sizes in kibibytes or
42 * `set` sets the value of a variable. Two tags are accepted: `var`
44 * `echo` prints the value of an include variable (see below) or
45 environment variable. The only valid tag is `var`.
46 * `printenv` prints a list of all environment variables and their
48 * `include` processes and inserts the text of a document into the
49 current document. There are two valid tags:
50 - `file` gives a pathname relative to the current directory.
51 - `virtual` gives a pathname, beginning with `/`, relative to the
53 * `exec` executes a shell command. The only valid tag is `cmd`.
54 * `flastmod` prints the modification date of a specified file. Valid
55 tags are the same as for the `include` command.
56 * `fsize` prints the size of a specified file. Valid tags are the
57 same as for the `include` command.
62 The following variables are set:
64 * `DATE_GMT` is the current date in UTC.
65 * `DATE_LOCAL` is the current date in the local timezone.
66 * `DOCUMENT_NAME` is the current filename.
67 * `DOCUMENT_ROOT` is the document root, in which files specified with
68 the `virtual` tag are found.
69 * `DOCUMENT_URI` is the current filename.
70 * `LAST_MODIFIED` is the modification date of the current document.
76 Copyright (C) 2013 Patrick "P. J." McDermott
78 Copying and distribution of this file, with or without modification,
79 are permitted in any medium without royalty provided the copyright
80 notice and this notice are preserved. This file is offered as-is,