View Source Tuftemark.Utils (Tuftemark v0.1.0)

Provides access to common helpers used in other parts of the Tuftemark convertor.

Summary

Functions

Generates a set of tags (with proper classes set) to be used as side- or marginal note.

Wraps the given AST into another tag as a whole.

Functions

Link to this function

sidenote(key, attrs, children, annotations, is_numbered \\ false)

View Source

Generates a set of tags (with proper classes set) to be used as side- or marginal note.

The main difference is that for sidenotes we must pass truthy is_numbered to get automatic numbering for them. Marginal notes shall not be numbered.

Wraps the given AST into another tag as a whole.

Examples

iex> ast = [{"p", [], ["Lorem ipsum"], %{}}]
iex> Tuftemark.Utils.wrap_in(ast, "div")
[{"div", [], [{"p", [], ["Lorem ipsum"], %{}}], %{}}]