Nao.Documents Namespace
| Type/Module | Description |
|
Alignment / distribution along a layout axis. A superset that covers both the "self alignment" and "content distribution" cases of flex and grid. |
|
|
Block-level content node. The body of a document is built from these. |
|
The document body: the single switch between the two fundamental document shapes. * `Fluid` — reflowable content (text / markdown / html). Paginated *targets* auto-break it into pages using `Document.DefaultPage`. * `Paged` — fixed pages / slides (pdf / word-as-laid-out / ppt). Fluid *targets* flatten the pages back into a single content stream. |
|
|
A box border specification. |
|
|
How a box border is drawn. |
|
|
Block / box-level visual styling: background, spacing, sizing and border. All fields optional for the same inherit-by-default reason as `TextStyle`. |
|
|
An sRGB color stored as a hex string: "#RRGGBB" or "#RRGGBBAA". Kept as a string (rather than packed ints) so the model serializes cleanly and stays format-agnostic; consumers parse it however they like. |
|
|
A layout container: a box with a `Layout` and a list of placed children. This is how grid / flex / absolute positioning enters the document tree. |
|
|
Context threaded through a conversion: where to extract/read resources, plus a free-form options bag (target DPI, image policy, page size overrides, ...). |
|
|
Top-level conversion helpers over a `ConverterRegistry`. |
|
|
A registry of format readers and writers, keyed by media type. This is the entry point for "A → unified → B": register one `IDocumentReader` and one `IDocumentWriter` per format, then call `Convert`. |
|
|
|
|
|
A filesystem-backed resource store rooted at a bundle directory. Extracted bytes
are written under ` |
|
|
Convenience constructors for inline and block content. |
|
|
|
|
|
The unified intermediate representation (the "middleware" format). Every concrete file format converts to and from this single model, so the converter only needs an A→`Document` reader and a `Document`→B writer for each format, and any A→B conversion is `read >> write`. |
|
|
Descriptive metadata about a document. |
|
|
Reader and writer for Word documents (`.docx`, `application/vnd.openxmlformats-officedocument.wordprocessingml.document`), backed by the DocumentFormat.OpenXml SDK. The SDK owns the package, content-types and relationships, so there is no hand-written ZIP/XML plumbing to maintain. |
|
|
Spacing applied to the four sides of a box (used for margin and padding). |
|
|
Main-axis direction of a flex container. |
|
|
Options for a flexbox-style (1-D) container. |
|
|
Wrapping behaviour of a flex container. |
|
|
Upright vs slanted text. |
|
|
Font weight, mapped by writers to the closest value a target format supports. |
|
|
A `ConverterRegistry` preconfigured with every built-in format, so any supported A → unified → B conversion works out of the box. Readable: text, markdown, html, docx. Writable: text, markdown, html, docx, pdf, xlsx, pptx. |
|
|
Options for a 2-D grid container. Tracks are sized with `Length` values where `Fr` means a fraction of the free space and `Auto` means content-sized. |
|
|
Reader and writer for `text/html`. HTML is a *fluid* format like Markdown, but richer: it carries inline styling (bold/italic/underline, colour), links, images, lists, tables, code and block quotes. The writer emits a small, clean document; the reader parses a pragmatic subset of common block and inline elements. |
|
|
Parses a concrete format INTO the unified `Document`. |
|
|
Serializes the unified `Document` INTO a concrete format. |
|
|
Inline-level content — a run that lives inside a paragraph, heading or table cell. |
|
|
Persists extracted binary resources to local storage. Readers call `Save` to extract embedded media out of a source document and get back a relative path to reference from a `Resource`; writers call `TryOpen` to read the bytes back when they need to embed or copy them into the target. |
|
|
How a container arranges its children. |
|
|
A child of a container, pairing its content with placement hints. |
|
|
A scalar measurement paired with its unit. |
|
|
A single list item, which may contain arbitrary nested blocks. |
|
|
An ordered or unordered list. |
|
|
Reader and writer for `text/markdown` (CommonMark-ish subset). Markdown is the canonical *fluid* format, so it exercises headings, lists, code, quotes, tables, emphasis, links and images of the unified model. |
|
|
A block-level media embed. |
|
|
A resource store that discards bytes and never returns any. Useful for conversions where media should be ignored or referenced by URI only. |
|
|
|
|
|
A single fixed page (or slide) in a paginated document. |
|
|
Page orientation for paginated formats. |
|
|
Physical page setup used by paginated formats (pdf / word / ppt). |
|
|
Writer for `application/pdf`, backed by PDFsharp/MigraDoc. The unified document model is mapped onto a MigraDoc document (sections, paragraphs, tables) and rendered to a real PDF — MigraDoc owns layout, pagination and the low-level PDF object graph, so there is no hand-rolled PDF serialization to maintain. There is intentionally no PDF *reader*: parsing arbitrary PDF back into structured content is out of scope. |
|
|
Per-child placement hints, interpreted according to the parent `Layout`. Fields irrelevant to the active layout are simply ignored. |
|
|
Reader and writer for `text/plain`. The plain-text form is the lowest common denominator: structure is flattened to lines, media becomes alt text. |
|
|
A 2-D point expressed in document units. |
|
|
Writer for PowerPoint decks (`.pptx`, `application/vnd.openxmlformats-officedocument.presentationml.presentation`), backed by the DocumentFormat.OpenXml SDK. Slides are derived from the document; the SDK owns the package, content-types and relationships. There is no reader. |
|
|
An axis-aligned rectangle used for absolute positioning. |
|
|
A media / binary asset referenced by the document body. To keep the unified document small and portable, binary bytes are NOT inlined. Instead a reader extracts them to local storage (via `IResourceStore`) and records a relative `LocalPath` here; the body references the asset by `Id`. The consumer decides whether and how to load the bytes. |
|
|
Stable identifier for an extracted media/binary resource within a document. |
|
|
The broad category of a referenced asset. |
|
|
|
|
|
A width/height pair expressed in document units. |
|
|
A table cell holding nested blocks, with optional spans and styling. |
|
|
Column-level sizing / alignment hints. |
|
|
A table row. |
|
|
A table with optional header row and per-column hints. |
|
|
Horizontal text alignment within a block. |
|
|
A line decoration applied to a run of text. |
|
|
Character-level styling for a run of text. Every field is optional so a run can inherit from its context and writers only emit what is explicitly set. |
|
|
Measurement unit for a length in the unified document model. Fluid formats (markdown/html/text) lean on `Px`/`Percent`/`Em`; paginated formats (pdf/word/ppt) lean on `Pt`. `Fr` and `Auto` exist for grid tracks. |
|
|
|
|
|
Writer for Excel workbooks (`.xlsx`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`), backed by the DocumentFormat.OpenXml SDK. The document is flattened to rows on a single worksheet. There is no reader (spreadsheets are not a natural source for the prose model). |
Nao