Skip to main content

Module structured

Module structured 

Source
Expand description

Read-only structured export of PPTX content: slides in deck order, each with its shape tree, text stories, tables and placeholders for content the export cannot represent, every record carrying the location it was read from, plus diagnostics for everything omitted. render_pptx_markdown renders the same content as Markdown.

One walker reads every source: a live session (DeckSession::export_structured) and PPTX bytes (export_pptx_structured), which open a private session first.

Reading order is the current shape tree, depth first: slides in deck order, shapes in their tree order, a group’s descendants at the group’s position, and table cells row by row. It is the authored order, not a visual or accessibility reading order inferred from geometry.

Structs§

CellPosition
ExportComment
ExportDiagnostic
ExportFailure
Why an export was refused, as data. target is the anchor the refusal concerns, if any.
ExportLink
A click hyperlink: an external URL, or the internal part it jumps to.
ExportNotes
A slide’s speaker notes, as plain text.
ExportObject
A placeholder for content the export does not represent; its data is never included.
ExportParagraph
ExportPlaceholder
ExportRead
Content read from a session together with the version it was read at.
ExportRefusal
A session export refusal; the deck is at version.
ExportRun
A run of one kind and formatting. Line breaks are one \n unit and fields cover their cached result; an unsupported inline is zero-width.
ExportShape
A shape, group or unrepresented shape-tree element, with its stories, table, placeholder object and children.
ExportSlide
ExportStory
One text story; anchor spans all of it.
ExportTable
A table on its grid. Every source cell appears once; merged marks a continuation covered by the cell at merge_origin, whose content PowerPoint does not show.
ExportTableCell
ExportTableRow
IncludedContent
The optional content an export was asked to include.
MarkdownAnchor
PptxExportOptions
What to export. Hidden slides and shapes, notes and comments are excluded unless requested; formatting is included unless turned off.
PptxMarkdownContent
Markdown rendered from structured content. Each <!-- pptx-export:N --> marker precedes the record anchors maps it to. Markdown keeps no slide layout, geometry or typography.
PptxMarkdownOptions
PptxStructuredContent
A structured export. Ids are deterministic export-tree paths, not document identities.
SourceProvenance
The retained source XML a record was seeded from. path holds element-child ordinals from the part’s root; sld_id is the owning slide’s p:sldId/@id and source_id a shape’s cNvPr/@id.
TextSpan
A half-open range of UTF-16 offsets.

Enums§

AnchorScope
Whether anchors resolve against a live session version or only against the returned snapshot.
ExportDiagnosticCode
ExportError
Why a bytes export produced nothing.
ExportFailureCode
Why an export was refused: options out of range (InvalidOptions), above a hard maximum (LimitExceeded), or structured content handed to the renderer that contradicts itself (InvalidContent). Unsupported deck content is diagnosed, never refused.
ExportList
ExportMark
ExportObjectKind
ExportRunKind
ExportSeverity
ExportShapeKind
PptxAnchor
Where a record was read from. range anchors are TextTarget::Range batch targets in the story offsets of DeckSession::read_content; notes and comment ranges index the plain text they carry; sourcePart addresses retained XML by element-child ordinals from the part’s root.
ReadingOrder
The order records are exported in; see the module documentation.

Constants§

DEFAULT_MAX_BLOCKS
Blocks an export returns when the options name no limit.
DEFAULT_MAX_BYTES
Serialized bytes an export or rendering returns when the options name no limit.
MAX_BLOCKS_LIMIT
The largest block limit an export accepts.
MAX_BYTES_LIMIT
The largest byte limit an export or rendering accepts.
MIN_BYTES_LIMIT
The smallest byte limit an export or rendering accepts: room for the envelope and one truncation diagnostic.
SCHEMA_VERSION
The only structured-content schema version this crate reads and writes.

Functions§

export_outcome_json
JSON of a session export: {"ok":true,"version","content"} or {"ok":false,"version","failure"}.
export_pptx_markdown
export_pptx_structured rendered as Markdown.
export_pptx_structured
Exports PPTX bytes as a snapshot: anchors address the returned content only.
render_pptx_markdown
Renders content as Markdown within options.max_bytes, stopping at a block boundary.
snapshot_outcome_json
JSON of a bytes export or rendering: {"ok":true,"content"} or {"ok":false,"failure"}. Err is the message for input that is not a readable PPTX.

Type Aliases§

PptxExportResult
A session export: the content with its version, or a refusal.