guidedoc_html¶
The HTML renderer of Guidedoc. The default output is semantic HTML with anchors, notes, and tables, in the element structure Docutils” and Sphinx’s HTML writers use; the reference profile (RenderOptions::reference_profile) reproduces the CommonMark reference renderer byte for byte, for conformance tests. Raw content and unsafe URLs are governed by the conversion policy.
use guidedoc::Registry;
let registry = Registry { renderers: vec![guidedoc_html::RENDERER], ..Registry::default() };
assert!(registry.find_renderer("html").is_some());
Re-exports
- pub use guidedoc::MATHML_ATTRIBUTES
- pub use guidedoc::MATHML_ELEMENTS
- pub use guidedoc::MAX_MATHML_BYTES
- pub use guidedoc::MAX_MATHML_DEPTH
- pub use guidedoc::MathMlDropped
- pub use guidedoc::MathMlError
- pub use guidedoc::MathMlOptions
- pub use guidedoc::filter_mathml
Functions
- pub fn guidedoc_html::render(ctx: &mut RenderContext<'_>) -> Result<(), Fail>¶
-
Writes
ctx.docas HTML throughctx.out: a whole page whenctx.options.standalone, else a fragment, and the CommonMark reference renderer’s bytes whenctx.options.reference_profile. It borrows the context for the call and keeps only its working storage, in the context’s scratch store. Problems go to the context’s reports; the render fails with the status of the first error: raw content or a URL the policy refuses (Policy), an unresolved reference (InvalidInput), or nesting past the limits (Limit).
Constants
- pub const guidedoc_html::SOURCE_ATTRIBUTE: &str = "data-gd-source"¶
-
The attribute that carries a block’s source span.
- pub const guidedoc_html::VERSION: &str = env!("CARGO_PKG_VERSION")¶
-
The renderer’s version: the project version every crate inherits.
- pub const guidedoc_html::CONFORMANCE: Conformance = Conformance::Partial¶
-
How completely the renderer implements HTML output.
- pub const guidedoc_html::RENDERER: Renderer¶
-
The «html» renderer descriptor, for a
guidedoc::Registry. It is a value with no state: registering a copy is harmless.
- pub const guidedoc_html::RAW_REFUSED: Message¶
-
Raw content the policy refuses;
{0}names its format.
- pub const guidedoc_html::RAW_FORMAT: Message¶
-
Raw content for another format, which HTML cannot show.
- pub const guidedoc_html::URL_UNSAFE: Message¶
-
A link target whose scheme can run code, refused by the policy.
- pub const guidedoc_html::URL_OMITTED: Message¶
-
A link target whose scheme can run code, left out by the policy.
- pub const guidedoc_html::MATHML_DROPPED: Message¶
-
MathML an author wrote, with parts outside MathML Core left out.