git.iko.soy/typeable/pandoc
on master help sign in
Add docbook5 writer support
commit271cb4d8457b2252cddc76a476f3681e8b2a1486 authorIvo Clarysse <ivo@bcdevices.com> dateFri 29 Apr 2016, 14:00 (10 years ago) parent32f1b0a
6 files changed+1840−3
src/Text/Pandoc.hs+2 src/Text/Pandoc/Options.hs+2 src/Text/Pandoc/Writers/Docbook.hs+7−3 tests/Tests/Old.hs+3 tests/tables.docbook5+432 tests/writer.docbook5+1394
src/Text/Pandoc.hs+2
@@ -291,6 +291,8 @@ writers = [
291291 writeHtmlString o{ writerSlideVariant = RevealJsSlides
292292 , writerHtml5 = True })
293293 ,("docbook" , PureStringWriter writeDocbook)
294+ ,("docbook5" , PureStringWriter $ \o ->
295+ writeDocbook o{ writerDocBook5 = True })
294296 ,("opml" , PureStringWriter writeOPML)
295297 ,("opendocument" , PureStringWriter writeOpenDocument)
296298 ,("latex" , PureStringWriter writeLaTeX)
src/Text/Pandoc/Options.hs+2
@@ -357,6 +357,7 @@ data WriterOptions = WriterOptions
357357 , writerSourceURL :: Maybe String -- ^ Absolute URL + directory of 1st source file
358358 , writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
359359 , writerCiteMethod :: CiteMethod -- ^ How to print cites
360+ , writerDocBook5 :: Bool -- ^ Produce DocBook5
360361 , writerHtml5 :: Bool -- ^ Produce HTML5
361362 , writerHtmlQTags :: Bool -- ^ Use @<q>@ tags for quotes in HTML
362363 , writerBeamer :: Bool -- ^ Produce beamer LaTeX slide show
@@ -403,6 +404,7 @@ instance Default WriterOptions where
403404 , writerSourceURL = Nothing
404405 , writerUserDataDir = Nothing
405406 , writerCiteMethod = Citeproc
407+ , writerDocBook5 = False
406408 , writerHtml5 = False
407409 , writerHtmlQTags = False
408410 , writerBeamer = False
src/Text/Pandoc/Writers/Docbook.hs+7−3
@@ -112,7 +112,9 @@ elementToDocbook opts lvl (Sec _ _num (id',_,_) title elements) =
112112 else elements
113113 tag = case lvl of
114114 n | n == 0 -> "chapter"
115− | n >= 1 && n <= 5 -> "sect" ++ show n
115+ | n >= 1 && n <= 5 -> if writerDocBook5 opts
116+ then "section"
117+ else "sect" ++ show n
116118 | otherwise -> "simplesect"
117119 in inTags True tag [("id", writerIdentifierPrefix opts ++ id') |
118120 not (null id')] $
@@ -227,9 +229,11 @@ blockToDocbook opts (OrderedList (start, numstyle, _) (first:rest)) =
227229blockToDocbook opts (DefinitionList lst) =
228230 let attribs = [("spacing", "compact") | isTightList $ concatMap snd lst]
229231 in inTags True "variablelist" attribs $ deflistItemsToDocbook opts lst
230−blockToDocbook _ (RawBlock f str)
232+blockToDocbook opts (RawBlock f str)
231233 | f == "docbook" = text str -- raw XML block
232− | f == "html" = text str -- allow html for backwards compatibility
234+ | f == "html" = if writerDocBook5 opts
235+ then empty -- No html in Docbook5
236+ else text str -- allow html for backwards compatibility
233237 | otherwise = empty
234238blockToDocbook _ HorizontalRule = empty -- not semantic
235239blockToDocbook opts (Table caption aligns widths headers rows) =
tests/Tests/Old.hs+3
@@ -108,6 +108,9 @@ tests = [ testGroup "markdown"
108108 , test "reader" ["-r", "docbook", "-w", "native", "-s"]
109109 "docbook-xref.docbook" "docbook-xref.native"
110110 ]
111+ , testGroup "docbook5"
112+ [ testGroup "writer" $ writerTests "docbook5"
113+ ]
111114 , testGroup "native"
112115 [ testGroup "writer" $ writerTests "native"
113116 , test "reader" ["-r", "native", "-w", "native", "-s"]
tests/tables.docbook5new file+432
@@ -0,0 +1,432 @@
1+<para>
2+ Simple table with caption:
3+</para>
4+<table>
5+ <title>
6+ Demonstration of simple table syntax.
7+ </title>
8+ <tgroup cols="4">
9+ <colspec align="right" />
10+ <colspec align="left" />
11+ <colspec align="center" />
12+ <colspec align="left" />
13+ <thead>
14+ <row>
15+ <entry>
16+ Right
17+ </entry>
18+ <entry>
19+ Left
20+ </entry>
21+ <entry>
22+ Center
23+ </entry>
24+ <entry>
25+ Default
26+ </entry>
27+ </row>
28+ </thead>
29+ <tbody>
30+ <row>
31+ <entry>
32+ 12
33+ </entry>
34+ <entry>
35+ 12
36+ </entry>
37+ <entry>
38+ 12
39+ </entry>
40+ <entry>
41+ 12
42+ </entry>
43+ </row>
44+ <row>
45+ <entry>
46+ 123
47+ </entry>
48+ <entry>
49+ 123
50+ </entry>
51+ <entry>
52+ 123
53+ </entry>
54+ <entry>
55+ 123
56+ </entry>
57+ </row>
58+ <row>
59+ <entry>
60+ 1
61+ </entry>
62+ <entry>
63+ 1
64+ </entry>
65+ <entry>
66+ 1
67+ </entry>
68+ <entry>
69+ 1
70+ </entry>
71+ </row>
72+ </tbody>
73+ </tgroup>
74+</table>
75+<para>
76+ Simple table without caption:
77+</para>
78+<informaltable>
79+ <tgroup cols="4">
80+ <colspec align="right" />
81+ <colspec align="left" />
82+ <colspec align="center" />
83+ <colspec align="left" />
84+ <thead>
85+ <row>
86+ <entry>
87+ Right
88+ </entry>
89+ <entry>
90+ Left
91+ </entry>
92+ <entry>
93+ Center
94+ </entry>
95+ <entry>
96+ Default
97+ </entry>
98+ </row>
99+ </thead>
100+ <tbody>
101+ <row>
102+ <entry>
103+ 12
104+ </entry>
105+ <entry>
106+ 12
107+ </entry>
108+ <entry>
109+ 12
110+ </entry>
111+ <entry>
112+ 12
113+ </entry>
114+ </row>
115+ <row>
116+ <entry>
117+ 123
118+ </entry>
119+ <entry>
120+ 123
121+ </entry>
122+ <entry>
123+ 123
124+ </entry>
125+ <entry>
126+ 123
127+ </entry>
128+ </row>
129+ <row>
130+ <entry>
131+ 1
132+ </entry>
133+ <entry>
134+ 1
135+ </entry>
136+ <entry>
137+ 1
138+ </entry>
139+ <entry>
140+ 1
141+ </entry>
142+ </row>
143+ </tbody>
144+ </tgroup>
145+</informaltable>
146+<para>
147+ Simple table indented two spaces:
148+</para>
149+<table>
150+ <title>
151+ Demonstration of simple table syntax.
152+ </title>
153+ <tgroup cols="4">
154+ <colspec align="right" />
155+ <colspec align="left" />
156+ <colspec align="center" />
157+ <colspec align="left" />
158+ <thead>
159+ <row>
160+ <entry>
161+ Right
162+ </entry>
163+ <entry>
164+ Left
165+ </entry>
166+ <entry>
167+ Center
168+ </entry>
169+ <entry>
170+ Default
171+ </entry>
172+ </row>
173+ </thead>
174+ <tbody>
175+ <row>
176+ <entry>
177+ 12
178+ </entry>
179+ <entry>
180+ 12
181+ </entry>
182+ <entry>
183+ 12
184+ </entry>
185+ <entry>
186+ 12
187+ </entry>
188+ </row>
189+ <row>
190+ <entry>
191+ 123
192+ </entry>
193+ <entry>
194+ 123
195+ </entry>
196+ <entry>
197+ 123
198+ </entry>
199+ <entry>
200+ 123
201+ </entry>
202+ </row>
203+ <row>
204+ <entry>
205+ 1
206+ </entry>
207+ <entry>
208+ 1
209+ </entry>
210+ <entry>
211+ 1
212+ </entry>
213+ <entry>
214+ 1
215+ </entry>
216+ </row>
217+ </tbody>
218+ </tgroup>
219+</table>
220+<para>
221+ Multiline table with caption:
222+</para>
223+<table>
224+ <title>
225+ Here's the caption. It may span multiple lines.
226+ </title>
227+ <tgroup cols="4">
228+ <colspec colwidth="15*" align="center" />
229+ <colspec colwidth="13*" align="left" />
230+ <colspec colwidth="16*" align="right" />
231+ <colspec colwidth="33*" align="left" />
232+ <thead>
233+ <row>
234+ <entry>
235+ Centered Header
236+ </entry>
237+ <entry>
238+ Left Aligned
239+ </entry>
240+ <entry>
241+ Right Aligned
242+ </entry>
243+ <entry>
244+ Default aligned
245+ </entry>
246+ </row>
247+ </thead>
248+ <tbody>
249+ <row>
250+ <entry>
251+ First
252+ </entry>
253+ <entry>
254+ row
255+ </entry>
256+ <entry>
257+ 12.0
258+ </entry>
259+ <entry>
260+ Example of a row that spans multiple lines.
261+ </entry>
262+ </row>
263+ <row>
264+ <entry>
265+ Second
266+ </entry>
267+ <entry>
268+ row
269+ </entry>
270+ <entry>
271+ 5.0
272+ </entry>
273+ <entry>
274+ Here's another one. Note the blank line between rows.
275+ </entry>
276+ </row>
277+ </tbody>
278+ </tgroup>
279+</table>
280+<para>
281+ Multiline table without caption:
282+</para>
283+<informaltable>
284+ <tgroup cols="4">
285+ <colspec colwidth="15*" align="center" />
286+ <colspec colwidth="13*" align="left" />
287+ <colspec colwidth="16*" align="right" />
288+ <colspec colwidth="33*" align="left" />
289+ <thead>
290+ <row>
291+ <entry>
292+ Centered Header
293+ </entry>
294+ <entry>
295+ Left Aligned
296+ </entry>
297+ <entry>
298+ Right Aligned
299+ </entry>
300+ <entry>
301+ Default aligned
302+ </entry>
303+ </row>
304+ </thead>
305+ <tbody>
306+ <row>
307+ <entry>
308+ First
309+ </entry>
310+ <entry>
311+ row
312+ </entry>
313+ <entry>
314+ 12.0
315+ </entry>
316+ <entry>
317+ Example of a row that spans multiple lines.
318+ </entry>
319+ </row>
320+ <row>
321+ <entry>
322+ Second
323+ </entry>
324+ <entry>
325+ row
326+ </entry>
327+ <entry>
328+ 5.0
329+ </entry>
330+ <entry>
331+ Here's another one. Note the blank line between rows.
332+ </entry>
333+ </row>
334+ </tbody>
335+ </tgroup>
336+</informaltable>
337+<para>
338+ Table without column headers:
339+</para>
340+<informaltable>
341+ <tgroup cols="4">
342+ <colspec align="right" />
343+ <colspec align="left" />
344+ <colspec align="center" />
345+ <colspec align="right" />
346+ <tbody>
347+ <row>
348+ <entry>
349+ 12
350+ </entry>
351+ <entry>
352+ 12
353+ </entry>
354+ <entry>
355+ 12
356+ </entry>
357+ <entry>
358+ 12
359+ </entry>
360+ </row>
361+ <row>
362+ <entry>
363+ 123
364+ </entry>
365+ <entry>
366+ 123
367+ </entry>
368+ <entry>
369+ 123
370+ </entry>
371+ <entry>
372+ 123
373+ </entry>
374+ </row>
375+ <row>
376+ <entry>
377+ 1
378+ </entry>
379+ <entry>
380+ 1
381+ </entry>
382+ <entry>
383+ 1
384+ </entry>
385+ <entry>
386+ 1
387+ </entry>
388+ </row>
389+ </tbody>
390+ </tgroup>
391+</informaltable>
392+<para>
393+ Multiline table without column headers:
394+</para>
395+<informaltable>
396+ <tgroup cols="4">
397+ <colspec colwidth="15*" align="center" />
398+ <colspec colwidth="13*" align="left" />
399+ <colspec colwidth="16*" align="right" />
400+ <colspec colwidth="33*" align="left" />
401+ <tbody>
402+ <row>
403+ <entry>
404+ First
405+ </entry>
406+ <entry>
407+ row
408+ </entry>
409+ <entry>
410+ 12.0
411+ </entry>
412+ <entry>
413+ Example of a row that spans multiple lines.
414+ </entry>
415+ </row>
416+ <row>
417+ <entry>
418+ Second
419+ </entry>
420+ <entry>
421+ row
422+ </entry>
423+ <entry>
424+ 5.0
425+ </entry>
426+ <entry>
427+ Here's another one. Note the blank line between rows.
428+ </entry>
429+ </row>
430+ </tbody>
431+ </tgroup>
432+</informaltable>
tests/writer.docbook5new file+1394
@@ -0,0 +1,1394 @@
1+<?xml version="1.0" encoding="utf-8" ?>
2+<!DOCTYPE article>
3+<article xmlns="http://docbook.org/ns/docbook" version="5.0">
4+ <info>
5+ <title>Pandoc Test Suite</title>
6+ <authorgroup>
7+ <author>
8+ <firstname>John</firstname>
9+ <surname>MacFarlane</surname>
10+ </author>
11+ <author>
12+ <firstname></firstname>
13+ <surname>Anonymous</surname>
14+ </author>
15+ </authorgroup>
16+ <date>July 17, 2006</date>
17+ </info>
18+<para>
19+ This is a set of tests for pandoc. Most of them are adapted from John
20+ Gruber’s markdown test suite.
21+</para>
22+<section id="headers">
23+ <title>Headers</title>
24+ <section id="level-2-with-an-embedded-link">
25+ <title>Level 2 with an <ulink url="/url">embedded link</ulink></title>
26+ <section id="level-3-with-emphasis">
27+ <title>Level 3 with <emphasis>emphasis</emphasis></title>
28+ <section id="level-4">
29+ <title>Level 4</title>
30+ <section id="level-5">
31+ <title>Level 5</title>
32+ <para>
33+ </para>
34+ </section>
35+ </section>
36+ </section>
37+ </section>
38+</section>
39+<section id="level-1">
40+ <title>Level 1</title>
41+ <section id="level-2-with-emphasis">
42+ <title>Level 2 with <emphasis>emphasis</emphasis></title>
43+ <section id="level-3">
44+ <title>Level 3</title>
45+ <para>
46+ with no blank line
47+ </para>
48+ </section>
49+ </section>
50+ <section id="level-2">
51+ <title>Level 2</title>
52+ <para>
53+ with no blank line
54+ </para>
55+ </section>
56+</section>
57+<section id="paragraphs">
58+ <title>Paragraphs</title>
59+ <para>
60+ Here’s a regular paragraph.
61+ </para>
62+ <para>
63+ In Markdown 1.0.0 and earlier. Version 8. This line turns into a list
64+ item. Because a hard-wrapped line in the middle of a paragraph looked like
65+ a list item.
66+ </para>
67+ <para>
68+ Here’s one with a bullet. * criminey.
69+ </para>
70+<literallayout>There should be a hard line break
71+here.</literallayout>
72+</section>
73+<section id="block-quotes">
74+ <title>Block Quotes</title>
75+ <para>
76+ E-mail style:
77+ </para>
78+ <blockquote>
79+ <para>
80+ This is a block quote. It is pretty short.
81+ </para>
82+ </blockquote>
83+ <blockquote>
84+ <para>
85+ Code in a block quote:
86+ </para>
87+ <programlisting>
88+sub status {
89+ print &quot;working&quot;;
90+}
91+</programlisting>
92+ <para>
93+ A list:
94+ </para>
95+ <orderedlist numeration="arabic" spacing="compact">
96+ <listitem>
97+ <para>
98+ item one
99+ </para>
100+ </listitem>
101+ <listitem>
102+ <para>
103+ item two
104+ </para>
105+ </listitem>
106+ </orderedlist>
107+ <para>
108+ Nested block quotes:
109+ </para>
110+ <blockquote>
111+ <para>
112+ nested
113+ </para>
114+ </blockquote>
115+ <blockquote>
116+ <para>
117+ nested
118+ </para>
119+ </blockquote>
120+ </blockquote>
121+ <para>
122+ This should not be a block quote: 2 &gt; 1.
123+ </para>
124+ <para>
125+ And a following paragraph.
126+ </para>
127+</section>
128+<section id="code-blocks">
129+ <title>Code Blocks</title>
130+ <para>
131+ Code:
132+ </para>
133+ <programlisting>
134+---- (should be four hyphens)
135+
136+sub status {
137+ print &quot;working&quot;;
138+}
139+
140+this code block is indented by one tab
141+</programlisting>
142+ <para>
143+ And:
144+ </para>
145+ <programlisting>
146+ this code block is indented by two tabs
147+
148+These should not be escaped: \$ \\ \&gt; \[ \{
149+</programlisting>
150+</section>
151+<section id="lists">
152+ <title>Lists</title>
153+ <section id="unordered">
154+ <title>Unordered</title>
155+ <para>
156+ Asterisks tight:
157+ </para>
158+ <itemizedlist spacing="compact">
159+ <listitem>
160+ <para>
161+ asterisk 1
162+ </para>
163+ </listitem>
164+ <listitem>
165+ <para>
166+ asterisk 2
167+ </para>
168+ </listitem>
169+ <listitem>
170+ <para>
171+ asterisk 3
172+ </para>
173+ </listitem>
174+ </itemizedlist>
175+ <para>
176+ Asterisks loose:
177+ </para>
178+ <itemizedlist>
179+ <listitem>
180+ <para>
181+ asterisk 1
182+ </para>
183+ </listitem>
184+ <listitem>
185+ <para>
186+ asterisk 2
187+ </para>
188+ </listitem>
189+ <listitem>
190+ <para>
191+ asterisk 3
192+ </para>
193+ </listitem>
194+ </itemizedlist>
195+ <para>
196+ Pluses tight:
197+ </para>
198+ <itemizedlist spacing="compact">
199+ <listitem>
200+ <para>
201+ Plus 1
202+ </para>
203+ </listitem>
204+ <listitem>
205+ <para>
206+ Plus 2
207+ </para>
208+ </listitem>
209+ <listitem>
210+ <para>
211+ Plus 3
212+ </para>
213+ </listitem>
214+ </itemizedlist>
215+ <para>
216+ Pluses loose:
217+ </para>
218+ <itemizedlist>
219+ <listitem>
220+ <para>
221+ Plus 1
222+ </para>
223+ </listitem>
224+ <listitem>
225+ <para>
226+ Plus 2
227+ </para>
228+ </listitem>
229+ <listitem>
230+ <para>
231+ Plus 3
232+ </para>
233+ </listitem>
234+ </itemizedlist>
235+ <para>
236+ Minuses tight:
237+ </para>
238+ <itemizedlist spacing="compact">
239+ <listitem>
240+ <para>
241+ Minus 1
242+ </para>
243+ </listitem>
244+ <listitem>
245+ <para>
246+ Minus 2
247+ </para>
248+ </listitem>
249+ <listitem>
250+ <para>
251+ Minus 3
252+ </para>
253+ </listitem>
254+ </itemizedlist>
255+ <para>
256+ Minuses loose:
257+ </para>
258+ <itemizedlist>
259+ <listitem>
260+ <para>
261+ Minus 1
262+ </para>
263+ </listitem>
264+ <listitem>
265+ <para>
266+ Minus 2
267+ </para>
268+ </listitem>
269+ <listitem>
270+ <para>
271+ Minus 3
272+ </para>
273+ </listitem>
274+ </itemizedlist>
275+ </section>
276+ <section id="ordered">
277+ <title>Ordered</title>
278+ <para>
279+ Tight:
280+ </para>
281+ <orderedlist numeration="arabic" spacing="compact">
282+ <listitem>
283+ <para>
284+ First
285+ </para>
286+ </listitem>
287+ <listitem>
288+ <para>
289+ Second
290+ </para>
291+ </listitem>
292+ <listitem>
293+ <para>
294+ Third
295+ </para>
296+ </listitem>
297+ </orderedlist>
298+ <para>
299+ and:
300+ </para>
301+ <orderedlist numeration="arabic" spacing="compact">
302+ <listitem>
303+ <para>
304+ One
305+ </para>
306+ </listitem>
307+ <listitem>
308+ <para>
309+ Two
310+ </para>
311+ </listitem>
312+ <listitem>
313+ <para>
314+ Three
315+ </para>
316+ </listitem>
317+ </orderedlist>
318+ <para>
319+ Loose using tabs:
320+ </para>
321+ <orderedlist numeration="arabic">
322+ <listitem>
323+ <para>
324+ First
325+ </para>
326+ </listitem>
327+ <listitem>
328+ <para>
329+ Second
330+ </para>
331+ </listitem>
332+ <listitem>
333+ <para>
334+ Third
335+ </para>
336+ </listitem>
337+ </orderedlist>
338+ <para>
339+ and using spaces:
340+ </para>
341+ <orderedlist numeration="arabic">
342+ <listitem>
343+ <para>
344+ One
345+ </para>
346+ </listitem>
347+ <listitem>
348+ <para>
349+ Two
350+ </para>
351+ </listitem>
352+ <listitem>
353+ <para>
354+ Three
355+ </para>
356+ </listitem>
357+ </orderedlist>
358+ <para>
359+ Multiple paragraphs:
360+ </para>
361+ <orderedlist numeration="arabic">
362+ <listitem>
363+ <para>
364+ Item 1, graf one.
365+ </para>
366+ <para>
367+ Item 1. graf two. The quick brown fox jumped over the lazy dog’s
368+ back.
369+ </para>
370+ </listitem>
371+ <listitem>
372+ <para>
373+ Item 2.
374+ </para>
375+ </listitem>
376+ <listitem>
377+ <para>
378+ Item 3.
379+ </para>
380+ </listitem>
381+ </orderedlist>
382+ </section>
383+ <section id="nested">
384+ <title>Nested</title>
385+ <itemizedlist spacing="compact">
386+ <listitem>
387+ <para>
388+ Tab
389+ </para>
390+ <itemizedlist spacing="compact">
391+ <listitem>
392+ <para>
393+ Tab
394+ </para>
395+ <itemizedlist spacing="compact">
396+ <listitem>
397+ <para>
398+ Tab
399+ </para>
400+ </listitem>
401+ </itemizedlist>
402+ </listitem>
403+ </itemizedlist>
404+ </listitem>
405+ </itemizedlist>
406+ <para>
407+ Here’s another:
408+ </para>
409+ <orderedlist numeration="arabic" spacing="compact">
410+ <listitem>
411+ <para>
412+ First
413+ </para>
414+ </listitem>
415+ <listitem>
416+ <para>
417+ Second:
418+ </para>
419+ <itemizedlist spacing="compact">
420+ <listitem>
421+ <para>
422+ Fee
423+ </para>
424+ </listitem>
425+ <listitem>
426+ <para>
427+ Fie
428+ </para>
429+ </listitem>
430+ <listitem>
431+ <para>
432+ Foe
433+ </para>
434+ </listitem>
435+ </itemizedlist>
436+ </listitem>
437+ <listitem>
438+ <para>
439+ Third
440+ </para>
441+ </listitem>
442+ </orderedlist>
443+ <para>
444+ Same thing but with paragraphs:
445+ </para>
446+ <orderedlist numeration="arabic">
447+ <listitem>
448+ <para>
449+ First
450+ </para>
451+ </listitem>
452+ <listitem>
453+ <para>
454+ Second:
455+ </para>
456+ <itemizedlist spacing="compact">
457+ <listitem>
458+ <para>
459+ Fee
460+ </para>
461+ </listitem>
462+ <listitem>
463+ <para>
464+ Fie
465+ </para>
466+ </listitem>
467+ <listitem>
468+ <para>
469+ Foe
470+ </para>
471+ </listitem>
472+ </itemizedlist>
473+ </listitem>
474+ <listitem>
475+ <para>
476+ Third
477+ </para>
478+ </listitem>
479+ </orderedlist>
480+ </section>
481+ <section id="tabs-and-spaces">
482+ <title>Tabs and spaces</title>
483+ <itemizedlist>
484+ <listitem>
485+ <para>
486+ this is a list item indented with tabs
487+ </para>
488+ </listitem>
489+ <listitem>
490+ <para>
491+ this is a list item indented with spaces
492+ </para>
493+ <itemizedlist>
494+ <listitem>
495+ <para>
496+ this is an example list item indented with tabs
497+ </para>
498+ </listitem>
499+ <listitem>
500+ <para>
501+ this is an example list item indented with spaces
502+ </para>
503+ </listitem>
504+ </itemizedlist>
505+ </listitem>
506+ </itemizedlist>
507+ </section>
508+ <section id="fancy-list-markers">
509+ <title>Fancy list markers</title>
510+ <orderedlist numeration="arabic">
511+ <listitem override="2">
512+ <para>
513+ begins with 2
514+ </para>
515+ </listitem>
516+ <listitem>
517+ <para>
518+ and now 3
519+ </para>
520+ <para>
521+ with a continuation
522+ </para>
523+ <orderedlist numeration="lowerroman" spacing="compact">
524+ <listitem override="4">
525+ <para>
526+ sublist with roman numerals, starting with 4
527+ </para>
528+ </listitem>
529+ <listitem>
530+ <para>
531+ more items
532+ </para>
533+ <orderedlist numeration="upperalpha" spacing="compact">
534+ <listitem>
535+ <para>
536+ a subsublist
537+ </para>
538+ </listitem>
539+ <listitem>
540+ <para>
541+ a subsublist
542+ </para>
543+ </listitem>
544+ </orderedlist>
545+ </listitem>
546+ </orderedlist>
547+ </listitem>
548+ </orderedlist>
549+ <para>
550+ Nesting:
551+ </para>
552+ <orderedlist numeration="upperalpha" spacing="compact">
553+ <listitem>
554+ <para>
555+ Upper Alpha
556+ </para>
557+ <orderedlist numeration="upperroman" spacing="compact">
558+ <listitem>
559+ <para>
560+ Upper Roman.
561+ </para>
562+ <orderedlist numeration="arabic" spacing="compact">
563+ <listitem override="6">
564+ <para>
565+ Decimal start with 6
566+ </para>
567+ <orderedlist numeration="loweralpha" spacing="compact">
568+ <listitem override="3">
569+ <para>
570+ Lower alpha with paren
571+ </para>
572+ </listitem>
573+ </orderedlist>
574+ </listitem>
575+ </orderedlist>
576+ </listitem>
577+ </orderedlist>
578+ </listitem>
579+ </orderedlist>
580+ <para>
581+ Autonumbering:
582+ </para>
583+ <orderedlist spacing="compact">
584+ <listitem>
585+ <para>
586+ Autonumber.
587+ </para>
588+ </listitem>
589+ <listitem>
590+ <para>
591+ More.
592+ </para>
593+ <orderedlist spacing="compact">
594+ <listitem>
595+ <para>
596+ Nested.
597+ </para>
598+ </listitem>
599+ </orderedlist>
600+ </listitem>
601+ </orderedlist>
602+ <para>
603+ Should not be a list item:
604+ </para>
605+ <para>
606+ M.A. 2007
607+ </para>
608+ <para>
609+ B. Williams
610+ </para>
611+ </section>
612+</section>
613+<section id="definition-lists">
614+ <title>Definition Lists</title>
615+ <para>
616+ Tight using spaces:
617+ </para>
618+ <variablelist spacing="compact">
619+ <varlistentry>
620+ <term>
621+ apple
622+ </term>
623+ <listitem>
624+ <para>
625+ red fruit
626+ </para>
627+ </listitem>
628+ </varlistentry>
629+ <varlistentry>
630+ <term>
631+ orange
632+ </term>
633+ <listitem>
634+ <para>
635+ orange fruit
636+ </para>
637+ </listitem>
638+ </varlistentry>
639+ <varlistentry>
640+ <term>
641+ banana
642+ </term>
643+ <listitem>
644+ <para>
645+ yellow fruit
646+ </para>
647+ </listitem>
648+ </varlistentry>
649+ </variablelist>
650+ <para>
651+ Tight using tabs:
652+ </para>
653+ <variablelist spacing="compact">
654+ <varlistentry>
655+ <term>
656+ apple
657+ </term>
658+ <listitem>
659+ <para>
660+ red fruit
661+ </para>
662+ </listitem>
663+ </varlistentry>
664+ <varlistentry>
665+ <term>
666+ orange
667+ </term>
668+ <listitem>
669+ <para>
670+ orange fruit
671+ </para>
672+ </listitem>
673+ </varlistentry>
674+ <varlistentry>
675+ <term>
676+ banana
677+ </term>
678+ <listitem>
679+ <para>
680+ yellow fruit
681+ </para>
682+ </listitem>
683+ </varlistentry>
684+ </variablelist>
685+ <para>
686+ Loose:
687+ </para>
688+ <variablelist>
689+ <varlistentry>
690+ <term>
691+ apple
692+ </term>
693+ <listitem>
694+ <para>
695+ red fruit
696+ </para>
697+ </listitem>
698+ </varlistentry>
699+ <varlistentry>
700+ <term>
701+ orange
702+ </term>
703+ <listitem>
704+ <para>
705+ orange fruit
706+ </para>
707+ </listitem>
708+ </varlistentry>
709+ <varlistentry>
710+ <term>
711+ banana
712+ </term>
713+ <listitem>
714+ <para>
715+ yellow fruit
716+ </para>
717+ </listitem>
718+ </varlistentry>
719+ </variablelist>
720+ <para>
721+ Multiple blocks with italics:
722+ </para>
723+ <variablelist>
724+ <varlistentry>
725+ <term>
726+ <emphasis>apple</emphasis>
727+ </term>
728+ <listitem>
729+ <para>
730+ red fruit
731+ </para>
732+ <para>
733+ contains seeds, crisp, pleasant to taste
734+ </para>
735+ </listitem>
736+ </varlistentry>
737+ <varlistentry>
738+ <term>
739+ <emphasis>orange</emphasis>
740+ </term>
741+ <listitem>
742+ <para>
743+ orange fruit
744+ </para>
745+ <programlisting>
746+{ orange code block }
747+</programlisting>
748+ <blockquote>
749+ <para>
750+ orange block quote
751+ </para>
752+ </blockquote>
753+ </listitem>
754+ </varlistentry>
755+ </variablelist>
756+ <para>
757+ Multiple definitions, tight:
758+ </para>
759+ <variablelist spacing="compact">
760+ <varlistentry>
761+ <term>
762+ apple
763+ </term>
764+ <listitem>
765+ <para>
766+ red fruit
767+ </para>
768+ <para>
769+ computer
770+ </para>
771+ </listitem>
772+ </varlistentry>
773+ <varlistentry>
774+ <term>
775+ orange
776+ </term>
777+ <listitem>
778+ <para>
779+ orange fruit
780+ </para>
781+ <para>
782+ bank
783+ </para>
784+ </listitem>
785+ </varlistentry>
786+ </variablelist>
787+ <para>
788+ Multiple definitions, loose:
789+ </para>
790+ <variablelist>
791+ <varlistentry>
792+ <term>
793+ apple
794+ </term>
795+ <listitem>
796+ <para>
797+ red fruit
798+ </para>
799+ <para>
800+ computer
801+ </para>
802+ </listitem>
803+ </varlistentry>
804+ <varlistentry>
805+ <term>
806+ orange
807+ </term>
808+ <listitem>
809+ <para>
810+ orange fruit
811+ </para>
812+ <para>
813+ bank
814+ </para>
815+ </listitem>
816+ </varlistentry>
817+ </variablelist>
818+ <para>
819+ Blank line after term, indented marker, alternate markers:
820+ </para>
821+ <variablelist>
822+ <varlistentry>
823+ <term>
824+ apple
825+ </term>
826+ <listitem>
827+ <para>
828+ red fruit
829+ </para>
830+ <para>
831+ computer
832+ </para>
833+ </listitem>
834+ </varlistentry>
835+ <varlistentry>
836+ <term>
837+ orange
838+ </term>
839+ <listitem>
840+ <para>
841+ orange fruit
842+ </para>
843+ <orderedlist numeration="arabic" spacing="compact">
844+ <listitem>
845+ <para>
846+ sublist
847+ </para>
848+ </listitem>
849+ <listitem>
850+ <para>
851+ sublist
852+ </para>
853+ </listitem>
854+ </orderedlist>
855+ </listitem>
856+ </varlistentry>
857+ </variablelist>
858+</section>
859+<section id="html-blocks">
860+ <title>HTML Blocks</title>
861+ <para>
862+ Simple block on one line:
863+ </para>
864+ <para>
865+ foo
866+ </para>
867+ <para>
868+ And nested without indentation:
869+ </para>
870+ <para>
871+ foo
872+ </para>
873+ <para>
874+ bar
875+ </para>
876+ <para>
877+ Interpreted markdown in a table:
878+ </para>
879+ This is <emphasis>emphasized</emphasis>
880+ And this is <emphasis role="strong">strong</emphasis>
881+ <para>
882+ Here’s a simple block:
883+ </para>
884+ <para>
885+ foo
886+ </para>
887+ <para>
888+ This should be a code block, though:
889+ </para>
890+ <programlisting>
891+&lt;div&gt;
892+ foo
893+&lt;/div&gt;
894+</programlisting>
895+ <para>
896+ As should this:
897+ </para>
898+ <programlisting>
899+&lt;div&gt;foo&lt;/div&gt;
900+</programlisting>
901+ <para>
902+ Now, nested:
903+ </para>
904+ <para>
905+ foo
906+ </para>
907+ <para>
908+ This should just be an HTML comment:
909+ </para>
910+ <para>
911+ Multiline:
912+ </para>
913+ <para>
914+ Code block:
915+ </para>
916+ <programlisting>
917+&lt;!-- Comment --&gt;
918+</programlisting>
919+ <para>
920+ Just plain comment, with trailing spaces on the line:
921+ </para>
922+ <para>
923+ Code:
924+ </para>
925+ <programlisting>
926+&lt;hr /&gt;
927+</programlisting>
928+ <para>
929+ Hr’s:
930+ </para>
931+</section>
932+<section id="inline-markup">
933+ <title>Inline Markup</title>
934+ <para>
935+ This is <emphasis>emphasized</emphasis>, and so <emphasis>is
936+ this</emphasis>.
937+ </para>
938+ <para>
939+ This is <emphasis role="strong">strong</emphasis>, and so
940+ <emphasis role="strong">is this</emphasis>.
941+ </para>
942+ <para>
943+ An <emphasis><ulink url="/url">emphasized link</ulink></emphasis>.
944+ </para>
945+ <para>
946+ <emphasis role="strong"><emphasis>This is strong and
947+ em.</emphasis></emphasis>
948+ </para>
949+ <para>
950+ So is <emphasis role="strong"><emphasis>this</emphasis></emphasis> word.
951+ </para>
952+ <para>
953+ <emphasis role="strong"><emphasis>This is strong and
954+ em.</emphasis></emphasis>
955+ </para>
956+ <para>
957+ So is <emphasis role="strong"><emphasis>this</emphasis></emphasis> word.
958+ </para>
959+ <para>
960+ This is code: <literal>&gt;</literal>, <literal>$</literal>,
961+ <literal>\</literal>, <literal>\$</literal>,
962+ <literal>&lt;html&gt;</literal>.
963+ </para>
964+ <para>
965+ <emphasis role="strikethrough">This is
966+ <emphasis>strikeout</emphasis>.</emphasis>
967+ </para>
968+ <para>
969+ Superscripts: a<superscript>bc</superscript>d
970+ a<superscript><emphasis>hello</emphasis></superscript>
971+ a<superscript>hello there</superscript>.
972+ </para>
973+ <para>
974+ Subscripts: H<subscript>2</subscript>O, H<subscript>23</subscript>O,
975+ H<subscript>many of them</subscript>O.
976+ </para>
977+ <para>
978+ These should not be superscripts or subscripts, because of the unescaped
979+ spaces: a^b c^d, a~b c~d.
980+ </para>
981+</section>
982+<section id="smart-quotes-ellipses-dashes">
983+ <title>Smart quotes, ellipses, dashes</title>
984+ <para>
985+ <quote>Hello,</quote> said the spider. <quote><quote>Shelob</quote> is my
986+ name.</quote>
987+ </para>
988+ <para>
989+ <quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are letters.
990+ </para>
991+ <para>
992+ <quote>Oak,</quote> <quote>elm,</quote> and <quote>beech</quote> are names
993+ of trees. So is <quote>pine.</quote>
994+ </para>
995+ <para>
996+ <quote>He said, <quote>I want to go.</quote></quote> Were you alive in the
997+ 70’s?
998+ </para>
999+ <para>
1000+ Here is some quoted <quote><literal>code</literal></quote> and a
1001+ <quote><ulink url="http://example.com/?foo=1&amp;bar=2">quoted
1002+ link</ulink></quote>.
1003+ </para>
1004+ <para>
1005+ Some dashes: one—two — three—four — five.
1006+ </para>
1007+ <para>
1008+ Dashes between numbers: 5–7, 255–66, 1987–1999.
1009+ </para>
1010+ <para>
1011+ Ellipses…and…and….
1012+ </para>
1013+</section>
1014+<section id="latex">
1015+ <title>LaTeX</title>
1016+ <itemizedlist spacing="compact">
1017+ <listitem>
1018+ <para>
1019+ </para>
1020+ </listitem>
1021+ <listitem>
1022+ <para>
1023+ 2 + 2 = 4
1024+ </para>
1025+ </listitem>
1026+ <listitem>
1027+ <para>
1028+ <emphasis>x</emphasis> ∈ <emphasis>y</emphasis>
1029+ </para>
1030+ </listitem>
1031+ <listitem>
1032+ <para>
1033+ <emphasis>α</emphasis> ∧ <emphasis>ω</emphasis>
1034+ </para>
1035+ </listitem>
1036+ <listitem>
1037+ <para>
1038+ 223
1039+ </para>
1040+ </listitem>
1041+ <listitem>
1042+ <para>
1043+ <emphasis>p</emphasis>-Tree
1044+ </para>
1045+ </listitem>
1046+ <listitem>
1047+ <para>
1048+ Here’s some display math:
1049+ $$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
1050+ </para>
1051+ </listitem>
1052+ <listitem>
1053+ <para>
1054+ Here’s one that has a line break in it:
1055+ <emphasis>α</emphasis> + <emphasis>ω</emphasis> × <emphasis>x</emphasis><superscript>2</superscript>.
1056+ </para>
1057+ </listitem>
1058+ </itemizedlist>
1059+ <para>
1060+ These shouldn’t be math:
1061+ </para>
1062+ <itemizedlist spacing="compact">
1063+ <listitem>
1064+ <para>
1065+ To get the famous equation, write <literal>$e = mc^2$</literal>.
1066+ </para>
1067+ </listitem>
1068+ <listitem>
1069+ <para>
1070+ $22,000 is a <emphasis>lot</emphasis> of money. So is $34,000. (It
1071+ worked if <quote>lot</quote> is emphasized.)
1072+ </para>
1073+ </listitem>
1074+ <listitem>
1075+ <para>
1076+ Shoes ($20) and socks ($5).
1077+ </para>
1078+ </listitem>
1079+ <listitem>
1080+ <para>
1081+ Escaped <literal>$</literal>: $73 <emphasis>this should be
1082+ emphasized</emphasis> 23$.
1083+ </para>
1084+ </listitem>
1085+ </itemizedlist>
1086+ <para>
1087+ Here’s a LaTeX table:
1088+ </para>
1089+</section>
1090+<section id="special-characters">
1091+ <title>Special Characters</title>
1092+ <para>
1093+ Here is some unicode:
1094+ </para>
1095+ <itemizedlist spacing="compact">
1096+ <listitem>
1097+ <para>
1098+ I hat: Î
1099+ </para>
1100+ </listitem>
1101+ <listitem>
1102+ <para>
1103+ o umlaut: ö
1104+ </para>
1105+ </listitem>
1106+ <listitem>
1107+ <para>
1108+ section: §
1109+ </para>
1110+ </listitem>
1111+ <listitem>
1112+ <para>
1113+ set membership: ∈
1114+ </para>
1115+ </listitem>
1116+ <listitem>
1117+ <para>
1118+ copyright: ©
1119+ </para>
1120+ </listitem>
1121+ </itemizedlist>
1122+ <para>
1123+ AT&amp;T has an ampersand in their name.
1124+ </para>
1125+ <para>
1126+ AT&amp;T is another way to write it.
1127+ </para>
1128+ <para>
1129+ This &amp; that.
1130+ </para>
1131+ <para>
1132+ 4 &lt; 5.
1133+ </para>
1134+ <para>
1135+ 6 &gt; 5.
1136+ </para>
1137+ <para>
1138+ Backslash: \
1139+ </para>
1140+ <para>
1141+ Backtick: `
1142+ </para>
1143+ <para>
1144+ Asterisk: *
1145+ </para>
1146+ <para>
1147+ Underscore: _
1148+ </para>
1149+ <para>
1150+ Left brace: {
1151+ </para>
1152+ <para>
1153+ Right brace: }
1154+ </para>
1155+ <para>
1156+ Left bracket: [
1157+ </para>
1158+ <para>
1159+ Right bracket: ]
1160+ </para>
1161+ <para>
1162+ Left paren: (
1163+ </para>
1164+ <para>
1165+ Right paren: )
1166+ </para>
1167+ <para>
1168+ Greater-than: &gt;
1169+ </para>
1170+ <para>
1171+ Hash: #
1172+ </para>
1173+ <para>
1174+ Period: .
1175+ </para>
1176+ <para>
1177+ Bang: !
1178+ </para>
1179+ <para>
1180+ Plus: +
1181+ </para>
1182+ <para>
1183+ Minus: -
1184+ </para>
1185+</section>
1186+<section id="links">
1187+ <title>Links</title>
1188+ <section id="explicit">
1189+ <title>Explicit</title>
1190+ <para>
1191+ Just a <ulink url="/url/">URL</ulink>.
1192+ </para>
1193+ <para>
1194+ <ulink url="/url/">URL and title</ulink>.
1195+ </para>
1196+ <para>
1197+ <ulink url="/url/">URL and title</ulink>.
1198+ </para>
1199+ <para>
1200+ <ulink url="/url/">URL and title</ulink>.
1201+ </para>
1202+ <para>
1203+ <ulink url="/url/">URL and title</ulink>
1204+ </para>
1205+ <para>
1206+ <ulink url="/url/">URL and title</ulink>
1207+ </para>
1208+ <para>
1209+ <ulink url="/url/with_underscore">with_underscore</ulink>
1210+ </para>
1211+ <para>
1212+ Email link (<email>nobody@nowhere.net</email>)
1213+ </para>
1214+ <para>
1215+ <ulink url="">Empty</ulink>.
1216+ </para>
1217+ </section>
1218+ <section id="reference">
1219+ <title>Reference</title>
1220+ <para>
1221+ Foo <ulink url="/url/">bar</ulink>.
1222+ </para>
1223+ <para>
1224+ Foo <ulink url="/url/">bar</ulink>.
1225+ </para>
1226+ <para>
1227+ Foo <ulink url="/url/">bar</ulink>.
1228+ </para>
1229+ <para>
1230+ With <ulink url="/url/">embedded [brackets]</ulink>.
1231+ </para>
1232+ <para>
1233+ <ulink url="/url/">b</ulink> by itself should be a link.
1234+ </para>
1235+ <para>
1236+ Indented <ulink url="/url">once</ulink>.
1237+ </para>
1238+ <para>
1239+ Indented <ulink url="/url">twice</ulink>.
1240+ </para>
1241+ <para>
1242+ Indented <ulink url="/url">thrice</ulink>.
1243+ </para>
1244+ <para>
1245+ This should [not][] be a link.
1246+ </para>
1247+ <programlisting>
1248+[not]: /url
1249+</programlisting>
1250+ <para>
1251+ Foo <ulink url="/url/">bar</ulink>.
1252+ </para>
1253+ <para>
1254+ Foo <ulink url="/url/">biz</ulink>.
1255+ </para>
1256+ </section>
1257+ <section id="with-ampersands">
1258+ <title>With ampersands</title>
1259+ <para>
1260+ Here’s a <ulink url="http://example.com/?foo=1&amp;bar=2">link with an
1261+ ampersand in the URL</ulink>.
1262+ </para>
1263+ <para>
1264+ Here’s a link with an amersand in the link text:
1265+ <ulink url="http://att.com/">AT&amp;T</ulink>.
1266+ </para>
1267+ <para>
1268+ Here’s an <ulink url="/script?foo=1&amp;bar=2">inline link</ulink>.
1269+ </para>
1270+ <para>
1271+ Here’s an <ulink url="/script?foo=1&amp;bar=2">inline link in pointy
1272+ braces</ulink>.
1273+ </para>
1274+ </section>
1275+ <section id="autolinks">
1276+ <title>Autolinks</title>
1277+ <para>
1278+ With an ampersand:
1279+ <ulink url="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</ulink>
1280+ </para>
1281+ <itemizedlist spacing="compact">
1282+ <listitem>
1283+ <para>
1284+ In a list?
1285+ </para>
1286+ </listitem>
1287+ <listitem>
1288+ <para>
1289+ <ulink url="http://example.com/">http://example.com/</ulink>
1290+ </para>
1291+ </listitem>
1292+ <listitem>
1293+ <para>
1294+ It should.
1295+ </para>
1296+ </listitem>
1297+ </itemizedlist>
1298+ <para>
1299+ An e-mail address: <email>nobody@nowhere.net</email>
1300+ </para>
1301+ <blockquote>
1302+ <para>
1303+ Blockquoted:
1304+ <ulink url="http://example.com/">http://example.com/</ulink>
1305+ </para>
1306+ </blockquote>
1307+ <para>
1308+ Auto-links should not occur here:
1309+ <literal>&lt;http://example.com/&gt;</literal>
1310+ </para>
1311+ <programlisting>
1312+or here: &lt;http://example.com/&gt;
1313+</programlisting>
1314+ </section>
1315+</section>
1316+<section id="images">
1317+ <title>Images</title>
1318+ <para>
1319+ From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):
1320+ </para>
1321+ <figure>
1322+ <title>lalune</title>
1323+ <mediaobject>
1324+ <imageobject>
1325+ <imagedata fileref="lalune.jpg" />
1326+ </imageobject>
1327+ <textobject><phrase>lalune</phrase></textobject>
1328+ </mediaobject>
1329+ </figure>
1330+ <para>
1331+ Here is a movie <inlinemediaobject>
1332+ <imageobject>
1333+ <imagedata fileref="movie.jpg" />
1334+ </imageobject>
1335+ </inlinemediaobject> icon.
1336+ </para>
1337+</section>
1338+<section id="footnotes">
1339+ <title>Footnotes</title>
1340+ <para>
1341+ Here is a footnote reference,<footnote>
1342+ <para>
1343+ Here is the footnote. It can go anywhere after the footnote reference.
1344+ It need not be placed at the end of the document.
1345+ </para>
1346+ </footnote> and another.<footnote>
1347+ <para>
1348+ Here’s the long note. This one contains multiple blocks.
1349+ </para>
1350+ <para>
1351+ Subsequent blocks are indented to show that they belong to the
1352+ footnote (as with list items).
1353+ </para>
1354+ <programlisting>
1355+ { &lt;code&gt; }
1356+</programlisting>
1357+ <para>
1358+ If you want, you can indent every line, but you can also be lazy and
1359+ just indent the first line of each block.
1360+ </para>
1361+ </footnote> This should <emphasis>not</emphasis> be a footnote reference,
1362+ because it contains a space.[^my note] Here is an inline note.<footnote>
1363+ <para>
1364+ This is <emphasis>easier</emphasis> to type. Inline notes may contain
1365+ <ulink url="http://google.com">links</ulink> and <literal>]</literal>
1366+ verbatim characters, as well as [bracketed text].
1367+ </para>
1368+ </footnote>
1369+ </para>
1370+ <blockquote>
1371+ <para>
1372+ Notes can go in quotes.<footnote>
1373+ <para>
1374+ In quote.
1375+ </para>
1376+ </footnote>
1377+ </para>
1378+ </blockquote>
1379+ <orderedlist numeration="arabic" spacing="compact">
1380+ <listitem>
1381+ <para>
1382+ And in list items.<footnote>
1383+ <para>
1384+ In list.
1385+ </para>
1386+ </footnote>
1387+ </para>
1388+ </listitem>
1389+ </orderedlist>
1390+ <para>
1391+ This paragraph should not be part of the note, as it is not indented.
1392+ </para>
1393+</section>
1394+</article>