Laika is a customizable and extensible toolkit for transforming lightweight text markup and template based site generation.
It has been designed for two primary usage scenarios:
Embedded use (e.g. web applications that allow user input in one of the supported markup syntaxes)
As a standalone tool (e.g. using Laika's sbt plugin to produce the project's documentation)
Laika does not require the installation of any external tools.
It is Open Source under the Apache 2.0 License.
If you wonder about the name of the project and have never heard about Laika, you can read about her here.
The current version is published to Maven Central for Scala 2.10 and 2.11
The sbt plugin is published to the sbt plugin repository for sbt 0.13.x.
Add the plugin to
addSbtPlugin("org.planet42" % "laika-sbt" % "0.5.1")
Import its default settings in your project's
Add Markdown, reStructuredText or HTML template files to
src/docs in your
project and run the
laika:site task from within sbt to generate the site
Adding the Laika dependency to your sbt build:
libraryDependencies += "org.planet42" %% "laika-core" % "0.5.1"
Example for transforming from file to file:
Transform from Markdown to HTML fromFile "hello.md" toFile "hello.html"
Example for transforming an entire directory of markup files:
Transform from ReStructuredText to HTML fromDirectory "source" toDirectory "target"
Try out Laika with the Web Tool.
Browse the source on GitHub.
Browse the API.
Follow on Twitter for release announcements.
Create Issues here on GitHub for bug reports or enhancement requests.
Ask questions on Stackoverflow, tagging with Laika and Scala.
There will also be a dedicated forum in case of growing interest in Laika.
This manual is written in Markdown and transformed by Laika. Its source
is included in the repository inside the
Support for Markdown and reStructuredText as input
Support for HTML and PrettyPrint (for debugging) as output
Template-based Site Generation
Support for tables of contents, convenient cross-linking between documents and auto-numbering of documents and sections for all supported markup formats
sbt plugin, exposing all Laika features and customization hooks as sbt settings and tasks
Custom Directives (tags) for templates and text markup, with type-safe and concise DSL for their declaration
Customization hooks for renderers (based on simple partial functions that change the output for specific node types)
Document Tree Rewriting (hooks for modifying the document AST, consisting of case classes, between parsing and rendering, based on simple partial functions)
Simple contracts and APIs for adding new parsers and renderers
A set of generic and fast parser combinators for common tasks in markup parsing that are not based on the commonly used (and often slow) regex parsers
Various options for input and output (strings, files, java.io.Reader/Writer, java.io streams)
Parallel processing of parsers and renderers
More than 900 tests
New renderer for PDF (0.6)
New renderer for epub (0.7)
Integrated support for syntax highlighting in source code (0.8)
Various Markdown extensions: GitHub Markdown, MultiMarkdown, YAML headers, etc. (0.9)
After these four releases priorities depend on user demand, therefore no decision has been made yet for these other ideas:
Java API / Gradle plugin
A command line interface
0.5.1 (Oct 10, 2015):
0.5 (Jan 9, 2014):
0.4 (Nov 22, 2013):
0.3 (Aug 3, 2013):
rawand many more)
HTML.unformattedfor terse output without indentation or whitespace (often desirable when writing the rendered document to a database for example)
0.2 (May 7, 2013):
0.1 (Jan 12, 2013):