1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-09-24 19:30:40 +02:00
crowbook/README.md

148 lines
4.3 KiB
Markdown
Raw Normal View History

2016-02-18 04:36:33 +01:00
Crowbook
========
2016-02-21 18:28:48 +01:00
Render a markdown book in HTML, Epub or PDF.
2016-02-18 04:36:33 +01:00
[![Build Status](https://travis-ci.org/lise-henry/crowbook.svg?branch=master)](https://travis-ci.org/lise-henry/crowbook)
2016-02-21 18:28:48 +01:00
Building and installing
-----------------------
Youl'll need to have the [Rust](https://www.rust-lang.org/) compiler
on your machine first; you can
[download and install it here](https://www.rust-lang.org/downloads.html). Once
it is down:
```
$ cargo install crowbook
```
will download `crowbook` and install it. If this is the first time you
run `cargo install`, you'll like
2016-02-19 23:01:34 +01:00
Usage
-----
2016-02-20 17:13:14 +01:00
The simplest command is:
```bash
$ 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.
This configuration file contains some metadata, options, and list the
Markdown files. Here is a basic example:
2016-02-19 23:01:34 +01:00
```
2016-02-20 17:13:14 +01:00
author: Joan Doe
title: Some book
lang: en
output_html: some_book.html
+ chapter_1.md
+ chapter_2.md
+ chapter_3.md
+ ...
2016-02-19 23:01:34 +01:00
```
2016-02-20 17:13:14 +01:00
For more information see
2016-02-20 17:14:28 +01:00
[the configuration file](book_example/config.md), or the whole
2016-02-20 17:13:14 +01:00
[book_example](book_example) directory.
It is also possible to give additional parameters to `crowbook`;
2016-02-20 17:13:14 +01:00
arguments set from the command line will override the ones set in the
`BOOK` configuration file.
2016-02-19 23:01:34 +01:00
2016-02-20 17:13:14 +01:00
```
USAGE:
crowbook [FLAGS] [OPTIONS] <BOOK>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-v, --verbose Activate verbose mode
OPTIONS:
--autoclean <BOOL> Try to clean input markdown [values: true, false]
--numbering <BOOL> Number chapters or not [values: true, false]
-o, --output <FILE> Specify output file
-t, --to <FORMAT> Generate specific format [values: epub, epub, pdf, html, tex]
ARGS:
<BOOK> A file containing the book configuration
Command line options allow to override options defined in <BOOK> configuration file.
E.g., even if this file specifies 'verbose: false', calling 'crowbook --verbose <BOOK>'
will activate verbose mode.
Note that Crowbook generates output files relatively to the directory where <BOOK> is:
$ crowbook foo/bar.book --to pdf --output baz.pdf
will thus generate baz.pdf in directory foo and not in current
directory.
```
2016-02-19 23:01:34 +01:00
Features
--------
### Done ###
2016-02-21 02:06:14 +01:00
* Support for some simple format configuration files to
2016-02-19 23:01:34 +01:00
list chapters and metadatas, so you just run `crowbook
some_file` and you don't have to pass more options, it generates the
rest.
2016-02-20 04:49:20 +01:00
* Support for Epub2 and Epub3 format as output.
2016-02-19 23:01:34 +01:00
* Support for HTML format as output.
2016-02-21 02:06:14 +01:00
* Partial support for LaTeX format as output, and PDF through it.
* Experimental support for Odt format as output.
2016-02-20 18:51:32 +01:00
* Support for basic french typography (i.e. non-breaking spaces) in HTML/Epub format.
2016-02-19 23:01:34 +01:00
* Some configuration for HTML/Epub templates and CSS.
### ToDo ###
* Allow more customization.
2016-02-20 04:49:20 +01:00
* Support for easily embedding custom fonts (and other files) in
Epub/HTML.
2016-02-21 02:06:14 +01:00
* Improve LaTeX and Odt generation.
2016-02-19 23:01:34 +01:00
* Correct support for technical books.
See also [Bugs](Bugs.md).
Acknowledgements
----------------
Besides the Rust compiler and standard library, Crowbook uses the
following libraries:
* [pulldown-cmark](https://crates.io/crates/pulldown-cmark) (for
parsing markdown)
2016-02-20 18:41:02 +01:00
* [mustache](https://crates.io/crates/mustache) (for templating)
2016-02-20 17:24:07 +01:00
* [clap](https://github.com/kbknapp/clap-rs) (for parsing command line arguments)
2016-02-19 23:01:34 +01:00
* [chrono](https://crates.io/crates/chrono) (date and time library)
* [uuid](https://crates.io/crates/uuid) (to generate uuid)
2016-02-20 17:24:07 +01:00
While Crowbook directly doesn't use them, there was also inspiration from [Pandoc](http://pandoc.org/) and [mdBook](https://github.com/azerupi/mdBook).
2016-02-19 23:01:34 +01:00
2016-02-21 18:28:48 +01:00
ChangeLog
---------
See [ChangeLog](ChangeLog.md).
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](http://lise-henry.github.io/rust/crowbook/).
License
-------
2016-02-19 23:01:34 +01:00
2016-02-21 18:28:48 +01:00
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](LICENSE.md) file for more information.