1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
5 >Documentation Guidelines</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10 TITLE="Privoxy Developer Manual"
11 HREF="index.html"><LINK
13 TITLE="The Git Repository"
16 TITLE="Coding Guidelines"
17 HREF="coding.html"><LINK
20 HREF="../p_doc.css"><META
21 HTTP-EQUIV="Content-Type"
23 charset=ISO-8859-1"></HEAD
34 SUMMARY="Header navigation table"
43 >Privoxy Developer Manual</TH
80 >3. Documentation Guidelines</A
83 > All formal documents are maintained in Docbook SGML and located in the
85 CLASS="COMPUTEROUTPUT"
87 > directory. You will need
89 HREF="http://www.docbook.org"
93 DTD's and the Docbook modular stylesheets (or comparable alternatives),
101 > (recommended) installed in order to
102 build docs from source. Currently there is <A
103 HREF="../user-manual/index.html"
111 HREF="../faq/index.html"
140 > files are also now maintained as Docbook
141 SGML. These files, when built, in the top-level source directory are
142 generated files! Also, the <SPAN
149 variation on this file, <TT
151 >privoxy-index.html</TT
153 meant for inclusion with doc packages), are maintained as SGML as well.
158 >DO NOT edit these directly</I
160 >. Edit the SGML source, or
161 contact someone involved in the documentation.
167 > requires some special handling. The reason it
168 is maintained this way is so that the extensive comments in the file
172 >. But the conversion
173 process requires going from SGML to HTML to text to special formatting
174 required for the embedded comments. Some of this does not survive so
175 well. Especially some of the examples that are longer than 80 characters.
176 The build process for this file outputs to <TT
180 which should be reviewed for errors and mis-formatting. Once satisfied
181 that it is correct, then it should be hand copied to
188 > Other, less formal documents (e.g. <TT
192 maintained as plain text files in the top-level source directory.
195 > Packagers are encouraged to include this documentation. For those without
196 the ability to build the docs locally, text versions of each are kept in
197 Git. HTML versions are also being kept in Git under
204 > Formal documents are built with the Makefile targets of
206 CLASS="COMPUTEROUTPUT"
209 The build process uses the document SGML sources in
211 CLASS="COMPUTEROUTPUT"
212 >doc/source/*/*</SAMP
213 > to update all text files in
215 CLASS="COMPUTEROUTPUT"
217 > and to update all HTML
219 CLASS="COMPUTEROUTPUT"
220 >doc/webserver/</SAMP
224 > Documentation writers should please make sure documents build
225 successfully before committing to Git, if possible.
228 > How do you update the webserver (i.e. the pages on privoxy.org)?
236 > First, build the docs by running <SAMP
237 CLASS="COMPUTEROUTPUT"
246 CLASS="COMPUTEROUTPUT"
247 >make webserver</SAMP
250 CLASS="COMPUTEROUTPUT"
253 sourceforge webserver via scp.
258 > Finished docs should be occasionally submitted to Git
261 >doc/webserver/*/*.html</TT
262 >) so that those without
263 the ability to build them locally, have access to them if needed.
264 This is especially important just prior to a new release! Please
275 other release specific data in <TT
279 updated (this is done just prior to a new release).
287 >3.1. Quickstart to Docbook and SGML</A
290 > If you are not familiar with SGML, it is a markup language similar to HTML.
291 Actually, not a mark up language per se, but a language used to define
292 markup languages. In fact, HTML is an SGML application. Both will use
296 > to format text and other content. SGML tags can be much
297 more varied, and flexible, but do much of the same kinds of things. The tags,
301 >, are definable in SGML. There is no set
305 >. Since we are using
309 >, our tags are those that are defined by
313 >. Much of how the finish document is
314 rendered is determined by the <SPAN
318 The stylesheets determine how each tag gets translated to HTML, or other
321 > Tags in Docbook SGML need to be always <SPAN
325 will likely generate errors. Example: <TT
328 Title</title></TT
329 >. They are also case-insensitive, but we
330 strongly suggest using all lower case. This keeps compatibility with
336 > Our documents use <SPAN
339 > for the most part. Sections
340 will be processed into HTML headers (e.g. <TT
351 will use these to also generate the Table of Contents for each doc. Our
352 TOC's are set to a depth of three. Meaning <TT
366 > will not. Each section requires
370 > element, and at least one
374 >. There is a limit of five section
375 levels in Docbook, but generally three should be sufficient for our
378 > Some common elements that you likely will use:</P
390 ><para></para></I
392 >, paragraph delimiter. Most
393 text needs to be within paragraph elements (there are some exceptions).
402 ><emphasis></emphasis></I
414 ><filename></filename></I
416 >, files and directories.
425 ><command></command></I
436 ><literallayout></literallayout></I
451 ><itemizedlist></itemizedlist></I
453 >, list with bullets.
462 ><listitem></listitem></I
464 >, member of the above.
473 ><screen></screen></I
475 >, screen output, implies
478 ><literallayout></TT
488 ><ulink url="example.com"></ulink></I
503 ><quote></quote></I
505 >, for, doh, quoting text.
513 > Look at any of the existing docs for examples of all these and more.</P
515 > You might also find
520 HREF="https://web.archive.org/web/20160315230758/http://opensource.bureau-cornavin.com/crash-course/index.html"
522 > Writing Documentation Using DocBook - A Crash Course</A
535 > Documentation Style</A
538 > It will be easier if everyone follows a similar writing style. This
539 just makes it easier to read what someone else has written if it
540 is all done in a similar fashion.
550 > All tags should be lower case.
555 > Tags delimiting a <SPAN
561 > of text (even small
562 blocks) should be on their own line. Like:
565 CLASS="LITERALLAYOUT"
566 > <para><br>
567 Some text goes here.<br>
568 </para></P
570 > Tags marking individual words, or few words, should be in-line:
573 CLASS="LITERALLAYOUT"
574 > Just to <emphasis>emphasize</emphasis>, some text goes here.</P
578 > Tags should be nested and step indented for block text like: (except
582 CLASS="LITERALLAYOUT"
583 > <para><br>
584 <itemizedlist><br>
585 <para><br>
586 <listitem><br>
587 Some text goes here in our list example.<br>
588 </listitem><br>
589 </para><br>
590 </itemizedlist><br>
591 </para></P
593 > This makes it easier to find the text amongst the tags ;-)
598 > Use white space to separate logical divisions within a document,
599 like between sections. Running everything together consistently
600 makes it harder to read and work on.
605 > Do not hesitate to make comments. Comments can either use the
606 <comment> element, or the <!-- --> style comment
607 familiar from HTML. (Note in Docbook v4.x <comment> is
608 replaced by <remark>.)
613 > We have an international audience. Refrain from slang, or English
614 idiosyncrasies (too many to list :). Humor also does not translate
620 > Try to keep overall line lengths in source files to 80 characters or less
621 for obvious reasons. This is not always possible, with lengthy URLs for
627 > Our documents are available in differing formats. Right now, they
628 are just plain text and/or HTML, but others are always a
629 future possibility. Be careful with URLs (<ulink>), and avoid
633 > My favorite site is <ulink url="http://example.com">here</ulink>.
636 > This will render as <SPAN
638 >"My favorite site is here"</SPAN
640 not real helpful in a text doc. Better like this:
643 > My favorite site is <ulink url="http://example.com">example.com</ulink>.
648 > All documents should be spell checked occasionally.
652 > can check SGML with the
671 >3.3. Privoxy Custom Entities</A
677 > documentation is using
678 a number of customized <SPAN
682 documentation maintenance.
685 > We are using a set of <SPAN
688 > files with generic text,
689 that is used by multiple docs. This way we can write something once, and use
690 it repeatedly without having to re-write the same content over and over again.
691 If editing such a file, keep in mind that it should be
698 >. That is the purpose; so it can be used in varying
699 contexts without additional modifications.
702 > We are also using what <SPAN
708 >"internal entities"</SPAN
709 >. These are like variables in
710 programming. Well, sort of. For instance, we have the
714 > entity that contains the current
718 > version string. You are strongly
719 encouraged to use these where possible. Some of these obviously
720 require re-setting with each release (done by the Makefile). A sampling of
721 custom entities are listed below. See any of the main docs for examples.
731 > text entities are defined like:
736 ><!entity supported SYSTEM "supported.sgml"></TT
740 > In this example, the contents of the file,
744 > is available for inclusion anywhere
745 in the doc. To make this happen, just reference the now defined
749 > (starts with an ampersand
750 and ends with a semi-colon), and the contents will be dumped into
751 the finished doc at that point.
756 > Commonly used <SPAN
758 >"internal entities"</SPAN
778 version string, e.g. <SPAN
792 >: the project status, either
813 >: use to conditionally include
817 > releases (e.g. <SPAN
831 >: just the opposite.
842 >: this doc is only generated as text.
852 > There are others in various places that are defined for a specific
853 purpose. Read the source!
862 SUMMARY="Footer navigation table"
901 >The Git Repository</TD
911 >Coding Guidelines</TD