Expand description
The documentation generator: a Model and the SVGs asbuilt render
produced, to a static HTML tree that mounts anywhere. A view LikeC4
drew is inlined into its page (crate::svg) and colored by
theme.css (crate::theme) for the system’s light or dark scheme or
a visitor’s choice; theme.js, the tree’s one script, carries that
choice and is left out when scheme_toggle is off.
Pure: no filesystem, no process. LikeC4 and Graphviz supply the
pictures; this module supplies what only the model knows (each crate
and module, its path and doc paragraph, what it references and what
references it). Every link is relative and no page is deeper than one
directory, so the tree serves from file://, a GitHub Pages
subdirectory, or a versioned snapshot unchanged.
Structs§
- Docs
Options - What the pages need beyond the model.
- Site
- The generated tree.
Constants§
- GENERATOR_
META_ PREFIX - How every page’s
<meta name="generator">starts, whatever release wrote it (content="asbuilt docs 0.3.0").asbuilt docslooks for it before clearing an output directory: a tree that has it was written by a previous run and is safe to replace. - MARK_
PATH - The asbuilt mark as SVG path data for a
0 0 24 24viewBox, a copy ofbrand/mark.path(kept identical byscripts/check-brand-copy.sh). - SCHEME_
SCRIPT - The script behind the scheme control, linked in every page’s head.
- STYLESHEET
- The stylesheet every page links.
- VIEWER_
SCRIPT viewer.js: the diagram viewer, whenvieweris on.- VIEWER_
STYLESHEET viewer.css: the viewer’s own styles, besidestyle.cssso a host page can embed a figure without the tree’s page styles.
Functions§
- anchor
- The fragment id of an element within its container’s page.
- container_
page - The page of a top-level element.
- escape
- HTML-escape the five characters that matter in text and attributes.
- generate
- The whole tree for a model. The model is normalized on a copy first, so the caller’s element order does not matter.
- markdown
- A description paragraph as HTML. Raw HTML in the source is rendered
as text: the pages are published, and a
<script>in a doc comment must not become one here.