]> pere.pagekite.me Git - homepage.git/blob - blog/data/2023-11-05-docbook-tester.txt
Generated.
[homepage.git] / blog / data / 2023-11-05-docbook-tester.txt
1 Title: Test framework for DocBook processors / formatters
2 Tags: english, debian, docbook
3 Date: 2023-11-05 13:00
4
5 <p>All the books I have published so far has been using
6 <a href="https://docbook.org/">DocBook</a> somewhere in the process.
7 For the first book, the source format was DocBook, while for every
8 later book it was an intermediate format used as the stepping stone to
9 be able to present the same manuscript in several formats, on paper,
10 as ebook in ePub format, as a HTML page and as a PDF file either for
11 paper production or for Internet consumption. This is made possible
12 with a wide variety of free software tools with DocBook support in
13 Debian. The source format of later books have been docx via rst,
14 Markdown, Filemaker and Asciidoc, and for all of these I was able to
15 generate a suitable DocBook file for further processing using
16 <a href="https://tracker.debian.org/pkg/pandoc">pandoc</a>,
17 <a href="https://tracker.debian.org/pkg/asciidoc">a2x</a> and
18 <a href="https://tracker.debian.org/pkg/asciidoctor">asciidoctor</a>,
19 as well as rendering using
20 <a href="https://tracker.debian.org/pkg/xmlto">xmlto</a>,
21 <a href="https://tracker.debian.org/pkg/dbtoepub">dbtoepub</a>,
22 <a href="https://tracker.debian.org/pkg/dblatex">dblatex</a>,
23 <a href="https://tracker.debian.org/pkg/docbook-xsl">docbook-xsl</a> and
24 <a href="https://tracker.debian.org/pkg/fop">fop</a>.</p>
25
26 <p>Most of the <a href="http://www.hungry.com/~pere/publisher/">books I
27 have published</a> are translated books, with English as the source
28 language. The use of
29 <a href="https://tracker.debian.org/pkg/po4a">po4a</a> to
30 handle translations using the gettext PO format has been a blessing,
31 but publishing translated books had triggered the need to ensure the
32 DocBook tools handle relevant languages correctly. For every new
33 language I have published, I had to submit patches dblatex, dbtoepub
34 and docbook-xsl fixing incorrect language and country specific issues
35 in the framework themselves. Typically this has been missing keywords
36 like 'figure' or sort ordering of index entries. After a while it
37 became tiresome to only discover issues like this by accident, and I
38 decided to write a DocBook "test framework" exercising various
39 features of DocBook and allowing me to see all features exercised for
40 a given language. It consist of a set of DocBook files, a version 4
41 book, a version 5 book, a v4 book set, a v4 selection of problematic
42 tables, one v4 testing sidefloat and finally one v4 testing a book of
43 articles. The DocBook files are accompanied with a set of build rules
44 for building PDF using dblatex and docbook-xsl/fop, HTML using xmlto
45 or docbook-xsl and epub using dbtoepub. The result is a set of files
46 visualizing footnotes, indexes, table of content list, figures,
47 formulas and other DocBook features, allowing for a quick review on
48 the completeness of the given locale settings. To build with a
49 different language setting, all one need to do is edit the lang= value
50 in the .xml file to pick a different ISO 639 code value and run
51 'make'.</p>
52
53 <p>The <a href="https://codeberg.org/pere/docbook-example/">test framework
54 source code</a> is available from Codeberg, and a generated set of
55 presentations of the various examples is available as Codeberg static
56 web pages at
57 <a href="https://pere.codeberg.page/docbook-example/">https://pere.codeberg.page/docbook-example/</a>.
58 Using this test framework I have been able to discover and report
59 several bugs and missing features in various tools, and got a lot of
60 them fixed. For example I got Northern Sami keywords added to both
61 docbook-xsl and dblatex, fixed several typos in Norwegian bokmål and
62 Norwegian Nynorsk, support for non-ascii title IDs added to pandoc,
63 Norwegian index sorting support fixed in xindy and initial Norwegian
64 Bokmål support added to dblatex. Some issues still remains, though.
65 Default index sorting rules are still broken in several tools, so the
66 Norwegian letters æ, ø and å are more often than not sorted properly
67 in the book index.</p>
68
69 <p>The test framework recently received some more polish, as part of
70 publishing my latest book. This book contained a lot of fairly
71 complex tables, which exposed bugs in some of the tools. This made me
72 add a new test file with various tables, as well as spend some time to
73 brush up the build rules. My goal is for the test framework to
74 exercise all DocBook features to make it easier to see which features
75 work with different processors, and hopefully get them all to support
76 the full set of DocBook features. Feel free to send patches to extend
77 the test set, and test it with your favorite DocBook processor.
78 Please visit these two URLs to learn more:</p>
79
80 <ul>
81 <li><a href="https://codeberg.org/pere/docbook-example/">https://codeberg.org/pere/docbook-example/</a></li>
82 <li><a href="https://pere.codeberg.page/docbook-example/">https://pere.codeberg.page/docbook-example/</a></li>
83 </ul>
84
85 <p>If you want to learn more on Docbook and translations, I recommend
86 having a look at the <a href="https://docbook.org/">the DocBook
87 web site</a>,
88 <a href="https://doccookbook.sourceforge.net/html/en/">the DoCookBook
89 site<a/> and my earlier blog post on
90 <a href="http://www.hungry.com/~pere/blog/From_English_wiki_to_translated_PDF_and_epub_via_Docbook.html">how
91 the Skolelinux project process and translate documentation</a>, a talk I gave earlier this year on
92 <a href="https://www.nuug.no/aktiviteter/20230314-oversetting-og-publisering-av-b%c3%b8ker-med-fri-programvare/">how
93 to translate and publish books using free software</a> (Norwegian
94 only).</p>
95
96 <!--
97
98 https://github.com/docbook/xslt10-stylesheets/issues/205 (docbook-xsl: sme support)
99 https://bugs.debian.org/968437 (xindy: index sorting rules for nb/nn)
100 https://bugs.debian.org/856123 (pandoc: markdown to docbook with non-english titles)
101 https://bugs.debian.org/864813 (dblatex: missing nb words)
102 https://bugs.debian.org/756386 (dblatex: index sorting rules for nb/nn)
103 https://bugs.debian.org/796871 (dbtoepub: index sorting rules for nb/nn)
104 https://bugs.debian.org/792616 (dblatex: PDF metadata)
105 https://bugs.debian.org/686908 (docbook-xsl: index sorting rules for nb/nn)
106 https://sourceforge.net/tracker/?func=detail&atid=373747&aid=3556630&group_id=21935 (docbook-xsl: nb/nn support)
107 https://bugs.debian.org/684391 (dblatex: initial nb support)
108
109 -->
110
111 <p>As usual, if you use Bitcoin and want to show your support of my
112 activities, please send Bitcoin donations to my address
113 <b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>