|
1
|
- Bob Stayton
- Sagehill Enterprises
- DocBook Consulting
|
|
2
|
- Multiple outputs from single source file.
- Reusable content.
- Modular writing.
- Assembled documents.
- “Write once, publish many”.
|
|
3
|
- Print, PDF, HTML, slides, Help files.
- Different product versions.
- Different user levels.
- Sight-impaired, WML, text-only.
|
|
4
|
- Reduce redundant writing.
- Writers can specialize.
- Update in a single place.
- Users get more accurate information.
- Fewer words to translate.
|
|
5
|
- DTD for technical documentation.
- Related stylesheets and tools.
- Started in 1991 as SGML, now XML.
- OASIS standard since 1998.
|
|
6
|
- Designed for technical documentation.
- Content kept separate from format.
- Open to computer processing.
- Choose your publishing tools.
- Cross platform
- Automate your processing.
|
|
7
|
- XML learning curve.
- Investment in setup.
- Technical staff needed.
|
|
8
|
- Multiple output formats.
- Multiple releases over time.
- Large documentation sets.
- Batch processing environment.
- Shared authoring.
|
|
9
|
- Sun
- IBM
- Microsoft
- Hewlett Packard
- Symantec
- Red Hat, SuSE, Mandrakesoft
- Linux Documentation Project
|
|
10
|
- DocBook DTD (XML version).
- Writing tools.
- XSL stylesheets.
- Processing tools.
|
|
11
|
- Notepad or other text editor.
- XMLMind’s XMLEditor (free).
- Morphon’s XML-editor (free).
- Syntext’s Serna.
- Blast Radius’s XMetal.
- Arbortext’s Epic Editor.
|
|
12
|
- Open source project on SourceForge.
- Written in XSL.
- Stylesheet variant for each output form.
- Designed for customization.
- Adapt to corporate style.
|
|
13
|
|
|
14
|
- xsltproc from Gnome’s xmlsoft.org
- Saxon 6 from SourceForge
- Xalan Java from Apache XML project
|
|
15
|
- Single file or multiple “chunks”.
- Use CSS classes for styling.
- Post process with
- HTML Help Workshop
- Java Help indexer
|
|
16
|
|
|
17
|
- XEP from RenderX.
- XSL Formatter from Antenna House
- FOP from Apache XML Project
|
|
18
|
- Stylesheet flows content onto pages.
- Automatic TOC and index.
- Automatic page breaking.
- Writer does not do formatting.
|
|
19
|
|
|
20
|
- Front matter
- Graphics
- Tables
- Glossaries
- Bibliographies
- Indexes
|
|
21
|
- Nested section levels.
- Numbered figures, tables, examples.
- Tasks and procedures.
- Code synopses.
- Code examples.
- Running headers and footers.
|
|
22
|
- Profiling.
- Modular documentation.
- Cross referencing.
- Localization.
|
|
23
|
- aka Conditional text.
- Multiple versions from same file.
- Marked with profiling attributes:
- os, userlevel, condition, etc.
- Use a profiling stylesheet.
- Select conditions at runtime:
|
|
24
|
- Separate large documents into multiple XML files.
- System entity != valid document.
- No DOCTYPE allowed.
- xrefs won’t resolve.
- Use Xinclude instead.
- Modules can be valid documents.
- Use olink to link between them.
|
|
25
|
- Author or generate hotlink text.
- Define cross reference “styles”.
- Link within or between documents
- Between documents:
- Within a concurrent set.
- Reference to previously published doc.
- Reference to remote content.
|
|
26
|
- Create olink database from documents.
- XSL processor reads the database.
- Can generate link text.
- Can link to base URI per document.
- Creates dependencies between docs.
|
|
27
|
- Unicode and other encodings
- Generated text in 46 languages
- Index collation
- Mixed language documents
|
|
28
|
- xsltproc
- Download libxml2 and libxslt C source.
- Install prebuilt packages.
- Windows binaries available.
- Saxon and Xalan
- Need Java runtime environment.
- Download and add to CLASSPATH.
|
|
29
|
- HTML output:
- xsltproc \
--output myfile.html \
/usr/share/docbook/html/docbook.xsl
\
myfile.xml
- FO output:
- xsltproc \
--output myfile.fo \
/usr/share/docbook/fo/docbook.xsl
\
myfile.xml
|
|
30
|
- Convert a .fo file on Unix or Linux:
- fop.sh -fo myfile.fo -pdf myfile.pdf
- Convert a .fo file on Windows:
- fop.bat -fo myfile.fo -pdf myfile.pdf
|
|
31
|
- Default style is neutral.
- Functional but boring.
- Corporate identity requirements.
- Enhanced functionality:
- Better navigation.
- Readability.
|
|
32
|
- Modular design.
- Templates for each element.
- Small reusable templates.
- Empty, user-defined templates.
- Parameterized (~460 parameters)
|
|
33
|
|
|
34
|
|
|
35
|
- Setting parameters
- Customization layer
- Attribute sets
- CSS for HTML
- Generated text
- Generating titlepage templates
- Placeholder templates
- Customizing templates
|
|
36
|
- Methods are a tool kit.
- Easiest to hardest.
- Use stylesheet documentation.
- DocBook XSL: The Complete Guide
- Free online: http://www.sagehill.net/docbookxsl/
- Good XSLT and XSL-FO book(s)
- DocBook mailing lists
|
|
37
|
- What is it:
- Named variable in stylesheet.
- Default behavior used otherwise.
- When to use it:
- If the right parameter exists.
- Read the stylesheet doc:
- http://docbook.sourceforge.net/release/xsl/current/doc/html/
|
|
38
|
- In HTML output:
- Add icon graphics for Note, Warning, etc.
- Collectively known as “admonitions”.
- Parameter name is admon.graphics
|
|
39
|
- Each processor has its own command syntax:
- xsltproc --output myfile.html \
- --stringparam admon.graphics
1 \
- html/docbook.xsl myfile.xml
- Before
- After
|
|
40
|
- Command line good for one-off.
- Some parameters used consistently.
- Many parameters = long command line
- Print page size, margins, etc.
|
|
41
|
- New stylesheet that combines:
- Imports DocBook XSL templates
- Adds your customizations.
- Kept separate, so updates are easy.
- Used in place of DocBook stylesheet.
|
|
42
|
- Standard XSL syntax.
- Pull in stock DocBook with:
- <xsl:import href="path/to/docbook.xsl"/>
- Parameter settings.
- Replacement templates.
- New generated text.
|
|
43
|
- <?xml version='1.0'>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/
Transform"
version="1.0">
- <xsl:import href="html/docbook.xsl"/>
- <xsl:param name=“admon.graphics" select="1"/>
- ...
- </xsl:stylesheet>
|
|
44
|
- <?xml version='1.0'>
- <xsl:stylesheet version="1.0"
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:import href="fo/docbook.xsl"/>
- <xsl:param name="page.height">9in</xsl:param>
- <xsl:param name="page.width">7in</xsl:param>
- <xsl:param name="double.sided">1</xsl:param>
- <xsl:param name="page.margin.top">0.5in</...
- <xsl:param name="page.margin.bottom">0.6in</...
- <xsl:param name="page.margin.inner">0.75in</...
- <xsl:param name="page.margin.outer">0.5in</...
- <xsl:param name="body.font.family">Helvetica</...
- ...
- </xsl:stylesheet>
|
|
45
|
|
|
46
|
- Mailing lists
- docbook-apps for processing questions.
- docbook for DTD questions.
- DocBook SourceForge project
- Stylesheet CVS files
- Bug reports and feature requests.
- DocBook Wiki
|
|
47
|
- References:
- DocBook XSL: The Complete Guide
- http://www.sagehill.net/docbookxsl/
- DocBook: The Definitive Guide
- http://docbook.org/tdg/en/html/docbook.html
- DocBook SourceForge project:
|