guidedoc_text ============= .. rust:crate:: guidedoc_text :synopsis: 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. 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. .. code-block:: rust use guidedoc::Registry; let registry = Registry { renderers: vec![guidedoc_text::RENDERER], ..Registry::default() }; assert!(registry.find_renderer("text").is_some()); .. rubric:: Functions .. rust:function:: pub fn renderer() -> Renderer Returns ``RENDERER``, the plain-text renderer descriptor. .. rust:function:: pub fn render(ctx: &mut RenderContext<'_>) -> Result<(), Fail> Writes ``ctx.doc`` as plain text through ``ctx.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``). .. rubric:: Constants .. rust:const:: pub const VERSION: &str = env!("CARGO_PKG_VERSION") The renderer's version: the project version every crate inherits. .. rust:const:: pub const CONFORMANCE: Conformance = Conformance::Partial How completely the renderer implements plain-text output. .. rust:const:: pub const RENDERER: Renderer The "text" renderer descriptor, for a ``guidedoc::Registry``. It is a value with no state: registering a copy is harmless. .. rust:const:: pub const RAW_REFUSED: Message Raw content the policy refuses; ``{0}`` names its format. .. rust:const:: pub const RAW_OMITTED: Message Raw text the policy leaves out. .. rust:const:: pub const RAW_FORMAT: Message Raw content for another format, which plain text cannot show. .. rust:const:: pub const UNRESOLVED: Message A reference that leads nowhere. .. rust:const:: pub const EXPANSION: Message Substitutions expanding through more than ``Limits::max_expansion`` levels. .. rust:const:: pub const DEPTH_LIMIT: Message Content nested deeper than the renderer's recursion allows.