Correct name of the selector is received_recipients, not log_recipients.
[exim.git] / doc / doc-docbook / Markup.txt
CommitLineData
f89d2485 1$Cambridge: exim/doc/doc-docbook/Markup.txt,v 1.5 2007/04/11 15:26:09 ph10 Exp $
9b371988
PH
2
3XFPT MARKUP USED IN THE EXIM DOCUMENTATION
4------------------------------------------
5
6This file contains a summary of the xfpt markup that is used in the source
7files of the Exim documentation. The source files are in plain text that can be
8edited by any text editor. They are converted by the xfpt application into
9DocBook XML for subsequent processing into the various output formats.
10
11The advantage of using xfpt format as a "back end" is that is uses relatively
12simple markup in the majority of the text, making it easier to read and edit.
13The disadvantage is that it is tricky to deal with complicated formatting,
14though that is probably true of any markup language, and is certainly true of
15XML itself.
16
17The Exim documentation uses standard xfpt DocBook markup with a few additions.
18The definitions of the additions that are used in spec.xfpt and filter.xfpt,
19respectively, appear at the start of each of those files. In this file we
20describe all the markup briefly, both the standard and additional items. See
21the xfpt specification for more details.
22
23Markup in xfpt is indicated in one of two ways: lines that start with a dot are
24interpreted specially ("directive lines"), and ampersand characters within the
25text always introduce a markup item. Recognized sequences that start with an
26ampersand are called "flags". Some of these have "partners" that do not
27necessarily start with an ampersand, but these must always appear after a flag
28that starts with an ampersand. There are no other forms of markup.
29
30There are two text characters that are not printed as their Ascii graphics.
31These are the grave accent and the single quote. They are automatically
32converted into opening and closing typographic quote characters in non-literal
33text. Other input characters that are not part of some markup always stand for
34themselves.
35
36
37CONTINUATION LINES
38
39Any line of input can be continued onto the next line by ending the first line
40with the sequence &&&. The line break and any leading spaces at the start of
41the following line are ignored. This processing happens as the lines are read
42in, before any other processing.
43
44
45SPECIAL CHARACTERS IN TEXT
46
47The following flag sequences are translated to non-Ascii characters:
48
49 &-- en-dash (generates –)
50 &~ hard space (generates  )
51
52The following two flags are for use on Exim option definitions. They are
53designed for use within italic text; however, they terminate and restart the
54italic so that the daggers themselves are roman. These flags do not work
55outside italic text.
56
57 &!! dagger (generates </emphasis>&dagger;<emphasis>)
58 &!? double dagger (generates </emphasis>&Dagger;<emphasis>)
59
60Any Unicode character can be accessed by giving its name or code point in the
61normal XML fashion. For example, &dagger; gives a dagger and &copy; gives a
62copyright symbol.
63
64
65AMPERSANDS AS DATA
66
67If you really do want an ampersand character in the text, you must type two
68ampersands. This is a flag that expands to &amp; in the output. Of course, you
69could also just type &amp; yourself; the flag is just for convenience.
70
71
72PAIRED FLAGS
73
74There are several sequences that use pairs of markup flags, surrounding some
75enclosed text, which is represented as ... in the following list:
76
77 &'...'& italic: maps to <emphasis>...</emphasis>
78 used for email addresses, domains, local
79 parts, header names, user names
80
81 &*...*& bold: maps to <emphasis role="bold">...</emphasis>
82 used for things like &*Note:*&
83
84 &`...`& monospaced text: maps to <literal>...</literal>
85 used for literal quoting in mixed-font text
86
87 &$...$& Exim variable: maps to <varname>$...</varname>
88 note that the leading dollar is automatically inserted
89
90 &%...%& Exim option, command line option: maps to <option>...</option>
91
92 &(...)& Exim driver name, Unix command name, filter command name:
93 maps to <command>...</command>
94
95 &[...]& C function: maps to <function>...</function>
96
97 &_..._& file name: maps to <filename>...</filename>
98
99 &"..."& put word in quotation marks: maps to <quote>...</quote>
100
101For example,
102
103 This is an &'italic phrase'&. This is a &_filename_& and a &$variable$&.
104 This &"word"& is in quote marks.
105
106It is important to use &"..."& rather than literal quotes so that different
107renditions can be used for different forms of output.
108
109These markup items can be nested, but not overlapped. However, the resulting
110XML from nested constructions is not always valid, so nesting is best avoided
111if possible. For example, &`xxx&'yyy'&xxx`& generates an <emphasis> item within
112a <literal> item, and the DocBook DTD does not allow that. However, a
113combination that does work is <literal> within an <emphasis>, so that is what
114you have to use if you want an italic or boldface monospaced font. For example,
115you have to use &*&`bold mono`&*& and not &`&*bold mono*&`&.
116
117
118LITERAL XML
119
120You can include blocks of literal XML between these two directive lines:
121
122 .literal xml
123 ...
124 .literal off
125
126There are some examples at the start of the Exim specification. You can also
127include individual XML elements by enclosing them in &<...>& but at the time of
128writing there are no examples of this usage in the Exim documentation.
129
130
131COMMENTS
132
133You can include comments that will not be copied to the XML document by
134starting a line with a dot followed by a space. You can include comments that
135are copied to the XML by either of the literal XML methods just described.
136
137
138URL REFERENCES
139
140To refer to a URL, use &url, followed by parentheses that can enclose one or
141two arguments, comma separated. The second, if present, is used as the
142displayed text. If there is only one argument, it is used both as the displayed
143text and as the URL. For example, here is a reference to
144&url(http://www.exim.org/,the exim home page). In HTML output, all you see is
145the display text; in printed output you see something like "the exim home page
146[http://www.exim.org/]". The URL is printed in a bold font.
147
148
149CHAPTERS AND SECTIONS
150
151The directives .chapter and .section mark the beginnings of chapters and
152sections. They are followed by a title in quotes, and optionally by up to two
153more arguments. Either single or double quotes can be used, and if you need a
154quote of the type being used as a delimiter within the string, it must be
155doubled. (Quotes are not in fact needed if the title contains no white space,
156but this is rare.)
157
158The second argument, if present and not an empty string, is an id for
159cross-references. For example:
160
161 .chapter "Environment for running local transports" "CHAPenvironment"
162
163To refer to a cross-reference point, enclose the name in &<<...>>&. For
164example:
165
166 See section &<<SECTexample>>&.
167
168Chapter titles are used for running feet in the PostScript and PDF forms of the
169manual. Sometimes they are too long, causing them to be split in an ugly way.
170The solution to this is to define a short title for the running feet as the
171third argument for .chapter or .section, like this:
172
173 .chapter "Environment for running local transports" "CHAPenvironment" &&&
174 "Environment for local transports"
175
176Note the use of &&& in this example to continue the logical input line. If you
177need to specify a third argument without a second argument, the second argument
178must be given as an empty string in quotes.
179
180
181DISPLAYS
182
183There are two forms of text display. Displayed blocks of literal text are
184started by .code and terminated by .endd:
185
186 .code
187 # Exim filter
188 deliver baggins@rivendell.middle-earth.example
189 .endd
190
191No flags are recognized in such blocks, which are displayed in a monospaced
192font.
193
194Blocks of text between .display and .endd are displayed in the current font,
195with the lines processed for flags as in normal paragraphs, but keeping the
196line layout. Flags can be used in the block to specify different fonts or
197special characters. For example:
198
199 .display
200 &`\n`& is replaced by a newline
201 &`\r`& is replaced by a carriage return
202 &`\t`& is replaced by a tab
203 .endd
204
205
206BLOCK QUOTES
207
208Text between .blockquote and .endblockquote is forced to start a new paragraph
209and is wrapped in a <blockquote> element.
210
211
212INDEX ENTRIES
213
214To create an index entry, include a line like one of these:
215
216 .cindex "primary text" "secondary text"
217 .oindex "primary text" "secondary text"
f89d2485 218 .vindex "&$variable_name$&"
9b371988 219
f89d2485
PH
220The first is for the "concept index", the second is for the "options index",
221and the third is for the "variables" index. The secondary text is of course
222optional. Not all forms of output distinguish between these - sometimes there
223is just one index. For the concept index, it is also possible to set "start"
224and "end" markers so that the entry lists a range of pages. This is how to do
225that:
4f578862
PH
226
227 .scindex IID "primary text" "secondary text"
228 <intervening text, should be several pages>
229 .ecindex IID
230
f89d2485 231The IID must be some unique string that ties the entries together.
9b371988
PH
232
233The index for the Exim reference manual has a number of "see also" entries.
234These are coded in raw XML at the start of the source file.
235
236
237LISTS
238
239Bulleted (itemized) lists are started by .ilist, and ordered (numbered) lists
240are started by .olist, which can be followed by "arabic", "loweralpha",
241"lowerroman", "upperalpha", or "upperroman" to indicate the type of numeration
242that is wanted. Each new item is started by .next, and the whole list is
243terminated by .endlist. Lists can be nested. For example:
244
245 .ilist
246 The first item in the itemized list.
247 .olist lowerroman
248 The first item in the nested, numbered list
249 .next
250 The next item in the nested, numbered list.
251 .endlist
252 Continuing with the first item in the itemized list.
253 .next
254 The next item in the itemized list.
255 .endlist
256
257Variable lists are used for Exim command line options and similar things. They
258map into XML <variablelist> items. Start the list with .vlist and end it with
259.endlist. Each item starts with a .vitem line, followed by its description. The
260argument to .vitem must be quoted if it contains spaces. For example:
261
262 .vlist
263 .vitem &*--*&
264 This is a pseudo-option whose only purpose is to terminate the options and
265 therefore to cause subsequent command line items to be treated as arguments
266 rather than options, even if they begin with hyphens.
267
268 .vitem &*--help*&
269 This option causes Exim to output a few sentences stating what it is.
270 The same output is generated if the Exim binary is called with no options and
271 no arguments.
272 ...
273 .endlist
274
275
276TABLES
277
278The .itable macro directive in xfpt can be used to specify an informal table.
279See the specification for details. The Exim specification uses this directly in
280one place, but most of its tables contain only two columns, for which a
281cut-down macro called .table2 has been defined. Its arguments are the widths of
282the columns, defaulting to 190pt and 300pt, which are suitable for the many
283tables that appear at the start of the global options definition chapter. Each
284row in a table is defined by a .row macro, and the table ends with .endtable.
285For example:
286
287 .table2 100pt
288 .row &_OptionLists.txt_& "list of all options in alphabetical order"
289 .row &_dbm.discuss.txt_& "discussion about DBM libraries"
290 ...
291 .endtable
292
293This example overrides the width of the first column. The first arguments of
294the .row macro do not need quotes, because they contain no white space, but
295quotes could have been used.
296
297
298EXIM CONFIGURATION OPTION HEADINGS
299
300Each Exim configuration option is formatted with its name, usage, type, and
301default value on a single output line, spread over the line so as to fill it
302completely. The only way I know of aligning text using DocBook is to use a
303table. The .option macro defines such a table and inserts its four arguments
304into the cells. For example:
305
306 .option acl_not_smtp_mime main string&!! unset
307 This option causes...
308
309The macro contains the font definitions and the heading words "Use", "Type",
310and "Default", so you do not have to supply them. Notice the use of the &!!
311flag to put a dagger after the word "string".
312
313
f89d2485 314CHANGE BARS (REVISION MARKINGS)
9b371988
PH
315
316I have not yet found a way of producing change bars in the PostScript and PDF
f89d2485
PH
317versions of the documents when they are generated using the "fop" command.
318However, the revision marks do work when these formats are produced using my
319own "sdop" processor. Also, it is possible to put a green background behind
320changed text in the HTML version, so the appropriate markup should be used in
321the source. There is a facility in xfpt for setting the "revisionflag"
9b371988
PH
322attribute on appropriate XML elements. There is also a macro called .new which
323packages this up for use in three different ways. One or more large text items
324can be placed between .new and .wen ("wen" is "new" backwards). For example:
325
326 This paragraph is not flagged as new.
327 .new
328 This is a new paragraph that contains a display:
329 .display
330 whatever
331 .endd
332 This is the next paragraph.
333 .wen
334 Here is the next, unmarked, paragraph.
335
336When called without an argument, .new terminates the current paragraph, and
337.wen always does so. Therefore, even though there are no blank lines before
338.new or .wen above, the marked text will be in a paragraph of its own. You
339can, of course, put in blank lines if you wish, and it is probably clearer to
340do so.
341
3cb1b51e
PH
342!!WARNING WARNING WARNING!!
343If there are index directives, put them after rather than before .new because
344otherwise you are likely to get an empty paragraph, which shows up as unwanted
345vertical whitespace.
346!!WARNING WARNING WARNING!!
db9452a9 347
9b371988
PH
348If want to mark just a few words inside a paragraph as new, you can call the
349.new macro with an argument. The macro can be called either as a directive or
350as an inline macro call, which takes the form of an ampersand followed by the
351name, with the argument in parentheses. For example:
352
353 This is a paragraph that has
354 .new "a few marked words"
355 within it. Here are &new(some more) marked words.
356
357The effect of this is to generate a <phrase> XML element with the revisionflag
358attribute set. The .wen macro is not used in this case.
359
f89d2485
PH
360You can also use .new/.wen inside .display and .code sections, and &new() will
361work inside lines in a .display section. It will not work in a .code section,
362because all text is literal.
363
9b371988
PH
364If you want to mark a whole table as new, .new and .wen can be used to surround
365it as described above. However, current DocBook processors do not seem to
366recognize the "revisionflag" attribute on individual rows and table entries.
367You can, nevertheless, mark the contents of individual table entries as changed
368by using an inline macro call. For example:
369
370 .row "&new(some text)" "...."
371
f89d2485
PH
372This works as required when the XML is processed by "sdop" rather than "fop" to
373generate PostScript and PDF. Each such entry must be separately marked. If
374there are more than one or two, it may be easier just to mark the entire table.
9b371988
PH
375
376Philip Hazel
f89d2485 377Last updated: 10 April 2007