= Setting Up Docbook = <> = Introduction = This solutions are based on free tools and on some information from internet. = Installation, Setup = Install script: [[http://wiki.softxs.ch/intern/SetupDocBook?action=AttachFile&do=get&target=SetupDocBookinstall.sh|install.sh]] Editor: [[http://wiki.softxs.ch/intern/SetupDocBook?action=AttachFile&do=get&target=SetupDocBookxxe|xxe]]. Converter: [[http://wiki.softxs.ch/intern/SetupDocBook?action=AttachFile&do=get&target=SetupDocBookxml2pdf.sh|xml2pdf.sh]]. == Installation, Setup on Centos 5 == == Installation, Setup on FreeBSD 8 == == Installation, Setup on SuSe 11.3 == = Documentation (links) = = Examples and Running = == Submittal Header XML in Smarty Template == ---- = Installation, Setup on MacOS X = Requirements for PDF generation: 1. [[http://sagehill.net/docbookxsl/UseCatalog.html|Apache XML Commons Resolver]] available [[http://xml.apache.org/commons/dist/|here]] 1. [[http://xmlgraphics.apache.org/fop/|Apache FOP]] == Apache XML Commons Resolver == 1. Get resolver.jar [[http://xml.apache.org/commons/dist/|here]] 1. Unpack and move to ... {{{ sudo mv -i ~/Downloads/xml-commons-resolver-1.2 /usr/share/java/ }}} 1. Add location to CLASSPATH in .bashrc {{{ CLASSPATH=$CLASSPATH":/usr/share/java/xml-commons-resolver-1.2/resolver.jar" }}} == Apache FOP == 1. Get [[http://xmlgraphics.apache.org/fop/|Apache FOP]] 1. Unpack and move ... {{{ sudo mv -i ~/Downloads/fop-1.0 /usr/local/ }}} 1. Create symbolic links for ~/Library/Java/Extensions/ {{{ ln -s /usr/local/fop-1.0/lib/*.jar ~/Library/Java/Extensions/ ln -s /usr/local/fop-1.0/build/fop.jar ~/Library/Java/Extensions/ }}} == DocBook == 1. Get [[http://sourceforge.net/projects/docbook/files/|DocBook]] 1. Unpack and move ... {{{ sudo mv -i ~/Downloads/docbook-xsl-1.76.1 /usr/local/ }}} 1. Go there and run installation ... {{{ cd /usr/local/docbook-xsl-1.76.1/ ./install.sh }}} 1. Test if everything went fine ... {{{ ./test.sh }}} == Examples == === DocBook to HTML === Copy the following UTF-8 encoded and save as '''docbook-test.xml''': {{{
NormanWalsh ndw 339-343 15 3 The TeX User's Group 1994 A World Wide Web Interface to CTAN CTAN-Web 1.0 28 Mar 1994 Submitted. 0.5 15 Feb 1994 First draft for review. The body of the article …
}}} Now you can generate a ''chunked'' XHTML ''(separate HTML pages for each document section)'' with style file '''chunked.xsl''' using '''xsltproc''' ... {{{ xsltproc /usr/local/docbook-xsl-1.76.1/xhtml/chunk.xsl docbook-test.xml }}} This should generate you '''index.html'''. === DocBook to PDF === Copy the following UTF-8 encoded and save as '''book.xml''': {{{ Mein erstes Kapitel Hier ist ein Absatz Ein Abschnitt im Kapitel Mindestens ein Absatz im Aschnitt macht ihn DTD-Gerecht. }}} PDF generation requires to first create a FO file ... {{{ xsltproc --output book.fo /usr/local/docbook-xsl-1.76.1/fo/docbook.xsl book.xml }}} Now, generate the PDF from the resulting FO source ... {{{ java org.apache.fop.cli.Main -fo book.fo -pdf book.pdf }}} This should give you '''book.pdf'''. ''Have fun!''