Skip to main content

Module extract

Module extract 

Source
Expand description

The Extractor trait and the registry that maps a Format onto one.

Extraction is the single impure edge of the core: it reads files and parses them into a Document. Everything downstream (render, chunk) is pure.

Modules§

container
ZIP container access — OOXML, ODF and EPUB are all ZIP archives of XML.
csv
CSV extractor — one table, the first record as its header.
epub
EPUB extractor — the spine’s XHTML documents, in reading order.
html
HTML extractor — a real HTML5 parse (html5ever), then a walk into the model.
markdown
Markdown extractor — normalises Markdown through the Document model.
odf
OpenDocument text and presentations (.odt, .odp).
ooxml
OOXML extractors — docx and pptx, plus the parts they share.
pdf
PDF extractor — born-digital text, reconstructed from glyph positions.
rtf
RTF extractor — a small reader for the parts of RTF that carry text.
spreadsheet
Spreadsheets (.xlsx, .ods) via calamine — one heading and one table per sheet.
text
Plain-text extractor — blank-line separated paragraphs.
xml
A tiny XML tree, shared by the OOXML and ODF extractors.

Structs§

ExtractOpts
Options that influence extraction.
PageRange
A --pages selection: 1-10, 3, 2-.

Traits§

Extractor
Anything that can turn a file of some format into a Document.

Functions§

extract_path
Detect the format of path and extract it.
for_format
Pick the extractor for a format, if one exists yet.