markdown :: Decorator :: defaultinit
# A `Decorator` is used to emit mardown into a specific format.
# Default decorator used is `HTMLDecorator`.
interface Decorator
# Kind of processor used
type PROCESSOR: MarkdownProcessor
# Render a single plain char.
#
# Redefine this method to add special escaping for plain text.
fun add_char(v: PROCESSOR, c: Char) do v.addc c
# Render a ruler block.
fun add_ruler(v: PROCESSOR, block: BlockRuler) is abstract
# Render a headline block with corresponding level.
fun add_headline(v: PROCESSOR, block: BlockHeadline) is abstract
# Render a paragraph block.
fun add_paragraph(v: PROCESSOR, block: BlockParagraph) is abstract
# Render a code or fence block.
fun add_code(v: PROCESSOR, block: BlockCode) is abstract
# Render a blockquote.
fun add_blockquote(v: PROCESSOR, block: BlockQuote) is abstract
# Render an unordered list.
fun add_unorderedlist(v: PROCESSOR, block: BlockUnorderedList) is abstract
# Render an ordered list.
fun add_orderedlist(v: PROCESSOR, block: BlockOrderedList) is abstract
# Render a list item.
fun add_listitem(v: PROCESSOR, block: BlockListItem) is abstract
# Render an emphasis text.
fun add_em(v: PROCESSOR, text: Text) is abstract
# Render a strong text.
fun add_strong(v: PROCESSOR, text: Text) is abstract
# Render a strike text.
#
# Extended mode only (see `MarkdownProcessor::ext_mode`)
fun add_strike(v: PROCESSOR, text: Text) is abstract
# Render a link.
fun add_link(v: PROCESSOR, link: Text, name: Text, comment: nullable Text) is abstract
# Render an image.
fun add_image(v: PROCESSOR, link: Text, name: Text, comment: nullable Text) is abstract
# Render an abbreviation.
fun add_abbr(v: PROCESSOR, name: Text, comment: Text) is abstract
# Render a code span reading from a buffer.
fun add_span_code(v: PROCESSOR, buffer: Text, from, to: Int) is abstract
# Render a text and escape it.
fun append_value(v: PROCESSOR, value: Text) is abstract
# Render code text from buffer and escape it.
fun append_code(v: PROCESSOR, buffer: Text, from, to: Int) is abstract
# Render a character escape.
fun escape_char(v: PROCESSOR, char: Char) is abstract
# Render a line break
fun add_line_break(v: PROCESSOR) is abstract
# Generate a new html valid id from a `String`.
fun strip_id(txt: String): String is abstract
# Found headlines during the processing labeled by their ids.
fun headlines: ArrayMap[String, HeadLine] is abstract
end
lib/markdown/markdown.nit:637,1--713,3