c7a39557853c362801192f79aca9566c6ed13d9e
[ssic.git] / README
1 Server Side Includes Compiler
2 =============================
3
4 This is ssic, a Server Side Includes Compiler.
5
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
11 ssic.
12
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`:
16
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
19
20 ssic uses the `CGI::SSI` Perl module for directive processing.
21
22 SSI Commands
23 ------------
24
25 SSI directives are formatted as follows:
26
27     <!--#command tag1="value1" tag2="value2" -->
28
29 Most commands take only one tag.
30
31 The following commands are supported:
32
33   * `config` controls various aspects of processing.  There are three
34     valid tags:
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
38       format of dates.
39     - `sizefmt` controls the units of file sizes.  Valid values are
40       `bytes` for sizes in bytes and `abbrev` for sizes in kibibytes or
41       mebibytes.
42   * `set` sets the value of a variable.  Two tags are accepted: `var`
43     and `value`.
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
47     values.
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
52       document root.
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.
58
59 Include Variables
60 -----------------
61
62 The following variables are set:
63
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.
71
72
73 Copyright Information
74 =====================
75
76 Copyright (C) 2013  Patrick "P. J." McDermott
77
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,
81 without any warranty.