.\" Copyright (c) 2010 Stijn van Dongen .TH "pud-faq" 7 "8 Jan 2010" "pud-faq 1\&.002, 10-008" "MISCELLANEOUS " .po 2m .de ZI .\" Zoem Indent/Itemize macro I. .br 'in +\\$1 .nr xa 0 .nr xa -\\$1 .nr xb \\$1 .nr xb -\\w'\\$2' \h'|\\n(xau'\\$2\h'\\n(xbu'\\ .. .de ZJ .br .\" Zoem Indent/Itemize macro II. 'in +\\$1 'in +\\$2 .nr xa 0 .nr xa -\\$2 .nr xa -\\w'\\$3' .nr xb \\$2 \h'|\\n(xau'\\$3\h'\\n(xbu'\\ .. .if n .ll -2m .am SH .ie n .in 4m .el .in 8m .. .de ZT .\" Zoem Faq (Toc) macro. .nr xb \\n(.k .nr xb -1m .nr xa \\$1 .nr xa -\\n(.k .nr xa -\\n(.i \h'\\n(xau'\\$2\l'|\\n(xbu.'\h'1m'\\ .. .de ZB .\" Zoem Faq (Body) macro. .nr xb \\n(.k .nr xa \\$1 .nr xa -\\n(.k .nr xa -\\n(.i \h'\\n(xau'\\$2\h'|\\n(xbu'\\ .. .am SH .ie n .in 8m .el .in 8m .. .SH NAME pud-faq \- faqs and facts about the Portable Unix Documentation FAQ authoring language\&. This document describes the Portable Unix Documentation (PUD) faq mini-language in the style of a FAQ\&. PUD-faq is built on top of the macro interpreter zoem\&. A PUD document is generally well-structured, relatively free of formatting statements, compact to write and easily extendable\&. It can be converted to both troff and html, for viewing in terminals and browsers\&. High quality Postscript and plain text formats can be derived from the troff output\&. Refer to \fBpud-man\fP for examples\&. .SH DESCRIPTION The PUD faq macros extend the PUD manual macros; a PUD faq document must import both man\&.zmm and faq\&.zmm\&. There are only a few additional faq macros in faq\&.zmm\&. The overall layout of a faq document is as follows: .di ZV .in 0 .nf \fC \eimport{man\&.zmm} \eimport{faq\&.zmm} \ebegin{pud::man}{ {name}{pud-faq} {html_title}{The PUD faq mini-language FAQ} {author}{Stijn van Dongen} {section}{7} } \e"faq::preamble" \e${html}{\e"man::maketoc"} \esec{toc}{TOC} \e"faq::maketoc" \ebegin{faqsec}{{ref}{Labelx}{cap}{Captionx}} content \eend{faqsec} \ebegin{faqsec}{{ref}{Labely}{cap}{Captiony}} content \eend{faqsec} \eend{pud::man} .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR The PUD manual macros are documented in the \fBpud-man\fP manual page\&. Create your FAQ according to the lay-out above and as described further below\&. Refer to \fIQuestion\ \&2\&.3\fP for full-size examples\&. Once you have written your FAQ, process it as follows\&. .di ZV .in 0 .nf \fC zoem -i your-faq\&.azm -d html zoem -i your-faq\&.azm -d html zoem -i your-faq\&.azm -d roff -o your-faq\&.7 zoem -i your-faq\&.azm -d roff -o your-faq\&.7 .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR This generates files your-faq\&.html and your-faq\&.7\&. Each device is run twice to be certain that references are found and linked\&. .SH RESOURCES .ZJ 1m 1m "\(bu" The \fIZoem User Manual\fP\&. .in -2m .ZJ 1m 1m "\(bu" The \fBpud-man\fP manual page\&. .in -2m .SH TOC .ZT 0m \fB1\fP \s+1\fBHow do I create and link to questions and sections?\fP\s-1 .br .ZT 1m \fB1\&.1\fP How do I start a section? .br .ZT 1m \fB1\&.2\fP How do I make a faq entry? .br .ZT 1m \fB1\&.3\fP How do I link to a question? .br .ZT 1m \fB1\&.4\fP How do I link to a section? .br .ZT 1m \fB1\&.5\fP Is that not a whole lot of typing just for linking? .ZT 0m \fB2\fP \s+1\fBMiscellaneous\fP\s-1 .br .ZT 1m \fB2\&.1\fP Is it really possible to have more than one section? .br .ZT 1m \fB2\&.2\fP Is there an easy way to get back to the TOC? .br .ZT 1m \fB2\&.3\fP Show me a real FAQ, not this nonsense\&. .br .ZT 1m \fB2\&.4\fP I want to change the appearance of my FAQ\&. .br .ZT 1m \fB2\&.5\fP Show me the source to this FAQ\&. .SH FAQ .ce \s+2\fBHow do I create and link to questions and sections?\fP\s-2 .ZB 1m \fB1\&.1\fP \s+1\fBHow do I start a section?\fP\s-1 You would for example type .di ZV .in 0 .nf \fC \ebegin{faqsec}{ {ref}{kind} {cap}{How do I link to questions and sections?} } .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR .ZB 1m \fB1\&.2\fP \s+1\fBHow do I make a faq entry?\fP\s-1 You create an entry as follows: .di ZV .in 0 .nf \fC \efaq{q_question}{How do I make a faq entry?} You create an entry as follows: \&.\&.\&. .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR .ZB 1m \fB1\&.3\fP \s+1\fBHow do I link to a question?\fP\s-1 .di ZV .in 0 .nf \fC \ecar{Like this: linking to \eiref{q_qlink}{Question\e~\erefnumber{q_qlink}}, or a silly link to the \eiref{q_qlink}{current question}\&. Linking to \eiref{s_basics}{Question\e~\erefnumber{q_slink}}, or a link to the \eiref{q_slink}{next question}\&.} \epar{ Of course, you have to use wordings such that the text still makes sense in the absence of links (assuming you are intested in the troff version of the FAQ you are writing), so normally you just refer to \eiref{q_slink}{Question\e~\erefnumber{q_slink}} and be done with it\&.} .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR Like this: linking to \fIQuestion\ \&1\&.3\fP, or a silly link to the \fIcurrent question\fP\&. Linking to \fIQuestion\ \&1\&.4\fP, or a link to the \fInext question\fP\&. Of course, you have to use wordings such that the text still makes sense in the absence of links (assuming you are intested in the troff version of the FAQ you are writing), so normally you just refer to \fIQuestion\ \&1\&.4\fP and be done with it\&. .ZB 1m \fB1\&.4\fP \s+1\fBHow do I link to a section?\fP\s-1 .di ZV .in 0 .nf \fC \ecar{Like this: linking to \eiref{q_qlink}{Section\e~\erefnumber{s_basics}} and linking to \eiref{q_stupid}{Section\e~\erefnumber{s_stupid}}\&.} .fi \fR .in .di .ne \n(dnu .nf \fC .ZV .fi \fR Like this: linking to \fISection\ \&1\fP and linking to \fISection\ \&2\fP\&. .ZB 1m \fB1\&.5\fP \s+1\fBIs that not a whole lot of typing just for linking?\fP\s-1 It sure is\&. Note the repeating elements though\&. Feel free to create your own shortcuts by using Zoem\&'s macro facilities\&. .ce \s+2\fBMiscellaneous\fP\s-2 .ZB 1m \fB2\&.1\fP \s+1\fBIs it really possible to have more than one section?\fP\s-1 QED .ZB 1m \fB2\&.2\fP \s+1\fBIs there an easy way to get back to the TOC?\fP\s-1 In the HTML version of the faq, one can click on the number to the left of the question; this will take you to the top of the TOC part pertaining to the section that question belongs to\&. .ZB 1m \fB2\&.3\fP \s+1\fBShow me a real FAQ, not this nonsense\&.\fP\s-1 The reason I began writing zoem and PUD was that I wanted decent (both HTML and troff) and easy to write documentation for my implementation of the MCL cluster algorithm\&. .ZJ 1m 1m "\(bu" http://micans\&.org/mcl/src/mcl-latest/doc/mclfaq\&.azm .in -2m .ZJ 1m 1m "\(bu" http://micans\&.org/mcl/src/mcl-latest/doc/mclfaq\&.html .in -2m .ZJ 1m 1m "\(bu" http://micans\&.org/mcl/src/mcl-latest/doc/mclfaq\&.ps .in -2m .ZB 1m \fB2\&.4\fP \s+1\fBI want to change the appearance of my FAQ\&.\fP\s-1 Well, you need to make a copy of the faq macros and possibly the man macros, and hack those changes in\&. Zoem itself is very flexible, but the PUD faq macros are not, in this respect\&. They can be made so, if you wish\&. If you just want to change or add some style sheet rules for the HTML version, it will be quite easy\&. The same holds for changing font styles and possibly even spacing rules\&. .ZB 1m \fB2\&.5\fP \s+1\fBShow me the source to this FAQ\&.\fP\s-1 Search for pud-faq\&.azm in your install of zoem\&. Take note though that I played a few silly tricks in this FAQ, so the source looks more unreadable than your average FAQ\&. The FAQ pointed to in \fIAnswer\ \&2\&.3\fP gives a more realistic impression\&. .SH AUTHOR Stijn van Dongen\&. .SH SEE ALSO The \fBpud-man\fP manual page, documenting the PUD manual language\&. The FAQ language imports the manual definitions and you use these e\&.g\&. for sectioning commands as described above\&. The \fBpud\fP manual page gives an overview of PUD\&.