Guidedog 설명서 1.0.0-beta.16
언어
이 페이지의 내용
Guidedog / 문서 1.0.0-beta.16

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::renderer() -> Renderer

Returns RENDERER, the plain-text renderer descriptor.

pub fn guidedoc_text::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).

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_OMITTED: Message

Raw text the policy leaves out.

pub const guidedoc_text::RAW_FORMAT: Message

Raw content for another format, which plain text cannot show.

pub const guidedoc_text::UNRESOLVED: Message

A reference that leads nowhere.

pub const guidedoc_text::EXPANSION: Message

Substitutions expanding through more than Limits::max_expansion levels.

pub const guidedoc_text::DEPTH_LIMIT: Message

Content nested deeper than the renderer’s recursion allows.