Module

docs.models

Frozen dataclasses for the docs module.

All types are immutable and thread-safe.DocPageis the universal unit — hand-written markdown and autodoc-generated pages share the same type so the collection, search, templates, and tools treat them identically.

Classes

DocSource 0
Where a ``DocPage`` originated.

Where aDocPageoriginated.

TocEntry 3
A single heading extracted from rendered HTML.

A single heading extracted from rendered HTML.

Attributes

Name Type Description
level int
id str
text str
DocBlock 5
One section of a doc page, split at an H2 (or H3) boundary. ``id`` is a snake_case identifier suit…

One section of a doc page, split at an H2 (or H3) boundary.

idis a snake_case identifier suitable for a kida block name (section_<id>). anchoris the original kebab-case heading id preserved for URL fragments (#section-overview). Content before the first heading becomes a synthesizedintroblock with depth=0.

Attributes

Name Type Description
id str
heading str
html Markup
depth int
anchor str
DocMetadata 5
Frontmatter fields parsed from a markdown file header.

Frontmatter fields parsed from a markdown file header.

Attributes

Name Type Description
order int
category str
tags frozenset[str]
description str
draft bool
DocPage 9
One documentation page — the universal unit of the docs module. Both hand-written markdown files a…

One documentation page — the universal unit of the docs module.

Both hand-written markdown files and autodoc-generated reference pages produceDocPageinstances. Templates, search, and tools operate on this type exclusively.

Attributes

Name Type Description
slug str
title str
raw str
html Markup
toc tuple[TocEntry, ...]
metadata DocMetadata
source DocSource
source_path Path | None
blocks tuple[DocBlock, ...]
NavGroup 3
A group of pages for sidebar navigation. When a category directory contains an index file (``index…

A group of pages for sidebar navigation.

When a category directory contains an index file (index.md, _index.md, or README.md), it becomes the landing_page and the category heading links to it.

Attributes

Name Type Description
category str
pages tuple[DocPage, ...]
landing_page DocPage | None
ParamDoc 5
One parameter in a route or tool signature.

One parameter in a route or tool signature.

Attributes

Name Type Description
name str
type_str str
required bool
description str
default str | None
RouteDoc 7
Autodoc-generated from a single ``Route``.

Autodoc-generated from a singleRoute.

Attributes

Name Type Description
path str
methods frozenset[str]
handler_name str
docstring str | None
parameters tuple[ParamDoc, ...]
template str | None
layout_chain tuple[str, ...] | None
ToolDoc 4
Autodoc-generated from a single registered tool.

Autodoc-generated from a single registered tool.

Attributes

Name Type Description
name str
description str
input_schema dict[str, Any]
parameters tuple[ParamDoc, ...]