simple_markdown v0.5.1 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

Summary

Functions

Render the parsed markdown as HTML

Types

t :: term

Functions

render(ast)

Render the parsed markdown as HTML.