pub struct PlainTextExportOptions {
pub quote_indent: bool,
pub page_breaks: bool,
pub strip_images: bool,
pub endnote_footnotes: bool,
pub line_breaks: bool,
}Fields§
§quote_indent: boolIndent blockquoted blocks four spaces per level, so quoted matter still reads as set-off in a format with no markup to say so.
page_breaks: boolEmit FORM_FEED before a block that asks to start a new page.
strip_images: boolDrop the U+FFFC that stands for an inline image.
Presentation only. A written-out .txt has no way to show a picture,
and the raw sentinel renders as an unmarked box — but it is also one
character of the document, so removing it shifts every offset after it.
Anything that addresses the text by position (a cursor, a search hit, a
comment’s anchor) must therefore leave it in, which is exactly the
difference between Self::addressable and Self::presentation.
endnote_footnotes: boolLift footnotes out of the flow and list them, numbered, at the end.
Presentation only, and for exactly the reason strip_images is. A
note’s body is real content in the document, sitting in the rope where
its definition was written, and the addressable view has to agree with
the document character for character. Moving those blocks to the end —
or worse, printing them twice — puts every offset after them wrong,
which is every search hit and every comment anchor below the note.
A written-out .txt has no page to put a footnote at the foot of, so
the endnote list is what a manuscript printed without markup has always
done.
line_breaks: boolWrite each line break inside a block (LINE_SEPARATOR)
as a \n, so the lines of a stanza or a letter are lines of the file.
Presentation only. It changes no offset, a line break and a \n being one
character each, but the addressable view is the document’s own text, and there a
\n is what separates two blocks: a search or a replace reading it back could not
tell a line from a paragraph.
Implementations§
Source§impl PlainTextExportOptions
impl PlainTextExportOptions
Sourcepub const fn addressable() -> Self
pub const fn addressable() -> Self
Nothing added — the addressable view, pinned to the document’s own search text. Offsets into it are offsets into the document, character for character.
Sourcepub const fn presentation() -> Self
pub const fn presentation() -> Self
Everything a written-out .txt wants.