- Crowbook now requires Rustc 1.7.0.
- It is now possible to render HTML in multiple files:
output.html_dir
will activate this renderer, and specify in
which directory to render these files;html_dir.css
allows to override the CSS for this rendering;html_dir.index.html
allows to specify a template for the
index.html
page;html_dir.chapter.html
allows to specify a template for the
chapters pages.
- New book options:
tex.short
: if set to true, the LaTeX renderer will use
article
instead ofbook
as document class, and will use the
default\maketitle
command for article. This option is by
default set to false, except when Crowbook is called with
--single
.enable_yaml_blocks
: parsing YAML blocks is no longer activated
by default, except when using--single
. This is because you
might want to have e.g. multiple short stories using YAML blocks
to set their titles and so on, and a separate.book
file to
render a book as a collection of short stories. In this case,
you wouldn't want the displayed title or the
output.pdf/html/epub files be redefined by the short stories .md
files.html.print_css
: allows to specify a stylesheet for media printhtml.display_chapter
: displays one chapter at a time in
standalone HTMLhtml.script
: allows to specify a custom javascript file for
standalone HTMLhtml_dir.script
: same thing for multipage HTMLresources.base_path
: by default, Crowbook resolves local links in
markdown files relatively to the markdown file. This option
allows to resolve them relatively to a base path. This option
comes with two variants,resources.base_path.images
and
resources.base_path.links
, which only activate it for respectively
images tags and links tags. These two options are ignored when
base_path
is set. There is alsoresources.base_path.files
which specify where additional files (see below) should be read,
but this is one is set to.
(i.e., the directory where the
.book
file is) by default.resources.files
: indicate a (whitespace-separated) list of
files that should be embedded. Currently only used with the EPUB
renderer.resources.out_path
: indicate whereresources.files
should be
copied in the final document. Default todata
, meaning that
files will be placed in adata
directory in the EPUB.
- Rendering:
- Templates can now use localized strings according to the
lang
option - Standalone HTML now includes locale files using base64.
- Standalone HTML displays one chapter at a time, thouht it can be
changed via a button in the menu. - HTML/EPUB: default CSS now uses the
lang
value do determine
how to display lists (currently the only difference is it uses
"–" whenlang
is set to "fr" and standard bullets for other
languages).
- Templates can now use localized strings according to the
- Bugfixes:
- Fixed a bug of filename "resolution" when Crowbook was called
with--single
(e.g.,crowbook -s tests/test.md
would
previously try to load `tests/tests/test.md). - Epub renderer now uses the
mime_guess
library to guess the
mime type based on extension, which should fix the mime type
guessed for a wide range of extensions (e.g., svg).
- Fixed a bug of filename "resolution" when Crowbook was called
- Internal/API:
- The
Book::new
,new_from_file
, andnew_from_markdown_file
take an additionaloptions
parameter. To create a book with
default options, set it to&[]
.
- The