Guidedog 설명서 0.2.0
언어
이 페이지의 내용
Guidedog / 문서 0.2.0

render/html

Package html renders a Guidedoc document as HTML without calling an allocator. The default output is semantic HTML with anchors, notes, and tables; the reference profile reproduces the CommonMark reference renderer byte for byte for conformance tests. Raw content and unsafe URLs are governed by the conversion policy.

Procedures

html.render :: proc(ctx: ^gd.Render_Context) -> gd.Status

render writes ctx.view as HTML through ctx.out: a whole page when ctx.options.standalone, else a fragment, and the CommonMark reference renderer’s bytes when ctx.options.reference_profile. It borrows the context for the call and keeps nothing; its scratch is released before it returns. Problems go to ctx.reports; the result is .Ok, the status of the first error (a raw block or URL the policy refuses, an unresolved reference, nesting past the limits), or .Capacity when scratch runs out.

html.renderer :: proc() -> gd.Renderer

renderer returns the “html” renderer descriptor, for a gd.Registry. It is a value with no state: registering it twice or copying it is harmless.

Constants

html.CONFORMANCE :: gd.Conformance.Partial
html.VERSION :: "0.1.0"