Extension:DocBookExport

DocBookExport is a MediaWiki extension that lets you create a DocBook from selected wiki pages. You can download the DocBook as an XML file or in PDF format.

Installation

 * Make the "generated_files" folder writable by the server.
 * In Ubuntu "sudo chown www-data:www-data generated_files" should usually work.

Dependencies

 * Install pandoc.
 * See https://github.com/jgm/pandoc/releases for the latest version
 * For Ubuntu use the following commands, replace the version number as per the latest release.
 * sudo wget https://github.com/jgm/pandoc/releases/download/2.0.5/pandoc-2.0.5-1-amd64.deb
 * sudo dpkg -i pandoc-2.0.5-1-amd64.deb
 * Configure $wgDocBookExportPandocPath to your Pandoc path in case the "pandoc" command doesn't work
 * Install extension Figures - It supports defining figures in MediaWiki
 * To download DocBook files in Zip format install the ZipArchive php extension.
 * See https://stackoverflow.com/q/3872555/1150075
 * To download DocBook in PDF format install xsltproc and fop
 * See https://askubuntu.com/a/462343 and https://www.howtoinstall.co/en/ubuntu/trusty/fop

Usage
To create a book define the page structure using the docbook parser function or tag extension. See examples below. Parser Function Example:

Where the parameters custom defined are as follows:
 * is used to defines the wiki pages that will be part of the docbook as cover, sections and chapters. The first line starts with a '?' and indicates the cover, * indicates a chapter and ** indicates a section of that chapter. Sub-sections can be defined using *** or **** and so on. The last line again starts with a '?' and indicates the wiki page to be used as the appendix. Sometimes you may want to merge contents of multiple wiki pages to one section/chapter. For that you can add a comma separated list of such pages as well. You can also customize the title of such a section by adding the following wikitext  at the end of the line. Similarly you can customize the header for a specific section by using the   syntax at the end of the line as shown in the example.


 * This parameter defines the name of the Docbook. This doesn't relate to any wiki page and is only used to name the files and the title of the docbook.
 * This parameter specifies the wiki page to be used as the cover page.
 * This parameter specifies the header to be used for every page of the docbook.
 * This parameter specifies the footer to be used for every page of the docbook.
 * This parameter is a comma separated list of terms that should be indexed.
 * If you have wiki pages for all your index terms you can add them to a category and mention it here.

Credits
This extension has been written by Nischay Nahata for wikiworks.com

Development and Help
Please contact wikiworks.com for consulting on further developments, feature requests or bug fixes on this extension.