generated
[privoxy.git] / doc / webserver / developer-manual / documentation.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Documentation Guidelines</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8 "><LINK
9 REL="HOME"
10 TITLE="Privoxy Developer Manual"
11 HREF="index.html"><LINK
12 REL="PREVIOUS"
13 TITLE="The CVS Repository"
14 HREF="cvs.html"><LINK
15 REL="NEXT"
16 TITLE="Coding Guidelines"
17 HREF="coding.html"><LINK
18 REL="STYLESHEET"
19 TYPE="text/css"
20 HREF="../p_doc.css"></HEAD
21 ><BODY
22 CLASS="SECT1"
23 BGCOLOR="#EEEEEE"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >Privoxy Developer Manual</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="cvs.html"
48 >Prev</A
49 ></TD
50 ><TD
51 WIDTH="80%"
52 ALIGN="center"
53 VALIGN="bottom"
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="right"
58 VALIGN="bottom"
59 ><A
60 HREF="coding.html"
61 >Next</A
62 ></TD
63 ></TR
64 ></TABLE
65 ><HR
66 ALIGN="LEFT"
67 WIDTH="100%"></DIV
68 ><DIV
69 CLASS="SECT1"
70 ><H1
71 CLASS="SECT1"
72 ><A
73 NAME="DOCUMENTATION"
74 >3. Documentation Guidelines</A
75 ></H1
76 ><P
77 >    All formal documents are maintained in Docbook SGML and located in the
78     <TT
79 CLASS="COMPUTEROUTPUT"
80 >doc/source/*</TT
81 > directory. You will need
82     <A
83 HREF="http://www.docbook.org"
84 TARGET="_top"
85 >Docbook</A
86 >, the Docbook 
87     DTD's and the Docbook modular stylesheets (or comparable alternatives),
88     and either <SPAN
89 CLASS="APPLICATION"
90 >jade</SPAN
91 > or
92     <SPAN
93 CLASS="APPLICATION"
94 >openjade</SPAN
95 > (recommended) installed in order to
96     build docs from source. Currently there is <A
97 HREF="../user-manual/index.html"
98 TARGET="_top"
99 ><I
100 CLASS="CITETITLE"
101 >user-manual</I
102 ></A
103 >,
104     <A
105 HREF="../faq/index.html"
106 TARGET="_top"
107 ><I
108 CLASS="CITETITLE"
109 >FAQ</I
110 ></A
111 >, and, of
112     course this, the <I
113 CLASS="CITETITLE"
114 >developer-manual</I
115 > in this format.
116     The <I
117 CLASS="CITETITLE"
118 >README</I
119 >, <I
120 CLASS="CITETITLE"
121 >AUTHORS</I
122 >
123     <I
124 CLASS="CITETITLE"
125 >privoxy.1</I
126 > (man page) files are also now maintained
127     as Docbook SGML. The finished files are all in the top-level source
128     directory are generated files! Also, <TT
129 CLASS="FILENAME"
130 >index.html</TT
131 >, the
132     <SPAN
133 CLASS="APPLICATION"
134 >Privoxy</SPAN
135 > home page, is maintained as SGML.
136     <I
137 CLASS="EMPHASIS"
138 >DO NOT edit these directly</I
139 >. Edit the SGML source, or
140     contact someone involved in the documentation (at present Stefan and
141     Hal).
142     </P
143 ><P
144 >     Other, less formal documents (e.g. <TT
145 CLASS="FILENAME"
146 >LICENSE</TT
147 >,
148      <TT
149 CLASS="FILENAME"
150 >INSTALL</TT
151 >) are maintained as plain text files in the
152      top-level source directory. At least for the time being.
153     </P
154 ><P
155 >     Packagers are encouraged to include this documentation. For those without
156      the ability to build the docs locally, text versions of each are kept in
157      CVS. HTML versions are also now being kept in CVS under 
158      <TT
159 CLASS="FILENAME"
160 >doc/webserver/*</TT
161 >.
162     </P
163 ><P
164 >     Formal documents are built with the Makefile targets of
165      <TT
166 CLASS="COMPUTEROUTPUT"
167 >make dok</TT
168 >, or alternately
169      <TT
170 CLASS="COMPUTEROUTPUT"
171 >make redhat-dok</TT
172 >. If you have problems,
173      try both. The build process uses the document SGML sources in
174      <TT
175 CLASS="COMPUTEROUTPUT"
176 >doc/source/*/*</TT
177 > to update all text files in
178      <TT
179 CLASS="COMPUTEROUTPUT"
180 >doc/text/</TT
181 > and to update all HTML
182      documents in <TT
183 CLASS="COMPUTEROUTPUT"
184 >doc/webserver/</TT
185 >.
186     </P
187 ><P
188 >     Documentation writers should please make sure documents build
189      successfully before committing to CVS, if possible.
190     </P
191 ><P
192 >     How do you update the webserver (i.e. the pages on privoxy.org)?
193      
194      <P
195 ></P
196 ><OL
197 TYPE="1"
198 ><LI
199 ><P
200 >        First, build the docs by running <TT
201 CLASS="COMPUTEROUTPUT"
202 >make
203         dok</TT
204 > (or alternately <TT
205 CLASS="COMPUTEROUTPUT"
206 >make
207         redhat-dok</TT
208 >).                 
209       </P
210 ></LI
211 ><LI
212 ><P
213 >        Run <TT
214 CLASS="COMPUTEROUTPUT"
215 >make webserver</TT
216 > which copies all
217         files from <TT
218 CLASS="COMPUTEROUTPUT"
219 >doc/webserver</TT
220 > to the
221         sourceforge webserver via scp.
222       </P
223 ></LI
224 ></OL
225 >
226   </P
227 ><P
228 >   Finished docs should be occasionally submitted to CVS
229    (<TT
230 CLASS="FILENAME"
231 >doc/webserver/*/*.html</TT
232 >) so that those without 
233    the ability to build them locally, have access to them if needed.
234    This is especially important just prior to a new release! Please
235    do this <I
236 CLASS="EMPHASIS"
237 >after</I
238 > the <TT
239 CLASS="LITERAL"
240 >$VERSION</TT
241 > and
242    other release specific data in <TT
243 CLASS="FILENAME"
244 >configure.in</TT
245 > has been
246    updated (this is done just prior to a new release).
247   </P
248 ><DIV
249 CLASS="SECT2"
250 ><H2
251 CLASS="SECT2"
252 ><A
253 NAME="SGML"
254 >3.1. Quickstart to Docbook and SGML</A
255 ></H2
256 ><P
257 > If you are not familiar with SGML, it is a markup language similar to HTML. 
258  Actually, not a mark up language per se, but a language used to define 
259  markup languages. In fact, HTML is an SGML application. Both will use
260  <SPAN
261 CLASS="QUOTE"
262 >"tags"</SPAN
263 > to format text and other content. SGML tags can be much
264  more varied, and flexible, but do much of the same kinds of things. The tags,
265  or <SPAN
266 CLASS="QUOTE"
267 >"elements"</SPAN
268 >, are definable in SGML. There is no set
269  <SPAN
270 CLASS="QUOTE"
271 >"standards"</SPAN
272 >. Since we are using
273  <SPAN
274 CLASS="APPLICATION"
275 >Docbook</SPAN
276 >, our tags are those that are defined by 
277  <SPAN
278 CLASS="APPLICATION"
279 >Docbook</SPAN
280 >. Much of how the finish document is
281  rendered is determined by the <SPAN
282 CLASS="QUOTE"
283 >"stylesheets"</SPAN
284 >.
285  The stylesheets determine how each tag gets translated to HTML, or other
286  formats.</P
287 ><P
288 > Tags in Docbook SGML need to be always <SPAN
289 CLASS="QUOTE"
290 >"closed"</SPAN
291 >. If not, you
292  will likely generate errors. Example: <TT
293 CLASS="LITERAL"
294 >&#60;title&#62;My
295  Title&#60;/title&#62;</TT
296 >. They are also case-insensitive, but we
297  strongly suggest using all lower case. This keeps compatibility with
298  [Docbook] <SPAN
299 CLASS="APPLICATION"
300 >XML</SPAN
301 >.</P
302 ><P
303 > Our documents use <SPAN
304 CLASS="QUOTE"
305 >"sections"</SPAN
306 > for the most part. Sections
307  will be processed into HTML headers (e.g. <TT
308 CLASS="LITERAL"
309 >h1</TT
310 > for 
311  <TT
312 CLASS="LITERAL"
313 >sect1</TT
314 >). The <SPAN
315 CLASS="APPLICATION"
316 >Docbook</SPAN
317 > stylesheets
318  will use these to also generate the Table of Contents for each doc. Our 
319  TOC's are set to a depth of three. Meaning <TT
320 CLASS="LITERAL"
321 >sect1</TT
322 >, 
323  <TT
324 CLASS="LITERAL"
325 >sect2</TT
326 >, and <TT
327 CLASS="LITERAL"
328 >sect3</TT
329 > will have TOC 
330  entries, but <TT
331 CLASS="LITERAL"
332 >sect4</TT
333 > will not. Each section requires 
334  a <TT
335 CLASS="LITERAL"
336 >&#60;title&#62;</TT
337 > element, and at least one 
338  <TT
339 CLASS="LITERAL"
340 >&#60;para&#62;</TT
341 >. There is a limit of five section 
342  levels in Docbook, but generally three should be sufficient for our 
343  purposes.</P
344 ><P
345 > Some common elements that you likely will use: </P
346 ><P
347 >  <P
348 ></P
349 ><TABLE
350 BORDER="0"
351 ><TBODY
352 ><TR
353 ><TD
354 >      <I
355 CLASS="EMPHASIS"
356 >&#60;para&#62;&#60;/para&#62;</I
357 >, paragraph delimiter. Most 
358       text needs to be within paragraph elements (there are some exceptions).
359     </TD
360 ></TR
361 ><TR
362 ><TD
363 >      <I
364 CLASS="EMPHASIS"
365 >&#60;emphasis&#62;&#60;/emphasis&#62;</I
366 >, the stylesheets
367       make this italics.
368     </TD
369 ></TR
370 ><TR
371 ><TD
372 >      <I
373 CLASS="EMPHASIS"
374 >&#60;filename&#62;&#60;/filename&#62;</I
375 >, files and directories.
376     </TD
377 ></TR
378 ><TR
379 ><TD
380 >      <I
381 CLASS="EMPHASIS"
382 >&#60;command&#62;&#60;/command&#62;</I
383 >, command examples.
384     </TD
385 ></TR
386 ><TR
387 ><TD
388 >      <I
389 CLASS="EMPHASIS"
390 >&#60;literallayout&#62;&#60;/literallayout&#62;</I
391 >, like 
392       <TT
393 CLASS="LITERAL"
394 >&#60;pre&#62;</TT
395 >, more or less.
396     </TD
397 ></TR
398 ><TR
399 ><TD
400 >      <I
401 CLASS="EMPHASIS"
402 >&#60;itemizedlist&#62;&#60;/itemizedlist&#62;</I
403 >, list with bullets.
404     </TD
405 ></TR
406 ><TR
407 ><TD
408 >      <I
409 CLASS="EMPHASIS"
410 >&#60;listitem&#62;&#60;/listitem&#62;</I
411 >, member of the above.
412     </TD
413 ></TR
414 ><TR
415 ><TD
416 >      <I
417 CLASS="EMPHASIS"
418 >&#60;screen&#62;&#60;/screen&#62;</I
419 >, screen output, implies 
420       <TT
421 CLASS="LITERAL"
422 >&#60;literallayout&#62;</TT
423 >.
424     </TD
425 ></TR
426 ><TR
427 ><TD
428 >      <I
429 CLASS="EMPHASIS"
430 >&#60;ulink url="example.com"&#62;&#60;/ulink&#62;</I
431 >, like 
432       HTML <TT
433 CLASS="LITERAL"
434 >&#60;a&#62;</TT
435 > tag.
436     </TD
437 ></TR
438 ><TR
439 ><TD
440 >      <I
441 CLASS="EMPHASIS"
442 >&#60;quote&#62;&#60;/quote&#62;</I
443 >, for, doh, quoting text. 
444     </TD
445 ></TR
446 ></TBODY
447 ></TABLE
448 ><P
449 ></P
450 ></P
451 ><P
452 > Look at any of the existing docs for examples of all these and more.</P
453 ><P
454 > You might also find <SPAN
455 CLASS="QUOTE"
456 >"<A
457 HREF="http://www.bureau-cornavin.com/opensource/crash-course/"
458 TARGET="_top"
459 >Writing Documentation
460  Using DocBook - A Crash Course</A
461 >"</SPAN
462 > useful.</P
463 ></DIV
464 ><DIV
465 CLASS="SECT2"
466 ><H2
467 CLASS="SECT2"
468 ><A
469 NAME="DOCSTYLE"
470 >3.2. <SPAN
471 CLASS="APPLICATION"
472 >Privoxy</SPAN
473 > Documentation Style</A
474 ></H2
475 ><P
476 >    It will be easier if everyone follows a similar writing style. This 
477     just makes it easier to read what someone else has written if it 
478     is all done in a similar fashion.
479    </P
480 ><P
481 >    Here it is:
482    </P
483 ><P
484 >    <P
485 ></P
486 ><UL
487 ><LI
488 ><P
489 >       All tags should be lower case.
490       </P
491 ></LI
492 ><LI
493 ><P
494 >       Tags delimiting a <I
495 CLASS="EMPHASIS"
496 >block</I
497 > of text (even small
498        blocks) should be on their own line. Like:
499        <P
500 CLASS="LITERALLAYOUT"
501 >&nbsp;&#60;para&#62;<br>
502 &nbsp;&nbsp;Some&nbsp;text&nbsp;goes&nbsp;here.<br>
503 &nbsp;&#60;/para&#62;<br>
504 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P
505 >
506        Tags marking individual words, or few words, should be in-line:
507        <P
508 CLASS="LITERALLAYOUT"
509 >&nbsp;&nbsp;Just&nbsp;to&nbsp;&#60;emphasis&#62;emphasize&#60;/emphasis&#62;,&nbsp;some&nbsp;text&nbsp;goes&nbsp;here.<br>
510 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P
511 >
512      </P
513 ></LI
514 ><LI
515 ><P
516 >      Tags should be nested and step indented for block text like: (except
517       in-line tags) 
518      <P
519 CLASS="LITERALLAYOUT"
520 >&nbsp;&#60;para&#62;<br>
521 &nbsp;&nbsp;&#60;itemizedlist&#62;<br>
522 &nbsp;&nbsp;&nbsp;&#60;para&#62;<br>
523 &nbsp;&nbsp;&nbsp;&nbsp;&#60;listitem&#62;<br>
524 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Some&nbsp;text&nbsp;goes&nbsp;here&nbsp;in&nbsp;our&nbsp;list&nbsp;example.<br>
525 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#60;/listitem&#62;<br>
526 &nbsp;&nbsp;&nbsp;&#60;/para&#62;<br>
527 &nbsp;&nbsp;&#60;/itemizedlist&#62;<br>
528 &nbsp;&#60;/para&#62;<br>
529 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P
530 >
531       This makes it easier to find the text amongst the tags ;-)
532     </P
533 ></LI
534 ><LI
535 ><P
536 >     Use white space to separate logical divisions within a document, 
537      like between sections. Running everything together consistently 
538      makes it harder to read and work on.
539     </P
540 ></LI
541 ><LI
542 ><P
543 >     Do not hesitate to make comments. Comments can either use the 
544      &#60;comment&#62; element, or the &#60;!--  --&#62; style comment 
545      familiar from HTML. (Note in Docbook v4.x &#60;comment&#62; is 
546      replaced by &#60;remark&#62;.)
547     </P
548 ></LI
549 ><LI
550 ><P
551 >     We have an international audience. Refrain from slang, or English 
552      idiosyncrasies (too many to list :). Humor also does not translate 
553      well sometimes.
554    </P
555 ></LI
556 ><LI
557 ><P
558 >    Try to keep overall line lengths in source files to 80 characters or less
559     for obvious reasons. This is not always possible, with lengthy URLs for
560     instance.
561    </P
562 ></LI
563 ><LI
564 ><P
565 >    Our documents are available in differing formats. Right now, they 
566     are just plain text, and HTML, but PDF, and others is always a 
567     future possibility. Be careful with URLs (&#60;ulink&#62;), and avoid 
568     this mistake:
569    </P
570 ><P
571 >     My favorite site is &#60;ulink url="http://example.com"&#62;here&#60;/ulink&#62;.
572    </P
573 ><P
574 >     This will render as <SPAN
575 CLASS="QUOTE"
576 >"My favorite site is here"</SPAN
577 >, which is 
578      not real helpful in a text doc. Better like this:
579    </P
580 ><P
581 >     My favorite site is &#60;ulink url="http://example.com"&#62;example.com&#60;/ulink&#62;.
582    </P
583 ></LI
584 ><LI
585 ><P
586 >    All documents should be spell checked occasionally.
587     <SPAN
588 CLASS="APPLICATION"
589 >aspell</SPAN
590 > can check SGML with the
591     <TT
592 CLASS="LITERAL"
593 >-H</TT
594 > option. (<SPAN
595 CLASS="APPLICATION"
596 >ispell</SPAN
597 > I think
598     too.)
599    </P
600 ></LI
601 ></UL
602 >
603  </P
604 ></DIV
605 ><DIV
606 CLASS="SECT2"
607 ><H2
608 CLASS="SECT2"
609 ><A
610 NAME="AEN209"
611 >3.3. Privoxy Custom Entities</A
612 ></H2
613 ><P
614 >  <SPAN
615 CLASS="APPLICATION"
616 >Privoxy</SPAN
617 > documentation is using 
618   a number of customized <SPAN
619 CLASS="QUOTE"
620 >"entities"</SPAN
621 > to facilitate 
622   documentation maintenance. 
623  </P
624 ><P
625 >  We are using a set of <SPAN
626 CLASS="QUOTE"
627 >"boilerplate"</SPAN
628 > files with generic text,
629   that is used by multiple docs. This way we can write something once, and use
630   it repeatedly without having to re-write the same content over and over again.
631   If editing such a file, keep in mind that it should be
632   <I
633 CLASS="EMPHASIS"
634 >generic</I
635 >. That is the purpose; so it can be used in varying 
636   contexts without additional modifications.
637  </P
638 ><P
639 >  We are also using what <SPAN
640 CLASS="APPLICATION"
641 >Docbook</SPAN
642 > calls 
643   <SPAN
644 CLASS="QUOTE"
645 >"internal entities"</SPAN
646 >. These are like variables in 
647   programming. Well, sort of. For instance, we have the
648   <TT
649 CLASS="LITERAL"
650 >p-version</TT
651 > entity that contains the current 
652   <SPAN
653 CLASS="APPLICATION"
654 >Privoxy</SPAN
655 > version string. You are strongly 
656   encouraged to use these where possible. Some of these obviously 
657   require re-setting with each release (done by the Makefile). A sampling of
658   custom entities are listed below. See any of the main docs for examples.
659  </P
660 ><P
661 >  <P
662 ></P
663 ><UL
664 ><LI
665 ><P
666 >    Re- <SPAN
667 CLASS="QUOTE"
668 >"boilerplate"</SPAN
669 > text entities are defined like:
670    </P
671 ><P
672 >    <TT
673 CLASS="LITERAL"
674 >&#60;!entity supported SYSTEM "supported.sgml"&#62;</TT
675 >
676    </P
677 ><P
678 >     In this example, the contents of the file,
679      <TT
680 CLASS="FILENAME"
681 >supported.sgml</TT
682 > is available for inclusion anywhere 
683      in the doc. To make this happen, just reference the now defined 
684      entity: <TT
685 CLASS="LITERAL"
686 >&#38;supported;</TT
687 > (starts with an ampersand 
688      and ends with a semi-colon), and the contents will be dumped into 
689      the finished doc at that point.
690    </P
691 ></LI
692 ><LI
693 ><P
694 >    Commonly used <SPAN
695 CLASS="QUOTE"
696 >"internal entities"</SPAN
697 >:
698   </P
699 ><P
700 ></P
701 ><TABLE
702 BORDER="0"
703 ><TBODY
704 ><TR
705 ><TD
706 >    <I
707 CLASS="EMPHASIS"
708 >p-version</I
709 >: the <SPAN
710 CLASS="APPLICATION"
711 >Privoxy</SPAN
712
713     version string, e.g. <SPAN
714 CLASS="QUOTE"
715 >"2.9.15"</SPAN
716 >.
717    </TD
718 ></TR
719 ><TR
720 ><TD
721 >    <I
722 CLASS="EMPHASIS"
723 >p-status</I
724 >: the project status, either 
725     <SPAN
726 CLASS="QUOTE"
727 >"alpha"</SPAN
728 >, <SPAN
729 CLASS="QUOTE"
730 >"beta"</SPAN
731 >, or <SPAN
732 CLASS="QUOTE"
733 >"stable"</SPAN
734 >.
735    </TD
736 ></TR
737 ><TR
738 ><TD
739 >    <I
740 CLASS="EMPHASIS"
741 >p-not-stable</I
742 >: use to conditionally include 
743     text in <SPAN
744 CLASS="QUOTE"
745 >"not stable"</SPAN
746 > releases (e.g. <SPAN
747 CLASS="QUOTE"
748 >"beta"</SPAN
749 >).
750    </TD
751 ></TR
752 ><TR
753 ><TD
754 >    <I
755 CLASS="EMPHASIS"
756 >p-stable</I
757 >: just the opposite.
758    </TD
759 ></TR
760 ><TR
761 ><TD
762 >    <I
763 CLASS="EMPHASIS"
764 >p-text</I
765 >: this doc is only generated as text.
766    </TD
767 ></TR
768 ></TBODY
769 ></TABLE
770 ><P
771 ></P
772 ></LI
773 ></UL
774 >
775  </P
776 ><P
777 >  There are others in various places that are defined for a specific 
778   purpose. Read the source!
779  </P
780 ></DIV
781 ></DIV
782 ><DIV
783 CLASS="NAVFOOTER"
784 ><HR
785 ALIGN="LEFT"
786 WIDTH="100%"><TABLE
787 WIDTH="100%"
788 BORDER="0"
789 CELLPADDING="0"
790 CELLSPACING="0"
791 ><TR
792 ><TD
793 WIDTH="33%"
794 ALIGN="left"
795 VALIGN="top"
796 ><A
797 HREF="cvs.html"
798 >Prev</A
799 ></TD
800 ><TD
801 WIDTH="34%"
802 ALIGN="center"
803 VALIGN="top"
804 ><A
805 HREF="index.html"
806 >Home</A
807 ></TD
808 ><TD
809 WIDTH="33%"
810 ALIGN="right"
811 VALIGN="top"
812 ><A
813 HREF="coding.html"
814 >Next</A
815 ></TD
816 ></TR
817 ><TR
818 ><TD
819 WIDTH="33%"
820 ALIGN="left"
821 VALIGN="top"
822 >The CVS Repository</TD
823 ><TD
824 WIDTH="34%"
825 ALIGN="center"
826 VALIGN="top"
827 >&nbsp;</TD
828 ><TD
829 WIDTH="33%"
830 ALIGN="right"
831 VALIGN="top"
832 >Coding Guidelines</TD
833 ></TR
834 ></TABLE
835 ></DIV
836 ></BODY
837 ></HTML
838 >