module watt.markdown.html

Markdown HTML printer.

Code Map

//! Markdown HTML printer.
module watt.markdown.html;


//! Prints Markdown documents in format HTML.
class Html : Visitor
{
public:
	//! Are we in plain mode. This is used for images and links.
	plain: Node;
	//! Track if the last character written was a newline.
	lastNl: bool;


public:
	this() { }
	fn enter(n: Document, sink: scope (Sink)) { }
	fn leave(n: Document, sink: scope (Sink)) { }
	fn enter(n: BlockQuote, sink: scope (Sink)) { }
	fn leave(n: BlockQuote, sink: scope (Sink)) { }
	fn enter(n: Paragraph, sink: scope (Sink)) { }
	fn leave(n: Paragraph, sink: scope (Sink)) { }
	fn enter(n: Heading, sink: scope (Sink)) { }
	fn leave(n: Heading, sink: scope (Sink)) { }
	fn enter(n: List, sink: scope (Sink)) { }
	fn leave(n: List, sink: scope (Sink)) { }
	fn enter(n: Item, sink: scope (Sink)) { }
	fn leave(n: Item, sink: scope (Sink)) { }
	fn enter(n: Link, sink: scope (Sink)) { }
	fn leave(n: Link, sink: scope (Sink)) { }
	fn enter(n: Image, sink: scope (Sink)) { }
	fn leave(n: Image, sink: scope (Sink)) { }
	fn enter(n: Emph, sink: scope (Sink)) { }
	fn leave(n: Emph, sink: scope (Sink)) { }
	fn enter(n: Strong, sink: scope (Sink)) { }
	fn leave(n: Strong, sink: scope (Sink)) { }
	fn visit(n: HtmlBlock, sink: scope (Sink)) { }
	fn visit(n: CodeBlock, sink: scope (Sink)) { }
	fn visit(n: Text, sink: scope (Sink)) { }
	fn visit(n: Code, sink: scope (Sink)) { }
	fn visit(n: HtmlInline, sink: scope (Sink)) { }
	fn visit(n: Softbreak, sink: scope (Sink)) { }
	fn visit(n: Linebreak, sink: scope (Sink)) { }
	fn visit(n: ThematicBreak, sink: scope (Sink)) { }


protected:
	fn ln(sink: scope (Sink)) { }
	fn w(sink: scope (Sink), str: string) { }
	fn wln(sink: scope (Sink), str: string) { }
	fn getGrandparent() Node { }
	fn isGrandparentTightList() bool { }
	fn push(n: Document) { }
	fn push(n: BlockQuote) { }
	fn push(n: List) { }
	fn push(n: Item) { }
	fn push(n: Paragraph) { }
	fn push(n: Heading) { }
	fn push(n: Emph) { }
	fn push(n: Strong) { }
	fn push(n: Link) { }
	fn push(n: Image) { }
	fn pop(n: Document) { }
	fn pop(n: BlockQuote) { }
	fn pop(n: List) { }
	fn pop(n: Item) { }
	fn pop(n: Paragraph) { }
	fn pop(n: Heading) { }
	fn pop(n: Emph) { }
	fn pop(n: Strong) { }
	fn pop(n: Link) { }
	fn pop(n: Image) { }
	fn push(n: Node) { }
	fn pop(n: Node) { }
}

//! Print the given Markdown document in html format and return it as a
//! string.
fn printHtml(doc: Document) string { }
//! Print the given Markdown document in html format to the given sink.
fn printHtml(doc: Document, sink: scope (Sink)) { }
fn printHtml(doc: Document) string

Print the given Markdown document in html format and return it as a string.

fn printHtml(doc: Document, sink: scope (Sink))

Print the given Markdown document in html format to the given sink.

class Html : Visitor

Prints Markdown documents in format HTML.

plain: Node

Are we in plain mode. This is used for images and links.

lastNl: bool

Track if the last character written was a newline.