simple_markdown v0.5.4 SimpleMarkdown.Renderer.HTML protocol
A renderer protocol for HTML.
Individual rule renderers can be overriden or new ones may be
added. Rule types follow the format of structs defined under
SimpleMarkdown.Attributes
. e.g. If there is a rule with the
name :header
, to provide a rendering implementation for that
rule, you would specify for: SimpleMarkdown.Attribute.Header
.
Rules then consist of a Map with an input
field, and an optional
option
field. See SimpleMarkdown.attribute
.
Example
defimpl SimpleMarkdown.Renderer.HTML, for: SimpleMarkdown.Attribute.Header do
def render(%{ input: input, option: size }), do: "<h#{size}>#{SimpleMarkdown.Renderer.HTML.render(input)}</h#{size}>"
end
Link to this section Summary
Functions
Render the parsed markdown as HTML
Link to this section Types
Link to this section Functions
Link to this function
render(ast)
Render the parsed markdown as HTML.