1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-09-28 15:21:33 +02:00
Converts books written in Markdown to HTML, LaTeX/PDF and EPUB
Go to file
2016-02-21 20:33:30 +01:00
book_example completed book example 2016-02-21 20:33:30 +01:00
src updated templates 2016-02-21 19:39:54 +01:00
templates updated templates 2016-02-21 19:39:54 +01:00
tests tests now compile again 2016-02-19 16:27:41 +01:00
.gitignore nows tries to render odt if specified in book file 2016-02-21 01:55:16 +01:00
.travis.yml initial commit 2016-02-18 04:06:14 +01:00
Bugs.md Updated documentation 2016-02-21 02:06:14 +01:00
Cargo.toml updated doc 2016-02-21 18:28:48 +01:00
ChangeLog.md added empty changelog 2016-02-20 17:24:07 +01:00
LICENSE.md license to license.md 2016-02-20 18:48:39 +01:00
README.md completed book example 2016-02-21 20:33:30 +01:00

Crowbook

Render a markdown book in HTML, Epub or PDF.

Build Status

Building and installing

Youl'll need to have the Rust compiler on your machine first; you can download and install it here. Once it is down:

$ cargo install crowbook

will download crowbook and install it.

Usage

The simplest command is:

$ crowbook <BOOK>

Where BOOK is a configuration file. Crowbook will then parse the config file and generate book in HTML, Epub, LaTeX, and/or PDF, according to the setting in the configuration file. So if you clone this repository and run

$ crowbook book_example/config.book

(or cargo run -- book_example/config.book if you don't want to install it), you'll generate the example book in various format. The HTML version should look like that.

Now, let's say you want to make your own book. Assuming you have a list of Markdown files, you can generate a template configuration file with the --create argument:

$ crowbook --create my.book chapter_*.md

This will generate a default my.book file, which you'll need to complete.

This configuration file contains some metadata, options, and lists the Markdown files. Here is a basic example:

author: Joan Doe
title: Some book
lang: en

output_html: some_book.html

+ chapter_1.md
+ chapter_2.md
+ chapter_3.md
+ ...

For more information see the configuration file page, or the whole book_example directory. (A (not necessarily up-to-date) rendered version is available in HTML here).

It is also possible to give additional parameters to crowbook; we have already seen --create, but if you want the full list, see the arguments page.

Features

Done

  • Support for some simple format configuration files to list chapters and metadatas, so you just run crowbook some_file and you don't have to pass more options, it generates the rest.
  • Support for Epub2 and Epub3 format as output.
  • Support for HTML format as output.
  • Partial support for LaTeX format as output, and PDF through it.
  • Experimental support for Odt format as output.
  • Support for basic french typography (i.e. non-breaking spaces) in HTML/Epub format.
  • Some configuration for HTML/Epub templates and CSS.

ToDo

  • Allow more customization.
  • Support for easily embedding custom fonts (and other files) in Epub/HTML.
  • Improve LaTeX and Odt generation.
  • Correct support for technical books.

See also Bugs.

Acknowledgements

Besides the Rust compiler and standard library, Crowbook uses the following libraries:

While Crowbook directly doesn't use them, there was also inspiration from Pandoc and mdBook.

ChangeLog

See ChangeLog.

Library

While the main purpose of Crowbook is to be runned as a command line, the code is written as a library so if you want to build on it you can use it as such. The code is currently badly documented (and badly in a general manner), but you can look at the generated documentation here.

License

Crowbook is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL), version 2.1 or (at your option) any ulterior version. See LICENSE file for more information.