Skip to content

0.2.3

Choose a tag to compare

@JanMiksovsky JanMiksovsky released this 18 Dec 18:37
· 1425 commits to main since this release

Origami front matter

Text documents like .md can define an Origami expression in front matter.

Origami template documents

Origami template documents like .ori.html can also define an Origami expression in front matter. If present, the front matter will be evaluated as an expression and the result used as the value of the document. This front matter expression can reference the template body as @template.

This opens up many more possibilities for template documents, including invoking base page templates, defining a template as a function that accepts multiple parameters. See the [Template documents](template documents documentation for examples.

The body of a template documents is now constructed using the text:indent function to permit automatic indenting of, e.g., HTML elements.

When used inside a map, a template document will provide a default key function for the map that can append an extension to the map's output. E.g., a template called book.ori.html will apply an html extension to keys when used in a map.

The Microsoft VS Code extension has been updated to provide syntax highlighting in .ori.html and .ori.md documents.

⚠️ The Prettier VS Code extension may want to format your HTML documents, including embedded Origami expressions. It should be possible to configure Prettier to leave .ori.html documents alone. Alternatively, you can use VS Code's "Save without Formatting" command.