Docbook

From ArchWiki
Revision as of 08:28, 4 August 2010 by Vamp898 (Talk | contribs) (Converting into XHTML)

Jump to: navigation, search

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Docbook#)

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

Setting up Docbook in Arch

To set up docbook running on arch:

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

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.

Converting into XHTML

Single file

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

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

Segmented

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

xsltproc /usr/share/xml/docbook/xsl-stylesheets-1.75.2/xhtml/chunk.xsl File.xml

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"