Struct roff::Roff [−][src]
pub struct Roff { /* fields omitted */ }
Expand description
A ROFF document, consisting of lines.
Lines are either control lines (requests that are built in, or invocations of macros), or text lines.
Example
let doc = Roff::new()
.control("TH", ["FOO", "1"])
.control("SH", ["NAME"])
.text([roman("foo - do a foo thing")])
.render();
assert!(doc.ends_with(".TH FOO 1\n.SH NAME\nfoo \\- do a foo thing\n"));
Implementations
Append a control line.
The line consist of the name of a built-in command or macro, and some number of arguments. Arguments that contain spaces will be enclosed with double quotation marks.
Append a text line.
The line will be rendered in a way that ensures it can’t be
interpreted as a control line. The caller does not need to
ensure, for example, that the line doesn’t start with a
period (“.
”) or an apostrophe (“'
”).
Render as ROFF source text that can be fed to a ROFF implementation.
Render without handling apostrophes specially.
You probably want render
or
to_writer
instead of this method.
Without special handling, apostrophes get typeset as right single quotes, including in words like “don’t”. In most situations, such as in manual pages, that’s unwanted. The other methods handle apostrophes specially to prevent it, but for completeness, and for testing, this method is provided to avoid it.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more