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, you'll have to specify a number of CSS styles for it as explained in Nicely formatted books. You'll find a CSS stylesheet template in ebookc_install_dir/doc/manual/template/template.css.

Alternatively, you may use the XMLmind CSS stylesheet ebookc_install_dir/doc/manual/css/xmlmind_ebook.css as is for your own ebooks. You may also use the XMLmind stylesheet as a starting point for developing your own CSS stylesheet. In both cases, make sure to add the following link to the headcommon element of your root book element:

  <html:link href="css/xmlmind_ebook.css" rel="stylesheet"

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_3_1\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_3_1\docsrc\manual> ..\..\bin\ebookc.bat -f webhelp¬
  manual.ebook out\manual_webhelp

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

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

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

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

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