Chapter 3. Getting started

Installing XMLmind Ebook Compiler

How to install XMLmind Ebook Compiler is explained in Chapter 5. Installation.

Writing an ebook specification

You have learned in Chapter 2. Primer:

You'll find a template for your ebook specification in ebookc_install_dir/doc/manual/template/template.ebook. The recommended extension for these files is ".ebook".

Writing a CSS stylesheet for your ebooks

If you want your ebook to look good, the simplest is to set attribute includebasestylesheet of element book to "true" as explained in Leveraging base.css, the stock CSS stylesheet.

Alternatively, you may want to use a custom CSS stylesheet developed from scratch, starting from the template found in ebookc_install_dir/doc/manual/template/skeleton.css. In this case, as explained in Nicely formatted books, make sure to add this kind of link to the headcommon element of your root book element:

1
2
3
4
<headcommon>
  <html:link href="my_custom_stylesheet.css" rel="stylesheet"
             type="text/css"/>
</headcommon>

Compiling an ebook specification

An ebook specification is compiled using a command-line tool called ebookc. Run ebookc_install_dir/bin/ebookc.bat on Windows and ebookc_install_dir/bin/ebookc on the Mac and on Linux.

Example, convert this manual to EPUB:

C:\ebookc_1_6_0\docsrc\manual> ..\..\bin\ebookc.bat manual.ebook out\manual.epub

Example, convert this manual to Web Help (output directory being "out\manual_webhelp\"):

C:\ebookc_1_6_0\docsrc\manual> ..\..\bin\ebookc.bat -f webhelp¬
  manual.ebook out\manual_webhelp

Example, convert this manual to DOCX using a copy of XMLmind XSL-FO Converter installed in "C:\xfc\":

C:\ebookc_1_6_0\docsrc\manual> ..\..\bin\ebookc.bat¬
  -xfc C:\xfc\bin\fo2rtf.bat¬
  manual.ebook out\manual.docx

XMLmind XSL-FO Converter Evaluation Edition (download page) generates output containing random duplicate letters. This makes this edition useless for any purpose other than evaluating XMLmind XSL-FO Converter. Of course, this does not happen with XMLmind XSL-FO Converter Professional Edition!

Example, convert this manual to PDF using a copy of RenderX XEP installed in "C:\xep\":

C:\ebookc_1_6_0\docsrc\manual> ..\..\bin\ebookc.bat¬
  -xep C:\xep\xep.bat¬
  manual.ebook out\manual.pdf

To avoid specifying options -xep and -xfc each time you run ebookc, the simplest if to create once for all an ebookc.options file in the ebookc user preferences directory. This directory is:

  • $HOME/.ebookc/ on Linux.
  • $HOME/Library/Application Support/XMLmind/ebookc/ on the Mac.
  • %APPDATA%\XMLmind\ebookc\ on Windows. Example: C:\Users\john\AppData\Roaming\XMLmind\ebookc\.

Your ebookc.options file would contain:

-xep C:\xep\xep.bat
-xfc C:\xfc\bin\fo2rtf.bat