PseudoScript
Module

doc

component

Assets #

private
doc::Assets

Ships the prebuilt presentation bundles, authored in the `web/` Svelte package and embedded at build time (LANG.md §9.3). `style.css`, `client.js`, and `universe.js` ship once at the site root; `ssr.js` is build-time only — the engine (`Doc::Ssr`) evaluates it and it is never written to the site. The universe bundle is the only one that carries WebGL; the SSR bundle never does.

Parent

Inbound

Outbound

Scenarios

SharedAssetsShipOnce

Shared assets ship once and every page links them.

  • given a multi-page site
  • when it is generated
  • then style.css and client.js are emitted once at the site root
  • and every page links them by a depth-relative path rather than inlining them
Flow Flow — SharedAssetsShipOnce scroll to zoom · drag to pan
FEATURESharedAssetsShipOncefor AssetsGIVENa multi-page siteWHENit is generatedTHENstyle.css and client.js are emittedonce at the site rootANDevery page links them by adepth-relative path rather thaninlining them
data

Call #

public
doc::Call
Entities Entity diagram scroll to zoom · drag to pan
RECORDCallmessagestring
data

Codec #

public
doc::Codec
Entities Entity diagram scroll to zoom · drag to pan
RECORDCodecmessagestring
data

Crumb #

public
doc::Crumb

One breadcrumb hop: its label and href; the trailing crumb (the current page) carries no href.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDCrumblabelstringhrefstring
data

DiagnosticInput #

public
doc::DiagnosticInput

One host-prepared diagnostic, positioned in its module's source: severity word (`error`/`warning`), the stable rule code and its principle-article URL (empty for plain diagnostics), the message, and the 1-based line/column with the byte span. The host computes line/column once — this crate never sees module sources.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDDiagnosticInputmodulestringseveritystringcodestringcodeUrlstringmessagestringlinenumbercolumnnumberstartnumberendnumber
data

Diagram #

public
doc::Diagram

A diagram figure. Every view — C4, sequence, data, feature — ships as deterministic server-rendered SVG, identical to `pds svg` (the client adds pan/zoom only); `kind` is the view word (`c4`/`sequence`/`entity`/`flow`) the figure exposes as its `data-diagram` hook. `Empty` marks a view that failed to project.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
UNIONDiagramSvgEmptyRECORDSvgcaptionstringeyebrowstringkindstringsvgstringRECORDEmptycaptionstringeyebrowstring
component

Diagrams #

private
doc::Diagrams

The bridge into `emit`: project a view into a `Scene` and render it to the same deterministic SVG `pds svg` emits, under the adaptive palette so the figure follows the site theme. A view that fails to project degrades to an `Empty` placeholder rather than aborting the build — the cargo-doc stance that a partial model still documents. The client adds pan/zoom around the figure; it never re-lays-out.

Parent

Inbound

Outbound

Scenarios

AllDiagramsServerRendered

Every diagram ships as deterministic server-rendered SVG.

  • given a node that anchors a C4 boundary, owns a triggered callable, or is a data type
  • when its page is rendered
  • then a system carries a container diagram and a container carries a component diagram
  • and each triggered callable carries its sequence diagram
  • and every figure is the same deterministic SVG pds svg emits, under the adaptive palette
  • but the client adds pan and zoom only — it never re-lays-out a diagram
Flow Flow — AllDiagramsServerRendered scroll to zoom · drag to pan
FEATUREAllDiagramsServerRenderedfor DiagramsGIVENa node that anchors a C4 boundary,owns a triggered callable, or is adata typeWHENits page is renderedTHENa system carries a container diagramand a container carries a componentdiagramANDeach triggered callable carries itssequence diagramANDevery figure is the same deterministicSVG pds svg emits, under the adaptivepaletteBUTthe client adds pan and zoom only — itnever re-lays-out a diagram
ProjectionFailureDegrades

A failed projection degrades to a placeholder rather than aborting.

  • given a view that fails to project with an EmitError
  • when the figure is built
  • then an Empty placeholder figure is produced in place of the diagram
  • but the build continues and the rest of the site still renders
Flow Flow — ProjectionFailureDegrades scroll to zoom · drag to pan
FEATUREProjectionFailureDegradesfor DiagramsGIVENa view that fails to project with anEmitErrorWHENthe figure is builtTHENan Empty placeholder figure isproduced in place of the diagramBUTthe build continues and the rest ofthe site still renders
container

Doc #

public
doc::Doc

`crates/pseudoscript-doc`. Turns a resolved graph into a Svelte-rendered, cargo-doc-style site that fully represents the system: each node's `///` docs and relationships on its page, every diagram as deterministic server-rendered SVG, the 3D universe with its flows, the architecture-health report, and a static full-text search index. Pure: returns in-memory files, the CLI writes.

#headline

Inbound

Outbound

Scenarios

GenerateDocSite

A partial model still documents.

#headline
  • given a resolved graph and the [doc] configuration
  • when the site is rendered
  • then an index, one page per module, and a section per node are produced
  • and the files are returned in memory, with no filesystem I/O
Flow Flow — GenerateDocSite scroll to zoom · drag to pan
FEATUREGenerateDocSitefor DocGIVENa resolved graph and the [doc]configurationWHENthe site is renderedTHENan index, one page per module, and asection per node are producedANDthe files are returned in memory, withno filesystem I/O
Components Component diagram scroll to zoom · drag to pan
PseudoscriptDocCOMPONENTSiteBuilderOrchestrates the whole site: build the URLmap, project each page's props, server…COMPONENTPagesProjects the resolved graph into per-page`PageProps` — pure data, no markup. Builds…COMPONENTSsrThe server-side render boundary: aJSON-string-in / JSON-string-out seam to th…COMPONENTShellOwns the document shell that wraps eachserver-rendered body — the part Rust…COMPONENTRelationshipsRenders a node's relationships (LANG.md§9.3): its `for`/owner parent, inbound…COMPONENTScenariosRenders the BDD scenario cards on a node'spage: each `feature` targeting the node…COMPONENTDiagramsThe bridge into `emit`: project a view intoa `Scene` and render it to the same…COMPONENTHealthPositions the host's diagnostics in thedocumentation: prepares raw per-module…COMPONENTSearchIndexBuilds the static full-text search index theclient palette queries: one record per…COMPONENTHighlightHighlights fenced code blocks at build time,so the shipped site needs no client…COMPONENTUrlsMaps every node FQN to its page path andanchor, and resolves cross-references to…COMPONENTAssetsShips the prebuilt presentation bundles,authored in the `web/` Svelte package and…COMPONENTEscapeAll user text — node names, `///` docs,tags, the site title — is carried raw in th…COMPONENTMarkdownRenders an authored `[[doc.sidebar]]` page'sMarkdown source into the HTML that fills it…COMPONENTMarkdownSiteThe static Markdown output mode: turns thesame per-page props the HTML renderer…CONTAINERCli`crates/pseudoscript` — the binary crate(`pds`). The composition root and only I/O…CONTAINEREmit`crates/pseudoscript-emit`. Projects a viewinto a `Scene` and renders it to SVG; C4…CONTAINERIdeSession`crates/pseudoscript-ide` — the IDEapplication, Rust compiled to a single wasm…CONTAINERUniverse`crates/pseudoscript-universe`. Maps theresolved C4 model into the software graph…projectcontextforNodebadgesForpagerendergroupscardsflowsfromModelsnapshothrefToflowstextsharedhealthPageindexsortedModulesuniversePagebuildwraprenderPagebuildbuildflowssnapshotproject
data

DocBody #

public
doc::DocBody
Entities Entity diagram scroll to zoom · drag to pan
RECORDDocBodytitlestringhtmlstring
data

DocConfig #

public
doc::DocConfig

Site presentation, filled by the CLI from the `[doc]` table of `pds.toml`. `[doc]` tunes presentation only, never what is documented.

Entities Entity diagram scroll to zoom · drag to pan
RECORDDocConfignamestringthemedoc::Themelogostringdocsdoc::DocGroup[]UNIONThemeLightDarkSystemRECORDDocGrouptitlestringpagesdoc::DocPage[]
data

DocGroup #

public
doc::DocGroup

One `[[doc.sidebar]]` group of authored Markdown pages: a heading and its ordered pages, rendered above the auto-generated module tree.

Entities Entity diagram scroll to zoom · drag to pan
RECORDDocGrouptitlestringpagesdoc::DocPage[]RECORDDocPagetitlestringpathstringmarkdownstring
data

DocPage #

public
doc::DocPage

One authored Markdown page: its sidebar title, the source path (relative to `pds.toml`) from which the host and this crate derive the same stable slug, and the raw Markdown the host has already loaded, rendered to HTML at build time. The crate reads `markdown`; `path` only names the page, never loads it.

Entities Entity diagram scroll to zoom · drag to pan
RECORDDocPagetitlestringpathstringmarkdownstring
data

Empty #

public
doc::Empty
Entities Entity diagram scroll to zoom · drag to pan
RECORDEmptycaptionstringeyebrowstring
data

Engine #

public
doc::Engine
Entities Entity diagram scroll to zoom · drag to pan
RECORDEnginemessagestring
component

Escape #

private
doc::Escape

All user text — node names, `///` docs, tags, the site title — is carried raw in the props and escaped on interpolation by the renderer; this escaper guards the Rust-owned document shell, where the title and theme become HTML attributes.

Parent

Inbound

Outbound

  • from doc::string

Scenarios

EscapeDocumentText

Document attributes are HTML-escaped; content is escaped by the renderer.

  • given a site title containing HTML-significant characters
  • when the document shell is assembled
  • then the five significant characters are escaped in the document attributes
  • but page content text is carried raw and escaped by the renderer on interpolation
Flow Flow — EscapeDocumentText scroll to zoom · drag to pan
FEATUREEscapeDocumentTextfor EscapeGIVENa site title containingHTML-significant charactersWHENthe document shell is assembledTHENthe five significant characters areescaped in the document attributesBUTpage content text is carried raw andescaped by the renderer oninterpolation
component

Health #

private
doc::Health

Positions the host's diagnostics in the documentation: prepares raw per-module findings (line/column from sources), attributes each to the node whose section it belongs on, and builds the health page and the per-section badges. Attribution is positional: the node whose declaration starts closest before the diagnostic's span owns it, a callable lifting to its owner; a span no node encloses falls back to the module page.

Parent

Inbound

Outbound

Scenarios

HealthPageListsDiagnostics

The health page lists every finding; affected sections carry badges.

  • given host-prepared diagnostics including an architecture lint
  • when the site is rendered
  • then the health page lists each finding with severity, code, location, and its principle-article link
  • and each entry deep-links to the owning node's documentation section
  • and the affected section shows an inline badge
  • but a clean model renders an empty health page, not a missing one
Flow Flow — HealthPageListsDiagnostics scroll to zoom · drag to pan
FEATUREHealthPageListsDiagnosticsfor HealthGIVENhost-prepared diagnostics including anarchitecture lintWHENthe site is renderedTHENthe health page lists each findingwith severity, code, location, and itsprinciple-article linkANDeach entry deep-links to the owningnode's documentation sectionANDthe affected section shows an inlinebadgeBUTa clean model renders an empty healthpage, not a missing one
data

HealthEntry #

public
doc::HealthEntry

One architecture-health finding, attributed to the node whose section it belongs on: the diagnostic fields plus the owning node's FQN and the (prefixed) href to its section — the module page when no node encloses the span.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDHealthEntrymodulestringseveritystringcodestringcodeUrlstringmessagestringlinenumbercolumnnumbernodeFqnstringhrefstring
data

HealthPage #

public
doc::HealthPage
Entities Entity diagram scroll to zoom · drag to pan
RECORDHealthPageentriesdoc::HealthEntry[]errorCountnumberwarningCountnumberRECORDHealthEntrymodulestringseveritystringcodestringcodeUrlstringmessagestringlinenumbercolumnnumbernodeFqnstringhrefstring
component

Highlight #

private
doc::Highlight

Highlights fenced code blocks at build time, so the shipped site needs no client highlighter and one deterministic output serves every theme: PseudoScript through the toolchain's own lexer, emitting class-based spans coloured by the site stylesheet. Any other language passes through escaped and unhighlighted — an embedded grammar set for common languages is a deliberate future extension (it would bloat the IDE wasm today).

Parent

Scenarios

CodeBlocksHighlightedAtBuildTime

Code blocks are highlighted at build time.

  • given an authored doc page with fenced code blocks
  • when the page is rendered
  • then PseudoScript blocks highlight through the toolchain lexer
  • and output is class-based spans so one deterministic render serves every theme
  • but any other language passes through escaped and unhighlighted
Flow Flow — CodeBlocksHighlightedAtBuildTime scroll to zoom · drag to pan
FEATURECodeBlocksHighlightedAtBuildTimefor HighlightGIVENan authored doc page with fenced codeblocksWHENthe page is renderedTHENPseudoScript blocks highlight throughthe toolchain lexerANDoutput is class-based spans so onedeterministic render serves everythemeBUTany other language passes throughescaped and unhighlighted
data

IndexPage #

public
doc::IndexPage
Entities Entity diagram scroll to zoom · drag to pan
RECORDIndexPagetitlestringcontextDiagramdoc::Diagramcardsdoc::ModuleCard[]statsdoc::SiteStatsUNIONDiagramSvgEmptyRECORDModuleCardnamestringhrefstringmetastringRECORDSiteStatssystemsnumbercontainersnumbercomponentsnumberflowsnumberfindingsnumber
component

Markdown #

private
doc::Markdown

Renders an authored `[[doc.sidebar]]` page's Markdown source into the HTML that fills its `Doc` page body (LANG.md §9.3). The host has already loaded the source into the page's `markdown`; this crate does no I/O and renders that content in memory. The rendered HTML carries through unescaped as trusted authored content.

Parent

Inbound

Outbound

  • from doc::string
component

MarkdownSite #

private
doc::MarkdownSite

The static Markdown output mode: turns the same per-page props the HTML renderer consumes into flat `.md` files, each diagram a standalone `.svg` asset referenced as an image. The universe page renders as text lists (nodes by level, edges with traffic, each flow's legs); the health page as a table with article links. No SSR engine, no shared assets, no logo — the engine-free site for wikis and code hosts.

Parent

Inbound

Scenarios

MarkdownSiteMirrorsHtml

The Markdown site is the engine-free twin of the HTML site.

  • given the same resolved graph and configuration
  • when the Markdown site is rendered
  • then one .md per page mirrors the HTML site's paths
  • and each diagram is written as a standalone themed .svg asset referenced as an image
  • but no SSR engine runs and no shared assets or logo are emitted
Flow Flow — MarkdownSiteMirrorsHtml scroll to zoom · drag to pan
FEATUREMarkdownSiteMirrorsHtmlfor MarkdownSiteGIVENthe same resolved graph andconfigurationWHENthe Markdown site is renderedTHENone .md per page mirrors the HTMLsite's pathsANDeach diagram is written as astandalone themed .svg assetreferenced as an imageBUTno SSR engine runs and no sharedassets or logo are emitted
data

ModuleCard #

public
doc::ModuleCard

A module card on the index: its FQN, the (prefixed) href to its page, and an "N item(s)" line.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDModuleCardnamestringhrefstringmetastring
data

ModulePage #

public
doc::ModulePage
Entities Entity diagram scroll to zoom · drag to pan
RECORDModulePagenamestringsectionsdoc::NodeSection[]RECORDNodeSectionidstringkindstringnamestringfqnstringvisibilitystringsummarystringextendedstringtagsstring[]relationshipsdoc::RelGroup[]scenariosdoc::ScenarioCard[]diagramsdoc::Diagram[]diagnosticsdoc::SectionDiagnostic[]
data

NodeHref #

public
doc::NodeHref

A universe node's documentation link: its id and the (prefixed) href to its section, so clicking a sphere can navigate to the docs.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDNodeHrefidstringhrefstring
data

NodeSection #

public
doc::NodeSection

One node's documentation section: head fields, `///` docs, tags, relationship groups, scenario cards, embedded diagrams, and the health findings attributed to the node (rendered as inline badges).

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDNodeSectionidstringkindstringnamestringfqnstringvisibilitystringsummarystringextendedstringtagsstring[]relationshipsdoc::RelGroup[]scenariosdoc::ScenarioCard[]diagramsdoc::Diagram[]diagnosticsdoc::SectionDiagnostic[]RECORDRelGrouptitlestringitemsdoc::RelItem[]RECORDScenarioCardnamestringsummarystringextendedstringtagsstring[]stepsdoc::Step[]flowdoc::DiagramUNIONDiagramSvgEmptyRECORDSectionDiagnosticseveritystringcodestringcodeUrlstringmessagestringlinenumber
data

NodeUrl #

public
doc::NodeUrl

A resolved cross-reference target: the module page it lives on and its in-page anchor id. A cross-link uses these to build an `href`; an unresolved FQN has no entry and renders as plain text.

Entities Entity diagram scroll to zoom · drag to pan
RECORDNodeUrlpagestringanchorstring
data

PageBody #

public
doc::PageBody

The page body: the landing index, one authored doc page, one module's page, the 3D universe, or the architecture-health report.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
UNIONPageBodyIndexPageDocBodyModulePageUniversePageHealthPageRECORDIndexPagetitlestringcontextDiagramdoc::Diagramcardsdoc::ModuleCard[]statsdoc::SiteStatsRECORDDocBodytitlestringhtmlstringRECORDModulePagenamestringsectionsdoc::NodeSection[]RECORDUniversePagenodesuniverse::NodeOut[]edgesuniverse::EdgeOut[]flowsuniverse::FlowDef[]hrefsdoc::NodeHref[]RECORDHealthPageentriesdoc::HealthEntry[]errorCountnumberwarningCountnumber
data

PageProps #

public
doc::PageProps

The serialisable model for one page, handed to the Svelte server renderer. Every derived value (resolved hrefs, anchors, edge labels, counts) is precomputed here so the Svelte components do no graph logic. User text is carried raw — the renderer escapes it on interpolation. `docGroups` carries the authored `[[doc.sidebar]]` navigation shown above the module tree; `nav` carries the header links (Overview, Universe, Health with its finding count); `crumbs` is the breadcrumb trail. Only the universe page's props are also embedded in the document, for its 3D island — every other page ships no page data.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDPagePropssitedoc::SiteInfodocGroupsdoc::SidebarDocGroup[]sidebardoc::SidebarModule[]navdoc::NavLink[]crumbsdoc::Crumb[]pagedoc::PageBodyRECORDSiteInfonamestringthemestringlogoFilenamestringprefixstringRECORDSidebarDocGrouptitlestringitemsdoc::SidebarDocItem[]RECORDSidebarModulelabelstringhrefstringnodesdoc::SidebarNode[]RECORDNavLinklabelstringhrefstringbadgestringRECORDCrumblabelstringhrefstringUNIONPageBodyIndexPageDocBodyModulePageUniversePageHealthPage
component

Pages #

private
doc::Pages

Projects the resolved graph into per-page `PageProps` — pure data, no markup. Builds the index props (title, context diagram, module cards), each module page's node sections, and the depth-prefixed sidebar tree mirroring the C4 hierarchy.

Parent

Inbound

Outbound

Scenarios

UniversePageShipsStructureAndFlows

The universe page ships the 3D structure and its flows.

  • given a resolved model with entry-point flows
  • when the universe page is built
  • then the flat snapshot, the traced flows, and each node's documentation href are embedded
  • and the 3D island lays the graph out in the browser and links spheres to their docs
  • but a browser without WebGL keeps the server-rendered fallback listing
Flow Flow — UniversePageShipsStructureAndFlows scroll to zoom · drag to pan
FEATUREUniversePageShipsStructureAndFlowsfor PagesGIVENa resolved model with entry-pointflowsWHENthe universe page is builtTHENthe flat snapshot, the traced flows,and each node's documentation href areembeddedANDthe 3D island lays the graph out inthe browser and links spheres to theirdocsBUTa browser without WebGL keeps theserver-rendered fallback listing
SidebarMirrorsHierarchy

The sidebar tree mirrors the C4 hierarchy.

  • given modules whose nodes nest containers, components, and declarations
  • when the sidebar is rendered
  • then each module holds its top-level nodes and every node nests its same-module children
Flow Flow — SidebarMirrorsHierarchy scroll to zoom · drag to pan
FEATURESidebarMirrorsHierarchyfor PagesGIVENmodules whose nodes nest containers,components, and declarationsWHENthe sidebar is renderedTHENeach module holds its top-level nodesand every node nests its same-modulechildren
data

RelGroup #

public
doc::RelGroup

One relationship group ("Parent", "Inbound", or "Outbound") and its endpoints.

Entities Entity diagram scroll to zoom · drag to pan
RECORDRelGrouptitlestringitemsdoc::RelItem[]RECORDRelItemedgeKindstringarrowboolfqnstringhrefstringlabelstring
data

RelItem #

public
doc::RelItem

One relationship endpoint: the edge-kind word, whether to draw the outbound arrow, the endpoint FQN, its resolved href (absent → plain text), and any label.

Entities Entity diagram scroll to zoom · drag to pan
RECORDRelItemedgeKindstringarrowboolfqnstringhrefstringlabelstring
component

Relationships #

private
doc::Relationships

Renders a node's relationships (LANG.md §9.3): its `for`/owner parent, inbound edges, and outbound edges, skipping the structural `for`-parent edge kind. Each endpoint is a cross-link when its FQN resolves, plain text otherwise.

Parent

Inbound

Outbound

data

RenderError #

public
doc::RenderError

Why server-rendering a page failed. Every variant is a defect in the bundle, the engine, or the props codec — never user model data; well-formed props always render.

Entities Entity diagram scroll to zoom · drag to pan
UNIONRenderErrorEngineCallCodecRECORDEnginemessagestringRECORDCallmessagestringRECORDCodecmessagestring
data

RenderedPage #

public
doc::RenderedPage

The server-render result for one page: the `<svelte:head>` contents and the rendered body markup, dropped into the document shell.

Entities Entity diagram scroll to zoom · drag to pan
RECORDRenderedPageheadstringbodystring
data

ScenarioCard #

public
doc::ScenarioCard

One BDD scenario card: name, `///` docs, tags, the ordered steps, and the feature's flow figure (LANG.md §9.5).

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDScenarioCardnamestringsummarystringextendedstringtagsstring[]stepsdoc::Step[]flowdoc::DiagramRECORDStepkeywordstringtextstringUNIONDiagramSvgEmpty
component

Scenarios #

private
doc::Scenarios

Renders the BDD scenario cards on a node's page: each `feature` targeting the node becomes its given/when/then steps and its flow figure as a card (LANG.md §5.2, §9.3, §9.5). Empty when the node has no features.

Parent

Inbound

Outbound

Scenarios

RenderScenarioCards

Feature scenarios render on their target node's page (§9.3).

  • given a model whose nodes carry `feature` scenarios
  • when the site is generated
  • then each node's page lists its scenarios as given/when/then cards
  • but a node with no features renders no scenarios section
Flow Flow — RenderScenarioCards scroll to zoom · drag to pan
FEATURERenderScenarioCardsfor ScenariosGIVENa model whose nodes carry `feature`scenariosWHENthe site is generatedTHENeach node's page lists its scenariosas given/when/then cardsBUTa node with no features renders noscenarios section
data

SearchEntry #

public
doc::SearchEntry

One record in the static full-text search index: the symbol or page's FQN, display name, kind word, one-line summary, plain-text body, declaring module, and root-relative href. Sorted by href then FQN so the index is deterministic.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDSearchEntryfqnstringnamestringkindstringsummarystringtextstringmodulestringhrefstring
component

SearchIndex #

private
doc::SearchIndex

Builds the static full-text search index the client palette queries: one record per linkable node, module page, and authored doc page, plus the universe and health pages. Shipped as a classic-script JS assignment (`search-index.js` setting a window global) so it loads under `file://` — never fetched.

Parent

Inbound

Outbound

Scenarios

SearchIndexIsStatic

The search index is static and file://-safe.

  • given a generated site
  • when the search palette opens
  • then the index loads as a classic script setting a window global, never fetched
  • and entries cover nodes, modules, authored docs, and the universe and health pages
  • and the index is sorted and deterministic
Flow Flow — SearchIndexIsStatic scroll to zoom · drag to pan
FEATURESearchIndexIsStaticfor SearchIndexGIVENa generated siteWHENthe search palette opensTHENthe index loads as a classic scriptsetting a window global, never fetchedANDentries cover nodes, modules, authoreddocs, and the universe and healthpagesANDthe index is sorted and deterministic
data

SectionDiagnostic #

public
doc::SectionDiagnostic

One inline badge on a node's section: the severity, rule code, article URL, message, and source line of a finding attributed to that node.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDSectionDiagnosticseveritystringcodestringcodeUrlstringmessagestringlinenumber
component

Shell #

private
doc::Shell

Owns the document shell that wraps each server-rendered body — the part Rust renders, not Svelte: doctype, `<html data-theme>`, font + stylesheet links, the theme pre-paint script, and the classic deferred scripts. Scripts are classic (never `type="module"`) and shared data ships as JS-global files, so the site works opened from disk (`file://`). Only the universe page embeds its props (`window.__DATA__`) — for its 3D island; every other page ships no page data and the client only progressively enhances.

#app

Parent

Inbound

Outbound

Scenarios

OnlyUniverseEmbedsData

Only the universe page carries page data; everything else is pure SSR.

  • given a generated site
  • when the document shells are assembled
  • then the universe page embeds its props as window.__DATA__ for the 3D island
  • and every script is a classic deferred script so the site works from file://
  • but no other page embeds page data — the client only progressively enhances
Flow Flow — OnlyUniverseEmbedsData scroll to zoom · drag to pan
FEATUREOnlyUniverseEmbedsDatafor ShellGIVENa generated siteWHENthe document shells are assembledTHENthe universe page embeds its props aswindow.__DATA__ for the 3D islandANDevery script is a classic deferredscript so the site works from file://BUTno other page embeds page data — theclient only progressively enhances
SystemThemeFollowsOs

The theme follows the OS by default, overridable in-page and in config.

  • given a DocConfig carrying the system theme
  • when the document shell is rendered
  • then a pre-paint script applies the stored preference, else the OS scheme, else the configured default
  • and diagram SVGs follow the active scheme through the --pds-* variables
  • but a light or dark config pins the default without removing the toggle
Flow Flow — SystemThemeFollowsOs scroll to zoom · drag to pan
FEATURESystemThemeFollowsOsfor ShellGIVENa DocConfig carrying the system themeWHENthe document shell is renderedTHENa pre-paint script applies the storedpreference, else the OS scheme, elsethe configured defaultANDdiagram SVGs follow the active schemethrough the --pds-* variablesBUTa light or dark config pins thedefault without removing the toggle
data

SidebarDocGroup #

public
doc::SidebarDocGroup

One `[[doc.sidebar]]` group in the authored-doc navigation: a heading and its page links, shown above the module tree.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDSidebarDocGrouptitlestringitemsdoc::SidebarDocItem[]RECORDSidebarDocItemtitlestringhrefstring
data

SidebarDocItem #

public
doc::SidebarDocItem

One authored doc-page link in the sidebar: its title and the page href, already prefixed for the page's depth.

Entities Entity diagram scroll to zoom · drag to pan
RECORDSidebarDocItemtitlestringhrefstring
data

SidebarModule #

public
doc::SidebarModule

One sidebar entry: a module-page link and its node tree, hrefs already prefixed for the page's depth.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDSidebarModulelabelstringhrefstringnodesdoc::SidebarNode[]RECORDSidebarNodenamestringfqnstringkindstringhrefstringchildrendoc::SidebarNode[]
data

SidebarNode #

public
doc::SidebarNode

One node in the sidebar tree, recursing into its same-module children.

Entities Entity diagram scroll to zoom · drag to pan
RECORDSidebarNodenamestringfqnstringkindstringhrefstringchildrendoc::SidebarNode[]
data

Site #

public
doc::Site

The whole generated site as in-memory files, in deterministic order: the index, one page per authored doc (`[[doc.sidebar]]`, in declaration order), then one page per module sorted by FQN, plus the shared assets. The doc crate does no I/O; the CLI writes each file under the configured output directory.

Entities Entity diagram scroll to zoom · drag to pan
RECORDSitefilesdoc::SiteFile[]RECORDSiteFilepathstringcontentsstring
component

SiteBuilder #

private
doc::SiteBuilder

Orchestrates the whole site: build the URL map, project each page's props, server render it through the SSR engine, wrap it in the document shell, and ship the shared assets plus the search index. Pure: returns in-memory `Site` files, writes none.

Parent

Inbound

Outbound

Scenarios

DeterministicGeneration

Generation is deterministic and pure.

  • given the same resolved graph and configuration rendered twice
  • when the two sites are compared
  • then modules and nodes are ordered by FQN with no clock or randomness consulted
  • and the file lists are byte-for-byte identical
Flow Flow — DeterministicGeneration scroll to zoom · drag to pan
FEATUREDeterministicGenerationfor SiteBuilderGIVENthe same resolved graph andconfiguration rendered twiceWHENthe two sites are comparedTHENmodules and nodes are ordered by FQNwith no clock or randomness consultedANDthe file lists are byte-for-byteidentical
data

SiteFile #

public
doc::SiteFile

One generated file: a site-root-relative `/`-separated path (`index.html`, `module/banking.core.html`, `style.css`, `client.js`) and its complete contents.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDSiteFilepathstringcontentsstring
data

SiteInfo #

public
doc::SiteInfo

Site-wide presentation, identical across pages: the title, the `light`/`dark`/`system` theme word, the optional logo filename, and the `../` prefix to the site root for this page's depth.

Entities Entity diagram scroll to zoom · drag to pan
RECORDSiteInfonamestringthemestringlogoFilenamestringprefixstring
data

SiteStats #

public
doc::SiteStats

The index page's stats strip: how many systems, containers, components, flows, and health findings the model carries.

Inbound

Entities Entity diagram scroll to zoom · drag to pan
RECORDSiteStatssystemsnumbercontainersnumbercomponentsnumberflowsnumberfindingsnumber
component

Ssr #

private
doc::Ssr

The server-side render boundary: a JSON-string-in / JSON-string-out seam to the JavaScript renderer. The native build embeds a `QuickJS` engine that evaluates the prebuilt `ssr.js` bundle (`Doc::Assets`) in-process; a wasm host implements the same seam against its own JS engine. A defect here is a build-asset fault, never user model data.

#critical

Parent

Inbound

Outbound

  • from doc::Result

Scenarios

ServerRenderedFirstPaint

Pages are server-rendered through an embedded JS engine for first paint.

  • given a page's precomputed props
  • when the page is server-rendered
  • then the page chrome and all text content are present in the emitted HTML before any script runs
  • and the renderer needs no JavaScript toolchain, only the embedded prebuilt bundle
Flow Flow — ServerRenderedFirstPaint scroll to zoom · drag to pan
FEATUREServerRenderedFirstPaintfor SsrGIVENa page's precomputed propsWHENthe page is server-renderedTHENthe page chrome and all text contentare present in the emitted HTML beforeany script runsANDthe renderer needs no JavaScripttoolchain, only the embedded prebuiltbundle
data

Step #

public
doc::Step

One scenario step: its keyword (given/when/then/and/but) and prose.

Entities Entity diagram scroll to zoom · drag to pan
RECORDStepkeywordstringtextstring
data

Svg #

public
doc::Svg
Entities Entity diagram scroll to zoom · drag to pan
RECORDSvgcaptionstringeyebrowstringkindstringsvgstring
data

Theme #

public
doc::Theme

Doc-site colour scheme, written as the `data-theme` attribute on the root `<html>` to select a CSS variable set. `System` (the default) follows the OS `prefers-color-scheme`, overridable by the in-page toggle; `Light` and `Dark` pin the scheme.

Entities Entity diagram scroll to zoom · drag to pan
UNIONThemeLightDarkSystem
data

UniversePage #

public
doc::UniversePage
Entities Entity diagram scroll to zoom · drag to pan
RECORDUniversePagenodesuniverse::NodeOut[]edgesuniverse::EdgeOut[]flowsuniverse::FlowDef[]hrefsdoc::NodeHref[]RECORDNodeOutidstringlevelstringparentstringRECORDEdgeOutsourcestringtostringtrafficnumberRECORDFlowDeffqnstringnamestringcolorstringhopsuniverse::FlowHop[]RECORDNodeHrefidstringhrefstring
component

Urls #

private
doc::Urls

Maps every node FQN to its page path and anchor, and resolves cross-references to module-page-relative `href`s. A module page is `module/<dotted-fqn>.html` (`::` → `.`); a node is the `#<slug>` anchor within it. Only an FQN naming a real node produces a link (LANG.md §9.3).

Parent

Inbound

Outbound

  • from doc::Result
  • from doc::Result

Scenarios

CrossLinksResolve

Cross-links resolve to anchors; unresolved references stay plain text.

  • given a relationship endpoint named by FQN
  • when the link is rendered
  • then an FQN naming a real node becomes an anchor link to its section
  • but an unresolved or synthesised endpoint renders as plain text
Flow Flow — CrossLinksResolve scroll to zoom · drag to pan
FEATURECrossLinksResolvefor UrlsGIVENa relationship endpoint named by FQNWHENthe link is renderedTHENan FQN naming a real node becomes ananchor link to its sectionBUTan unresolved or synthesised endpointrenders as plain text
Generated by pds doc.