guidedoc_text¶
The plain-text renderer of Guidedoc, following the conventions of Sphinx’s text builder: paragraphs wrapped at 70 columns, titles underlined with * = - ~ and the other section characters, * and 1. list markers with hanging indents, definitions and literal blocks indented by three spaces, grid tables drawn with +---+ borders, and Note: admonitions.
use guidedoc::Registry;
let registry = Registry { renderers: vec![guidedoc_text::RENDERER], ..Registry::default() };
assert!(registry.find_renderer("text").is_some());
Functions
- pub fn guidedoc_text::render(ctx: &mut RenderContext<'_>) -> Result<(), Fail>¶
-
Writes
ctx.docas plain text throughctx.out. 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 the policy refuses (Policy), an unresolved reference (InvalidInput), or nesting past the limits (Limit).
Constants
- pub const guidedoc_text::VERSION: &str = env!("CARGO_PKG_VERSION")¶
-
The renderer’s version: the project version every crate inherits.
- pub const guidedoc_text::CONFORMANCE: Conformance = Conformance::Partial¶
-
How completely the renderer implements plain-text output.
- pub const guidedoc_text::RENDERER: Renderer¶
-
The «text» renderer descriptor, for a
guidedoc::Registry. It is a value with no state: registering a copy is harmless.
- pub const guidedoc_text::RAW_REFUSED: Message¶
-
Raw content the policy refuses;
{0}names its format.
- pub const guidedoc_text::RAW_FORMAT: Message¶
-
Raw content for another format, which plain text cannot show.