Skip to content

Convert AsciiDoc to DocBook for use with Publican

mojavelinux edited this page Feb 20, 2013 · 5 revisions

Publican expects certain structural rules to be followed in order to be able to build outputs with it. These expectations differ depending on whether you want to produce an article, book, or bookset. Booksets are pretty uncommon, so I won’t be testing them at this point. This document will provide some notes about how to get from Asciidoc to Publican-built output for articles and books.

Articles

  1. Convert your Asciidoc to a Docbook article using the following command.

    asciidoc -b docbook myfile.asciidoc

    This creates a file called myfile.xml.

  2. Edit the document and remove the language specification from the root <article> node.

  3. Create a Publican article with the same name as your new Docbook file (minus the extension).

    publican create --type=article --name=myfile
  4. Replace the article’s main file with your converted one.

    cp myfile.asciidoc myfile/en-US/myfile.xml
  5. Change to the main directory of the book.

    cd myfile/
  6. Build the book.

    publican build --langs=en-US --formats=html,html-single,pdf
  7. View the output, which is located in the tmp/en-US/ directory.

Books

TBD