cargo crowbook 0.5.0

latest releases: 0.16.1, 0.16.0, 0.15.2...
8 years ago
  • 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 of book 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 print
    • html.display_chapter: displays one chapter at a time in
      standalone HTML
    • html.script: allows to specify a custom javascript file for
      standalone HTML
    • html_dir.script: same thing for multipage HTML
    • resources.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 also resources.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 where resources.files should be
      copied in the final document. Default to data, meaning that
      files will be placed in a data 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
      "–" when lang is set to "fr" and standard bullets for other
      languages).
  • 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).
  • Internal/API:
    • The Book::new, new_from_file, and new_from_markdown_file
      take an additional options parameter. To create a book with
      default options, set it to &[].

Don't miss a new crowbook release

NewReleases is sending notifications on new releases.