1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title>Documentation Guidelines</title>
6 <meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
7 <link rel="HOME" title="Privoxy Developer Manual" href="index.html">
8 <link rel="PREVIOUS" title="The Git Repository" href="git.html">
9 <link rel="NEXT" title="Coding Guidelines" href="coding.html">
10 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
11 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
13 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
14 <div class="NAVHEADER">
15 <table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
17 <th colspan="3" align="center">Privoxy Developer Manual</th>
20 <td width="10%" align="left" valign="bottom"><a href="git.html" accesskey="P">Prev</a></td>
21 <td width="80%" align="center" valign="bottom"></td>
22 <td width="10%" align="right" valign="bottom"><a href="coding.html" accesskey="N">Next</a></td>
25 <hr align="left" width="100%">
28 <h1 class="SECT1"><a name="DOCUMENTATION" id="DOCUMENTATION">3. Documentation Guidelines</a></h1>
29 <p>All formal documents are maintained in Docbook SGML and located in the <samp class=
30 "COMPUTEROUTPUT">doc/source/*</samp> directory. You will need <a href="http://www.docbook.org" target=
31 "_top">Docbook</a>, the Docbook DTD's and the Docbook modular stylesheets (or comparable alternatives), and either
32 <span class="APPLICATION">jade</span> or <span class="APPLICATION">openjade</span> (recommended) installed in order
33 to build docs from source. Currently there is <a href="../user-manual/index.html" target="_top"><i class=
34 "CITETITLE">user-manual</i></a>, <a href="../faq/index.html" target="_top"><i class="CITETITLE">FAQ</i></a>, and,
35 of course this, the <i class="CITETITLE">developer-manual</i> in this format. The <i class="CITETITLE">README</i>,
36 <i class="CITETITLE">AUTHORS</i>, <i class="CITETITLE">INSTALL</i>, <i class="CITETITLE">privoxy.1</i> (man page),
37 and <i class="CITETITLE">config</i> files are also now maintained as Docbook SGML. These files, when built, in the
38 top-level source directory are generated files! Also, the <span class="APPLICATION">Privoxy</span> <tt class=
39 "FILENAME">index.html</tt> (and a variation on this file, <tt class="FILENAME">privoxy-index.html</tt>, meant for
40 inclusion with doc packages), are maintained as SGML as well. <span class="emphasis"><i class="EMPHASIS">DO NOT
41 edit these directly</i></span>. Edit the SGML source, or contact someone involved in the documentation.</p>
42 <p><tt class="FILENAME">config</tt> requires some special handling. The reason it is maintained this way is so that
43 the extensive comments in the file mirror those in <i class="CITETITLE">user-manual</i>. But the conversion process
44 requires going from SGML to HTML to text to special formatting required for the embedded comments. Some of this
45 does not survive so well. Especially some of the examples that are longer than 80 characters. The build process for
46 this file outputs to <tt class="FILENAME">config.new</tt>, which should be reviewed for errors and mis-formatting.
47 Once satisfied that it is correct, then it should be hand copied to <tt class="FILENAME">config</tt>.</p>
48 <p>Other, less formal documents (e.g. <tt class="FILENAME">LICENSE</tt>) are maintained as plain text files in the
49 top-level source directory.</p>
50 <p>Packagers are encouraged to include this documentation. For those without the ability to build the docs locally,
51 text versions of each are kept in Git. HTML versions are also being kept in Git under <tt class=
52 "FILENAME">doc/webserver/*</tt>.</p>
53 <p>Formal documents are built with the Makefile targets of <samp class="COMPUTEROUTPUT">make dok</samp>. The build
54 process uses the document SGML sources in <samp class="COMPUTEROUTPUT">doc/source/*/*</samp> to update all text
55 files in <samp class="COMPUTEROUTPUT">doc/text/</samp> and to update all HTML documents in <samp class=
56 "COMPUTEROUTPUT">doc/webserver/</samp>.</p>
57 <p>Documentation writers should please make sure documents build successfully before committing to Git, if
59 <p>How do you update the webserver (i.e. the pages on privoxy.org)?</p>
62 <p>First, build the docs by running <samp class="COMPUTEROUTPUT">make dok</samp>.</p>
65 <p>Run <samp class="COMPUTEROUTPUT">make webserver</samp> which copies all files from <samp class=
66 "COMPUTEROUTPUT">doc/webserver</samp> to the sourceforge webserver via scp.</p>
69 <p>Finished docs should be occasionally submitted to Git (<tt class="FILENAME">doc/webserver/*/*.html</tt>) so that
70 those without the ability to build them locally, have access to them if needed. This is especially important just
71 prior to a new release! Please do this <span class="emphasis"><i class="EMPHASIS">after</i></span> the <tt class=
72 "LITERAL">$VERSION</tt> and other release specific data in <tt class="FILENAME">configure.in</tt> has been updated
73 (this is done just prior to a new release).</p>
75 <h2 class="SECT2"><a name="SGML" id="SGML">3.1. Quickstart to Docbook and SGML</a></h2>
76 <p>If you are not familiar with SGML, it is a markup language similar to HTML. Actually, not a mark up language
77 per se, but a language used to define markup languages. In fact, HTML is an SGML application. Both will use
78 <span class="QUOTE">"tags"</span> to format text and other content. SGML tags can be much more varied, and
79 flexible, but do much of the same kinds of things. The tags, or <span class="QUOTE">"elements"</span>, are
80 definable in SGML. There is no set <span class="QUOTE">"standards"</span>. Since we are using <span class=
81 "APPLICATION">Docbook</span>, our tags are those that are defined by <span class="APPLICATION">Docbook</span>.
82 Much of how the finish document is rendered is determined by the <span class="QUOTE">"stylesheets"</span>. The
83 stylesheets determine how each tag gets translated to HTML, or other formats.</p>
84 <p>Tags in Docbook SGML need to be always <span class="QUOTE">"closed"</span>. If not, you will likely generate
85 errors. Example: <tt class="LITERAL"><title>My Title</title></tt>. They are also case-insensitive,
86 but we strongly suggest using all lower case. This keeps compatibility with [Docbook] <span class=
87 "APPLICATION">XML</span>.</p>
88 <p>Our documents use <span class="QUOTE">"sections"</span> for the most part. Sections will be processed into
89 HTML headers (e.g. <tt class="LITERAL">h1</tt> for <tt class="LITERAL">sect1</tt>). The <span class=
90 "APPLICATION">Docbook</span> stylesheets will use these to also generate the Table of Contents for each doc. Our
91 TOC's are set to a depth of three. Meaning <tt class="LITERAL">sect1</tt>, <tt class="LITERAL">sect2</tt>, and
92 <tt class="LITERAL">sect3</tt> will have TOC entries, but <tt class="LITERAL">sect4</tt> will not. Each section
93 requires a <tt class="LITERAL"><title></tt> element, and at least one <tt class=
94 "LITERAL"><para></tt>. There is a limit of five section levels in Docbook, but generally three should be
95 sufficient for our purposes.</p>
96 <p>Some common elements that you likely will use:</p>
100 <td><span class="emphasis"><i class="EMPHASIS"><para></para></i></span>, paragraph delimiter.
101 Most text needs to be within paragraph elements (there are some exceptions).</td>
104 <td><span class="emphasis"><i class="EMPHASIS"><emphasis></emphasis></i></span>, the
105 stylesheets make this italics.</td>
108 <td><span class="emphasis"><i class="EMPHASIS"><filename></filename></i></span>, files and
112 <td><span class="emphasis"><i class="EMPHASIS"><command></command></i></span>, command
116 <td><span class="emphasis"><i class="EMPHASIS"><literallayout></literallayout></i></span>, like
117 <tt class="LITERAL"><pre></tt>, more or less.</td>
120 <td><span class="emphasis"><i class="EMPHASIS"><itemizedlist></itemizedlist></i></span>, list
124 <td><span class="emphasis"><i class="EMPHASIS"><listitem></listitem></i></span>, member of the
128 <td><span class="emphasis"><i class="EMPHASIS"><screen></screen></i></span>, screen output,
129 implies <tt class="LITERAL"><literallayout></tt>.</td>
132 <td><span class="emphasis"><i class="EMPHASIS"><ulink url="example.com"></ulink></i></span>,
133 like HTML <tt class="LITERAL"><a></tt> tag.</td>
136 <td><span class="emphasis"><i class="EMPHASIS"><quote></quote></i></span>, for, doh, quoting
141 <p>Look at any of the existing docs for examples of all these and more.</p>
142 <p>You might also find <span class="QUOTE">" <a href=
143 "https://web.archive.org/web/20160315230758/http://opensource.bureau-cornavin.com/crash-course/index.html"
144 target="_top">Writing Documentation Using DocBook - A Crash Course</a>"</span> useful.</p>
147 <h2 class="SECT2"><a name="DOCSTYLE" id="DOCSTYLE">3.2. <span class="APPLICATION">Privoxy</span> Documentation
149 <p>It will be easier if everyone follows a similar writing style. This just makes it easier to read what someone
150 else has written if it is all done in a similar fashion.</p>
154 <p>All tags should be lower case.</p>
157 <p>Tags delimiting a <span class="emphasis"><i class="EMPHASIS">block</i></span> of text (even small blocks)
158 should be on their own line. Like:</p>
159 <p class="LITERALLAYOUT"> <para><br>
160 Some text goes here.<br>
161 </para></p>
162 <p>Tags marking individual words, or few words, should be in-line:</p>
163 <p class="LITERALLAYOUT">
164 Just to <emphasis>emphasize</emphasis>, some text goes here.</p>
167 <p>Tags should be nested and step indented for block text like: (except in-line tags)</p>
168 <p class="LITERALLAYOUT"> <para><br>
169 <itemizedlist><br>
170 <para><br>
171 <listitem><br>
172 Some text goes here in our list example.<br>
174 </listitem><br>
175 </para><br>
176 </itemizedlist><br>
177 </para></p>
178 <p>This makes it easier to find the text amongst the tags ;-)</p>
181 <p>Use white space to separate logical divisions within a document, like between sections. Running everything
182 together consistently makes it harder to read and work on.</p>
185 <p>Do not hesitate to make comments. Comments can either use the <comment> element, or the <!--
186 --> style comment familiar from HTML. (Note in Docbook v4.x <comment> is replaced by
190 <p>We have an international audience. Refrain from slang, or English idiosyncrasies (too many to list :).
191 Humor also does not translate well sometimes.</p>
194 <p>Try to keep overall line lengths in source files to 80 characters or less for obvious reasons. This is not
195 always possible, with lengthy URLs for instance.</p>
198 <p>Our documents are available in differing formats. Right now, they are just plain text and/or HTML, but
199 others are always a future possibility. Be careful with URLs (<ulink>), and avoid this mistake:</p>
200 <p>My favorite site is <ulink url="http://example.com">here</ulink>.</p>
201 <p>This will render as <span class="QUOTE">"My favorite site is here"</span>, which is not real helpful in a
202 text doc. Better like this:</p>
203 <p>My favorite site is <ulink url="http://example.com">example.com</ulink>.</p>
206 <p>All documents should be spell checked occasionally. <span class="APPLICATION">aspell</span> can check SGML
207 with the <tt class="LITERAL">-H</tt> option. (<span class="APPLICATION">ispell</span> I think too.)</p>
212 <h2 class="SECT2"><a name="AEN203" id="AEN203">3.3. Privoxy Custom Entities</a></h2>
213 <p><span class="APPLICATION">Privoxy</span> documentation is using a number of customized <span class=
214 "QUOTE">"entities"</span> to facilitate documentation maintenance.</p>
215 <p>We are using a set of <span class="QUOTE">"boilerplate"</span> files with generic text, that is used by
216 multiple docs. This way we can write something once, and use it repeatedly without having to re-write the same
217 content over and over again. If editing such a file, keep in mind that it should be <span class=
218 "emphasis"><i class="EMPHASIS">generic</i></span>. That is the purpose; so it can be used in varying contexts
219 without additional modifications.</p>
220 <p>We are also using what <span class="APPLICATION">Docbook</span> calls <span class="QUOTE">"internal
221 entities"</span>. These are like variables in programming. Well, sort of. For instance, we have the <tt class=
222 "LITERAL">p-version</tt> entity that contains the current <span class="APPLICATION">Privoxy</span> version
223 string. You are strongly encouraged to use these where possible. Some of these obviously require re-setting with
224 each release (done by the Makefile). A sampling of custom entities are listed below. See any of the main docs for
228 <p>Re- <span class="QUOTE">"boilerplate"</span> text entities are defined like:</p>
229 <p><tt class="LITERAL"><!entity supported SYSTEM "supported.sgml"></tt></p>
230 <p>In this example, the contents of the file, <tt class="FILENAME">supported.sgml</tt> is available for
231 inclusion anywhere in the doc. To make this happen, just reference the now defined entity: <tt class=
232 "LITERAL">&supported;</tt> (starts with an ampersand and ends with a semi-colon), and the contents will
233 be dumped into the finished doc at that point.</p>
236 <p>Commonly used <span class="QUOTE">"internal entities"</span>:</p>
240 <td><span class="emphasis"><i class="EMPHASIS">p-version</i></span>: the <span class=
241 "APPLICATION">Privoxy</span> version string, e.g. <span class="QUOTE">"3.0.27"</span>.</td>
244 <td><span class="emphasis"><i class="EMPHASIS">p-status</i></span>: the project status, either
245 <span class="QUOTE">"alpha"</span>, <span class="QUOTE">"beta"</span>, or <span class=
246 "QUOTE">"stable"</span>.</td>
249 <td><span class="emphasis"><i class="EMPHASIS">p-not-stable</i></span>: use to conditionally include
250 text in <span class="QUOTE">"not stable"</span> releases (e.g. <span class="QUOTE">"beta"</span>).</td>
253 <td><span class="emphasis"><i class="EMPHASIS">p-stable</i></span>: just the opposite.</td>
256 <td><span class="emphasis"><i class="EMPHASIS">p-text</i></span>: this doc is only generated as
263 <p>There are others in various places that are defined for a specific purpose. Read the source!</p>
266 <div class="NAVFOOTER">
267 <hr align="left" width="100%">
268 <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
270 <td width="33%" align="left" valign="top"><a href="git.html" accesskey="P">Prev</a></td>
271 <td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>
272 <td width="33%" align="right" valign="top"><a href="coding.html" accesskey="N">Next</a></td>
275 <td width="33%" align="left" valign="top">The Git Repository</td>
276 <td width="34%" align="center" valign="top"> </td>
277 <td width="33%" align="right" valign="top">Coding Guidelines</td>