Docs
Markdown
Markdown modules and Haml markdown filters compile to Ruby component classes while leaving rendering policy to the consuming application.
MarkdownPlugin
MarkdownPlugin handles .md modules through kramdown with the GFM parser.
Article = import("./article.md")
Markdown files transform into Ruby component classes exported as Default. Markdown renders elements as factory calls rather than raw HTML strings, including raw HTML elements in the Markdown source.
Haml Markdown Filters
Haml :markdown filters use the same compiler and component map as imported Markdown files.
%section
:markdown
## Inline Markdown
This content renders through the configured factory.
Markdown Components
If /markdown-components.rb exists, Markdown rendering uses its Default hash to map tags to components. Markdown files and Haml files with :markdown filters watch the map, so updates reload affected modules.
Heading = import("/components/markdown/Heading.haml")
Link = import("/components/markdown/Link.haml")
Default = {
h1: Heading,
a: Link
}.freeze
Unmapped tags fall back to symbol tags such as :p, :a, and :code.