To build an arbitrary document you use the same method as you
would any other document, make with a
specific target. The -arbitrary
after the
base name of the source files indidicates that we should build
using the arbitrary system. For example, to build the Windows
arbitrary document as a PDF you would use:
shell> make windows-arbitrary.pdf
Behind the scenes, the following happens:
The genarbelements.pl script is executed. This accepts the arbitrary specification file and wrapper file as arguments.
The arbitrary specification is parsed and validated.
For each each fragment, the script then:
Parses each include
statement, first
loading the file that contains the specified ID.
The DocBook XML block (be it section, chapter, or appendix) is extracted from the file.
If subsections are filtered, these sections are removed.
If the section is to be remapped, the correesponding tags are updated.
If the include
section has additional
subsections defined, these are appended to the end of
the section before the closing tag for that section.
Once a fragment specification is complete, the corresponding import specification in the wrapper XML is located and replaced with the fragment text.
The updated wrapper document is written out as a file with
name
.
filename
-arbitrary.xml
The generated file is then processed as normal by the rest of the documentation build process into the desired format.