cargo crowbook 0.9.0

latest releases: 0.16.1, 0.16.0, 0.15.2...
8 years ago

The main objective of this release is to clean public interfaces, in
order to limit breaking changes in the future. Ideally, all pre-1.0
releases should thus be 0.9.x. Concretely, this meant three things:

  • reducing the surface of Crowbook's library API;
  • cleaning options names
  • cleaning the names exported in templates and document them, in order
    not to break user-defined templates in future (non-breaking)
    releases.
    More detailed changes for this release:
  • Breaking change for users: removed tex.short option, replaced
    by a more generic tex.class (default being
    book). html.crowbook_link has also been removed.
  • Renamed options. Using the old name will print a deprecation warning
    but will still work for a while.
    • temp_dir -> crowbook.temp_dir
    • zip.command -> crowbook.zip.command
    • verbose -> crowbook.verbose
    • html.print_css -> html.css.print
    • html.display_chapter -> html_single.one_chapter
    • html.script -> html_single.js
    • numbering -> rendering.num_depth
    • numbering_template -> rendering.chapter_template
    • display_toc -> rendering.inline_toc
    • toc_name -> rendering.inline_toc.name
    • enable_yaml_blocks -> input.yaml_blocks
    • use_initials -> rendering.initials
    • autoclean -> input.autoclean
    • html_dir.css -> html.css (not really renamed, html_dir.css
      isactually removed as there is no point in having different CSS
      for standalone and multifile HTML rendering, is it?)
  • New options:
    • More metadata: license, version and date. These metadata are
      not treated by the renderers, but they are exported to the
      templates: {{{metadata}}} allows to access the content. If they
      are present, a has_metadata is also set to true, allowing to do
      something like {{{title}}} {{#has_version}}version {{{version}}} {{/has_version}}.
    • Yet more metadata: it is possible to add custom metadata by
      prefixing it with metadata.. They will then be accessible in the
      templates, with dots ('.') replaced by underscores ('_'). E.g.,
      with metadata.foo: bar you can access it in your templates with
      {{{metadata_foo}}}.
    • output.base_path specifies a directory where the output files (set
      by output.FORMAT will be written.
    • resources.base_path.templates specifies where templates can be
      found.
  • Rendering:
    • Metadata can now contain Markdown and will be rendered by the
      renderers. This might not be a good idea for common fields
      (e.g. "title"), though. Use with caution.
    • rendering.inline_toc.name can use {{{loc_toc}}} to specify a
      localized name.
    • HTML:
      • html.top and hstml.footer are now considered as templates, so
        you can use some {{{metadata}}} in it.
      • Improved the way footnotes are displayed.
      • In standalone HTML, footnotes are rendered at the end of the
        document instead of at the end of the chapter, unless
        html_single.one_chapter is true.
    • LaTeX:
      • If tex.class is set to article, chapters will be displayed as
        \sections since article class doesn't handle chapters.
      • Except if tex.class is set to book, margins are now
        symmetrical.
      • LaTex template now uses version and date.
  • Bugfixes:
    • import_config only import options from another book file that
      are not equal to the default ones and that haven't already been
      set by the caller. E.g., author: foo then import_config: bar.book won't erase the author previously set.
    • import_config now correctly translates the imported book's
      paths.
  • Crowbook program:
    • Still working to improve error messages.
    • crowbook --list-options uses colours. This might hurt your eyes.
    • Display an error message when mustache can't compile a template,
      instead of panicking.
  • Internal/API:
    • Added static methods to Logger to allows displaying messages
      more easily/prettily.
    • Reduce pubic API's surface so less changes will need to be
      considered breaking in the future.

Don't miss a new crowbook release

NewReleases is sending notifications on new releases.