Header menu logo Nao

Nao.Documents Namespace

Type/Module Description

Align

Alignment / distribution along a layout axis. A superset that covers both the "self alignment" and "content distribution" cases of flex and grid.

Block

Block-level content node. The body of a document is built from these.

Body

 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.

Border

A box border specification.

BorderStyle

How a box border is drawn.

BoxStyle

Block / box-level visual styling: background, spacing, sizing and border. All fields optional for the same inherit-by-default reason as `TextStyle`.

Color

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.

ContainerSpec

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.

ConversionContext

Context threaded through a conversion: where to extract/read resources, plus a free-form options bag (target DPI, image policy, page size overrides, ...).

Converter

Top-level conversion helpers over a `ConverterRegistry`.

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`.

D

DirectoryResourceStore

A filesystem-backed resource store rooted at a bundle directory. Extracted bytes are written under `/resources/` and de-duplicated by SHA-256 so identical media is stored once.

Doc

Convenience constructors for inline and block content.

Document (Module)

Document (Type)

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`.

DocumentMetadata

Descriptive metadata about a document.

Docx

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.

Edges

Spacing applied to the four sides of a box (used for margin and padding).

FlexDirection

Main-axis direction of a flex container.

FlexOptions

Options for a flexbox-style (1-D) container.

FlexWrap

Wrapping behaviour of a flex container.

FontStyleKind

Upright vs slanted text.

FontWeight

Font weight, mapped by writers to the closest value a target format supports.

Formats

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.

GridOptions

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.

Html

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.

IDocumentReader

Parses a concrete format INTO the unified `Document`.

IDocumentWriter

Serializes the unified `Document` INTO a concrete format.

Inline

Inline-level content — a run that lives inside a paragraph, heading or table cell.

IResourceStore

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.

Layout

How a container arranges its children.

LayoutChild

A child of a container, pairing its content with placement hints.

Length

A scalar measurement paired with its unit.

ListItem

A single list item, which may contain arbitrary nested blocks.

ListSpec

An ordered or unordered list.

Markdown

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.

MediaSpec

A block-level media embed.

NullResourceStore

A resource store that discards bytes and never returns any. Useful for conversions where media should be ignored or referenced by URI only.

P

Page

A single fixed page (or slide) in a paginated document.

PageOrientation

Page orientation for paginated formats.

PageSetup

Physical page setup used by paginated formats (pdf / word / ppt).

Pdf

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.

Placement

Per-child placement hints, interpreted according to the parent `Layout`. Fields irrelevant to the active layout are simply ignored.

PlainText

Reader and writer for `text/plain`. The plain-text form is the lowest common denominator: structure is flattened to lines, media becomes alt text.

Point

A 2-D point expressed in document units.

Pptx

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.

Rect

An axis-aligned rectangle used for absolute positioning.

Resource

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.

ResourceId

Stable identifier for an extracted media/binary resource within a document.

ResourceKind

The broad category of a referenced asset.

S

Size

A width/height pair expressed in document units.

TableCell

A table cell holding nested blocks, with optional spans and styling.

TableColumn

Column-level sizing / alignment hints.

TableRow

A table row.

TableSpec

A table with optional header row and per-column hints.

TextAlign

Horizontal text alignment within a block.

TextDecoration

A line decoration applied to a run of text.

TextStyle

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.

Unit

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.

W

Xlsx

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).

Type something to start searching.