Laika v0.12.0 Release Notes

Release Date: 2019-10-30 // over 4 years ago
  • New laika-io Module, Full Referential Transparency, Integration with cats-effect

    ๐Ÿš€ This is a breaking release, for a full migration guide, see the Migration Guide

    • ๐Ÿ†• New laika-io Module
      • Functionality extracted from existing laika-core module
      • Contains File/Stream IO, EPUB output, Parallel transformations
      • Based on cats-effect type classes (in "Bring-Your-Own-Effect" style)
      • Leaves laika-core pure, preparing it for later support for Scala.js
    • Referential Transparency
      • No method in the public API throws Exceptions anymore
      • The result of pure operations is provided by instances of Either
      • The result of side-effecting operations is provided by a return type of F[_],
        an effect type from cats-effect
      • Eliminated all uses of runtime reflection
    • ๐Ÿ”„ Changes to the APIs for creating and running parsers, renderers and transformers
      • Necessary due to the changes listed above
      • See the migration guide for details and examples
    • ๐Ÿ”„ Changes to the Directive Syntax in Templating
      • The syntax of separators for the attribute and body sections have changed
      • HOCON syntax is now used for attributes
      • The old syntax is still supported, but will be removed at some point before the 1.0 release
    • ๐Ÿ”„ Changes to the Directive DSL for creating directives
      • attribute(Default) is now defaultAttribute
      • body is now either parsedBody or rawBody
      • Type conversions happen with the new as method: attribute("title").as[String],
        based on the ConfigDecoder type class that is also used for the new Config API
      • Named body parts have been replaced by the more flexible Separator Directives
      • The built-in helper for mapping directive parts with different arity has
        been replaced by cats' mapN
    • ๐Ÿ”จ Refactoring of AST Rewrite API to be fully type-safe and avoid runtime reflection and exceptions.
      • Return types are now more explicit (e.g. Replace(newSpan) instead of Some(newSpan))
      • Rules for rewriting spans and blocks get registered separately for increased
        type-safety, as it is invalid to replace a span with a block element.
    • ๐Ÿ”จ Refactoring of the Render API to be referentially transparent
      • Also applies to the API for registering custom renderers for individual AST nodes
    • ๐Ÿ†• New Config API and built-in HOCON parser
      • Removed the dependency on the Typesafe Config library and its impure Java API
      • Added a new lightweight and pure HOCON parser as part of laika-core,
        ๐Ÿ‘Œ supporting the full spec except for file includes (for now).
    • โœจ Enhancement for the DocumentTree API
      • The result of a tree parsing operation is now a new type called DocumentTreeRoot
      • It has a coverDocument property and contains the recursive tree structure of the parsed content.
      • Each DocumentTree in the structure now has an explicit titleDocument: Option[Document] property for more explicit content organization in e-books.
      • Properties that previously held references to streams and other impure data had been
        โœ‚ removed from the pure content model (e.g. DocumentTree.staticDocuments).
    • ๐Ÿ› Bug fixes for fenced code blocks with blank lines in GitHub-Flavored Markdown
    • Markdown: Properly render JavaScript in <script> tags in verbatim HTML