View Source Djot (Djot v0.1.3)

Transform a Djot string input to HTML output.

No sanitization is performed, the document comes directly from the Djot transformer.

Various options are accepted to control the Djot renderer output. See Djot.Options for details

Summary

Functions

Converts a Djot document into HTML

Converts a Djot document into HTML

Functions

Link to this function

to_html(dj, options \\ %Djot.Options{})

View Source
@spec to_html(String.t(), Djot.Options.t() | Enumerable.t()) ::
  {:ok, String.t()} | {:error, :djot_transform}

Converts a Djot document into HTML

Returns a tuple

Examples

iex> Djot.to_html("Hello World!")
{:ok, "<p>Hello World!</p>\n"}
Link to this function

to_html!(dj, options \\ %Djot.Options{})

View Source
@spec to_html!(String.t(), Djot.Options.t() | Enumerable.t()) :: String.t()

Converts a Djot document into HTML

Returns the document or throws an error

Examples

iex> Djot.to_html!("Hello World!")
"<p>Hello World!</p>\n"