Re-commit to solve various last minute issues for charsets, etc.
[privoxy.git] / doc / webserver / user-manual / templates.html
index d4b24f1..4e96000 100644 (file)
@@ -1,16 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
 <HTML
 ><HEAD
 ><TITLE
->Templates</TITLE
+>Privoxy's Template Files</TITLE
 ><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.64
-"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 REL="HOME"
-TITLE="Privoxy User Manual"
+TITLE="Privoxy 3.0.8 User Manual"
 HREF="index.html"><LINK
 REL="PREVIOUS"
-TITLE="The Filter File"
+TITLE="Filter Files"
 HREF="filter-file.html"><LINK
 REL="NEXT"
 TITLE="Contacting the Developers, Bug Reporting and Feature
@@ -18,7 +18,12 @@ Requests"
 HREF="contact.html"><LINK
 REL="STYLESHEET"
 TYPE="text/css"
-HREF="../p_doc.css"></HEAD
+HREF="../p_doc.css"><META
+HTTP-EQUIV="Content-Type"
+CONTENT="text/html;
+charset=ISO-8859-1">
+<LINK REL="STYLESHEET" TYPE="text/css" HREF="p_doc.css">
+</head
 ><BODY
 CLASS="SECT1"
 BGCOLOR="#EEEEEE"
@@ -29,6 +34,7 @@ ALINK="#0000FF"
 ><DIV
 CLASS="NAVHEADER"
 ><TABLE
+SUMMARY="Header navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -37,7 +43,7 @@ CELLSPACING="0"
 ><TH
 COLSPAN="3"
 ALIGN="center"
->Privoxy User Manual</TH
+>Privoxy 3.0.8 User Manual</TH
 ></TR
 ><TR
 ><TD
@@ -46,6 +52,7 @@ ALIGN="left"
 VALIGN="bottom"
 ><A
 HREF="filter-file.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -59,6 +66,7 @@ ALIGN="right"
 VALIGN="bottom"
 ><A
 HREF="contact.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -72,58 +80,189 @@ CLASS="SECT1"
 CLASS="SECT1"
 ><A
 NAME="TEMPLATES"
->10. Templates</A
+>10. Privoxy's Template Files</A
 ></H1
 ><P
-> When <SPAN
+> All <SPAN
 CLASS="APPLICATION"
 >Privoxy</SPAN
-> displays one of its internal 
pages, such as a <A
-HREF="http://bogus_404_page.com"
+> built-in pages, i.e. error pages such as the 
+ <A
+HREF="http://show-the-404-error.page"
 TARGET="_top"
->404 Not Found error page</A
+><SPAN
+CLASS="QUOTE"
+>"404 - No Such Domain"</SPAN
+>
+ error page</A
+>, the <A
+HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
+TARGET="_top"
+><SPAN
+CLASS="QUOTE"
+>"BLOCKED"</SPAN
+>
+ page</A
 >
+ and all pages of its <A
+HREF="http://config.privoxy.org/"
+TARGET="_top"
+>web-based
+ user interface</A
+>, are generated from <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>templates</I
+></SPAN
+>. 
  (<SPAN
 CLASS="APPLICATION"
 >Privoxy</SPAN
-> must be running for link to work as
- intended), it uses the appropriate template. On Linux, BSD, and Unix, these
- are located in <TT
+> must be running for the above links to work as
+ intended.)</P
+><P
+> These templates are stored in a subdirectory of the <A
+HREF="config.html#CONFDIR"
+>configuration
+ directory</A
+> called <TT
 CLASS="FILENAME"
->/etc/privoxy/templates</TT
-> by default. These
- may be customized, if desired. <TT
+>templates</TT
+>. On Unixish platforms,
+ this is typically
+ <A
+HREF="file:///etc/privoxy/templates/"
+TARGET="_top"
+><TT
 CLASS="FILENAME"
->cgi-style.css</TT
-> is used to
- control the HTML attributes (fonts, etc).</P
+>/etc/privoxy/templates/</TT
+></A
+>.</P
 ><P
-> The default 
-<A
-HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
+> The templates are basically normal HTML files, but with place-holders (called symbols
+ or exports), which <SPAN
+CLASS="APPLICATION"
+>Privoxy</SPAN
+> fills at run time. It
+ is possible to edit the templates with a normal text editor, should you want
+ to customize them. (<SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>Not recommended for the casual
+ user</I
+></SPAN
+>). Should you create your own custom templates, you should use 
+ the <TT
+CLASS="FILENAME"
+>config</TT
+> setting <A
+HREF="config.html#TEMPLDIR"
+>templdir</A
+>
+ to specify an alternate location, so your templates do not get overwritten
+ during upgrades. 
+ </P
+><P
+> Note that just like in configuration files, lines starting
+ with <TT
+CLASS="LITERAL"
+>#</TT
+> are ignored when the templates are filled in.</P
+><P
+> The place-holders are of the form <TT
+CLASS="LITERAL"
+>@name@</TT
+>, and you will
+ find a list of available symbols, which vary from template to template,
+ in the comments at the start of each file. Note that these comments are not
+ always accurate, and that it's probably best to look at the existing HTML
+ code to find out which symbols are supported and what they are filled in with.</P
+><P
+> A special application of this substitution mechanism is to make whole
+ blocks of HTML code disappear when a specific symbol is set. We use this
+ for many purposes, one of them being to include the beta warning in all
+ our user interface (CGI) pages when <SPAN
+CLASS="APPLICATION"
+>Privoxy</SPAN
+>
+ is in an alpha or beta development stage:</P
+><P
+> <TABLE
+BORDER="0"
+BGCOLOR="#E0E0E0"
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>&#60;!-- @if-unstable-start --&#62;
+
+  ... beta warning HTML code goes here ...
+
+&#60;!-- if-unstable-end@ --&#62;</PRE
+></TD
+></TR
+></TABLE
+></P
+><P
+> If the "unstable" symbol is set, everything in between and including
+ <TT
+CLASS="LITERAL"
+>@if-unstable-start</TT
+> and <TT
+CLASS="LITERAL"
+>if-unstable-end@</TT
+>
+ will disappear, leaving nothing but an empty comment:</P
+><P
+> <TABLE
+BORDER="0"
+BGCOLOR="#E0E0E0"
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>&#60;!--  --&#62;</PRE
+></TD
+></TR
+></TABLE
+></P
+><P
+> There's also an if-then-else construct and an <TT
+CLASS="LITERAL"
+>#include</TT
+>
+ mechanism, but you'll sure find out if you are inclined to edit the
+ templates ;-)</P
+><P
+> All templates refer to a style located at
+ <A
+HREF="http://config.privoxy.org/send-stylesheet"
 TARGET="_top"
->Blocked 
-(<SPAN
+><TT
+CLASS="LITERAL"
+>http://config.privoxy.org/send-stylesheet</TT
+></A
+>.
+ This is, of course, locally served by <SPAN
 CLASS="APPLICATION"
 >Privoxy</SPAN
-> needs to be running for page to display)</A
 >
- banner page with the bright red top 
- banner, is called just <SPAN
-CLASS="QUOTE"
->"<TT
+ and the source for it can be found and edited in the
+ <TT
 CLASS="FILENAME"
->blocked</TT
->"</SPAN
->. This 
- may be customized or replaced with something else if desired.&#13;</P
+>cgi-style.css</TT
+> template.</P
 ></DIV
 ><DIV
 CLASS="NAVFOOTER"
 ><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
@@ -135,6 +274,7 @@ ALIGN="left"
 VALIGN="top"
 ><A
 HREF="filter-file.html"
+ACCESSKEY="P"
 >Prev</A
 ></TD
 ><TD
@@ -143,6 +283,7 @@ ALIGN="center"
 VALIGN="top"
 ><A
 HREF="index.html"
+ACCESSKEY="H"
 >Home</A
 ></TD
 ><TD
@@ -151,6 +292,7 @@ ALIGN="right"
 VALIGN="top"
 ><A
 HREF="contact.html"
+ACCESSKEY="N"
 >Next</A
 ></TD
 ></TR
@@ -159,7 +301,7 @@ HREF="contact.html"
 WIDTH="33%"
 ALIGN="left"
 VALIGN="top"
->The Filter File</TD
+>Filter Files</TD
 ><TD
 WIDTH="34%"
 ALIGN="center"