Docbook

From ArchWiki

Jump to: navigation, search


Image:Tango-document-new.png This article is a stub.
It may be confusing, not contain enough information, or be a placeholder for an article to come. People are invited to expand it to full article status and remove this box.

We will assume that our docbook document is in File.xml

Contents

[edit] Setting up Docbook in Arch

To set up docbook running on arch:

$ pacman -S docbook-xml docbook-xsl libxslt libxml2

[edit] Validating XML file

To validate the XML file use:

$ xmllint --valid --noout File.xml

This will generate no output if the file is proper XML.

[edit] Converting into XHTML

[edit] Single file

To convert into a XHTML file (single file) use:

xsltproc /usr/share/xml/docbook/xhtml/docbook.xsl File.xml > Output.html

[edit] Segmented

To convert into a a segmented XHTML file (each section in its own file) use:

xsltproc /usr/share/xml/docbook/xhtml/chunk.xsl File.xml

[edit] Automating

You can add these to ~/.bashrc(or similar shell startup file):

alias doc2html1="xsltproc /usr/share/xml/docbook/xhtml/docbook.xsl"
alias doc2multihtml="xsltproc /usr/share/xml/docbook/xhtml/chunk.xsl"
alias docvalidate="xmllint --valid --noout"
Personal tools