$
publican build
command to create the CSV file for Drupal import. Before running the command, use the cd command to change into the directory where your book is located. For example, if you have a book call "User_Guide" in your home directory, then run the following command.
$
cd User_Guide/
$
publican build --langs en-US --formats=drupal-book
tmp/en-US/drupal-book/
directory.
/tmp/en-US/drupal-book/
directory. This directory contains the following files:
$product-$version-$docname-$lang-$edition.csv
Important — Use version control system
$
publican build --langs en-US --formats=drupal-book
command, you will notice that the xml files in the en-US
directory had been changed. This is because Publican added a 'Conformance'
attribute for every xml tag that has id. This attribute contains a number which is unique across xml files in the book. If you are using a version control system like git for your xml files, then you need to commit the changes so that the number won't get reset when other users run it. These unique numbers are very important, because they are use as the url path in drupal. Besides, Publican also created a database file name max_unique_id.db
in the en-US
directory. This database file is use to track the current maximum unique number in the book, so that Publican can know where you are up to and add a new unique number for your newly created Chapter or Section. Therefore, it is very important to add the database file to the version control and commit it if there is any change. If you add a new section in the xml, don't set the 'Comformance'
attribute yourself as that will make the database outdated. Just leave it for publican to set it.