-
Notifications
You must be signed in to change notification settings - Fork 0
Convert AsciiDoc to DocBook for use with Publican
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. This document will provide some notes about how to get from Asciidoc to Publican-built output for articles and books.
-
Convert your Asciidoc to a Docbook article or book using one of the following commands.
Articleasciidoc -b docbook -a nolang myfile.asciidoc
Bookasciidoc -d book -b docbook -a nolang myfile.asciidoc
This creates a file called
myfile.xml
.NoteThe -a nolang
option prevents thelang
attribute from being set on the root node. If you are not using Publican to process your XML, you can leave this off. -
Create a Publican article or book with the same name as your new Docbook file (minus the extension).
Articlepublican create --type=article --name=myfile
Bookpublican create --name=myfile
-
Replace the article’s main file with your converted one.
cp myfile.xml myfile/en-US/myfile.xml
NoteThe Author_Group.xml and Revision_History.xml which Publican creates by default will be ignored completely. -
Change to the main directory of the article or book.
cd myfile/
-
Build the book.
publican build --langs=en-US --formats=html,html-single,pdf
-
View the output, which is located in the
tmp/en-US/
directory.