simple_markdown v0.7.0 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.Attribute.*
. 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/0
.
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( Stream.t() | [SimpleMarkdown.attribute() | String.t()] | SimpleMarkdown.attribute() | String.t() ) :: String.t()
Render the parsed markdown as HTML.