In this tutorial you will learn:
- Downloading DocBook Documentation
- Writing DocBook in Xcode
- Validating DocBook XMLs
- Generating PDF from DocBook XMLs
To download MacPorts, go to: http://macports.org/
To install XMLLINT categories, use this Terminal command:
sudo port install docbook-xml xmlcatmgr
To validate a DocBook XML, place these commands (as demonstrated in the video) into an executable file and run by passing the name of the file to validate as an argument:
fileToValidate=”$1″
export SGML_CATALOG_FILES=/opt/local/etc/xml/catalog
xmllint –valid –noout –catalogs $fileToValidate
Questions? let me know and watch for the next videos about DocBook
What to you use for the actual PDF generation? To my knowledge, neither Xcode nor xmllint have an FO engine.
@Ölbaum In this video, I rely on O’Reilly’s internal tools to generate the PDF. I commit the files into SVN with a special keyword in my commit text and O’Reilly’s hooks pick that keyword up and generate the PDF file.
For DocBook XML to PDF conversion you can use DocBook XSL stylesheets combined with XSL-FO engine. http://docbookpublishing.com is also a possible solution. It is a free web service for DocBook XML to PDF conversion. It has REST API.
I’ve not used that before. I’ll check it out though 😉