Skip to main content

Crate docgen_render

Crate docgen_render 

Source

Structs§

DiffContext
Everything the /diff/ workspace shell render needs. The diff data itself is not templated — it ships as timeline.json + revisions/<id>.json and is hydrated client-side by islands/diff.js into #docgen-diff-root.
FileView
One changed file within a timeline point.
GraphContext
Everything the /graph/ page render needs. graph_json is the serialized GraphData embedded verbatim into a <script type="application/json"> tag.
HistoryContext
Everything the history page render needs.
HomeData
The home dashboard payload. PageContext.home is Some only for the index doc; every other page passes None (and the template skips the dashboard).
HomeRecent
One row in the home dashboard’s “Recent” list.
HomeSection
One section card on the home dashboard: a top-level folder (“section”), the number of docs in it, and a link to its first page. Mirrors the original home’s sectionCards.
HunkView
A contiguous diff hunk (run of lines).
LineView
One diff line, render-friendly. kind/line numbers are pre-stringified by the caller so docgen-render stays free of the docgen-diff domain types.
PageContext
Everything a single page render needs.
PreviewContext
Everything the editor’s live-preview document render needs. The body is the already-rendered inner HTML (run through the same per-doc pipeline as a build); the flags gate the same conditional asset links a published page uses.
Renderer
Owns a configured minijinja environment with the page template registered.
TimelineBucketView
A labelled bucket of timeline points (e.g. “Today”).
TimelinePointView
One commit in the timeline (render-friendly projection of a DocDiffTimelinePoint).

Constants§

DEFAULT_DIFF_TEMPLATE
The built-in /diff/ workspace shell template, embedded at compile time. The page is a mount point (#docgen-diff-root) hydrated by islands/diff.js from the build-time timeline.json + revisions/<id>.json payloads.
DEFAULT_GRAPH_TEMPLATE
The built-in /graph/ doc-link-graph template, embedded at compile time.
DEFAULT_HISTORY_TEMPLATE
The built-in per-doc history-timeline template, embedded at compile time.
DEFAULT_PAGE_TEMPLATE
The built-in page template, embedded at compile time.
DEFAULT_PREVIEW_TEMPLATE
The dev editor’s live-preview document template, embedded at compile time. Content-only (no app chrome): the rendered article wrapped in the SAME asset and island stack a published page uses, so a doc previewed in the editor renders identically to its built page (mermaid, components, tooltips, math).
SEARCH_JSDeprecated
The vendored search client script, emitted to dist/search.js.