classafFandoc::HtmlDocWriter

sys::Obj
  afFandoc::HtmlDocWriter : afFandoc::DocWriter

@Js

A intelligent DocWriter with useful method override hooks. Links that cannot be resolved are rendered with an invalidLink CSS class and pre blocks are processed

attr

Source

virtual Void attr(OutStream out, Str key, Obj? val)

Writes out an HTML attribute. If val is null a HTML5 Boolean attribute is written out. If val is a Uri then it's encoded form is written out. Else val.toStr is used.

All attribute values are XML escaped.

cssClasses

Source

DocNodeId:Str cssClasses := ...

escapeText

Source

virtual override Str escapeText(DocElem elem, Str text)

Escapes the given text to XML, unless we're inside a pre block.

fullyLoaded

Source

static HtmlDocWriter fullyLoaded()

A HTML writer that performs pre-block-processing for tables and syntax colouring.

isVoidElem

Source

virtual Bool isVoidElem(DocElem elem)

Special end-tag handling for Void Elements. See Void Elements in the W3C HTML5 specification.

linkResolvers

Source

LinkResolver[] linkResolvers := LinkResolver[,]

original

Source

static HtmlDocWriter original()

A simple HTML writer that mimics the original; no invalid links and no pre-block-processing.

preProcessors

Source

Str:PreProcessor preProcessors := [Str:PreProcessor][:]

renderAttrs

Source

virtual Void renderAttrs(OutStream out, DocElem elem)

Renders some standard element attributes, i.e. src and alt for img tags.

Renders an id attribute should the element's anchorId not be null.

renderClass

Source

virtual Void renderClass(OutStream out, DocElem elem)

Writes out class attributes for some common scenarios.

renderElem

Source

virtual Void renderElem(OutStream out, DocElem elem, Str body)

Invokes a PreProcessor should a matching one be found, else defaults to calling renderElem().

renderPreBody

Source

virtual Void renderPreBody(OutStream out, DocElem elem, Str body)

Invokes a PreProcessor should a matching one be found, else defaults to calling renderElem().

Source

virtual Uri? resolveLink(DocElem elem, Str url)

Calls the LinkResolvers looking for valid links.