class

Termify::Markdown::Renderer

Inherits IO < Reference < Object

Constructors

new(io : IO, stylesheet : Stylesheet = Stylesheet.default, on_gather : Proc(GatherEvent, Nil) | Nil = nil)

-- lifecycle ---------------------------------------------------------

Source

Instance methods

close

Resets the renderer (see #reset) and marks the renderer closed.

Source
closed?

Returns true if this IO is closed.

IO defines returns false, but including types may override.

Source
feed(chunk : String) : Nil

Accepts the next chunk of Markdown. May be any size -- a single byte up to the entire document. Raises if called after #close.

Source
read(slice : Bytes) : Int32

Renderer is write-only; reading always raises.

Source
reset

Flushes any buffered content AND resets the renderer, closing off any block/list/blockquote/table states. The ensure is what makes the Started/Finished pairing a guarantee rather than an intention: it covers close, an early reset, and an exception raised mid-table.

Source
stylesheet
Source
write(slice : Bytes) : Nil

-- IO abstract interface --------------------------------------------- Decodes slice as UTF-8 Markdown and feeds it into the renderer. Caller guarantees valid UTF-8.

Source