Expand description
devpage’s core: what a document is, how its pages render, what is wrong
with them, who comments on them and how its designs resolve — with no I/O
runtime. The crate depends on no tokio, axum, notify, tonic, reqwest or
chromiumoxide, so the compiler refuses a core that reaches for one. What
it needs from outside — the network for external links, somewhere to run
in the background, where changes go, where comments are kept, where
problems are reported — it asks for through a port, and the devpage
binary plugs in the adapters.
Modules§
- addresses
- Content addresses: the one place an address devpage serves for a page to load is made.
- cache
- What server mode’s cache keeps, and the port that chooses what it lets go. The cache itself — files on the PVC — is the binary’s; deciding which entries to delete when it is past its limit is a pure function of them.
- changes
- What open pages hear: a change is typed — refresh the page, or fetch a
page’s comments again — and scoped to the documents it concerns, so a
page hears only its own. Anything may publish through the
Publishport: the file watcher, a comment store, the external-link checker. The bus that carries changes to open pages is thedevpagebinary’s. - check
- Link checking: every link, image and diagram target a page holds must reach a file in the served folder — and a heading on it, when it names one — every external address must answer, and every diagram must draw.
- comments
- Comments: threads readers leave on a page, kept by a comment store. The
Storeport is what a store must do — list, create, reply, resolve — andCommentsis what the server writes through: every write it makes announces itself on the change bus, so open pages hear it whatever keeps the threads. The YAML files under.devpage/comments/are one store (yaml); tests keep threads in memory ([memory]). Where a store keeps threads across versions of a document,anchorcarries each one onto the next version’s text. - designs
- The design store: every design asked for kept resolved in memory and
resolved again only when a save touched what it read, its problems and
its PNG. The watch stream and the canvas page that show designs in the
browser are the server’s, in
server::watch_streamandserver::canvas. - diagrams
- The diagram engine: every Mermaid fence drawn to SVG on the server, by the vendored pele bundle running in QuickJS.
- document
- A document: what a document file says to show — a site, a doc or slides — or a lone Markdown file, which is a doc of one chapter.
- external
- External links: whether each address a page links to outside devpage
answers.
devpage checkasks each address once (twice if it can’t be reached); the preview asks in the background and shows what it has heard, announcing on the change bus when that changes. - highlight
- Syntax highlighting for fenced code blocks, done while the page renders.
- icons
- Icons by name, drawn as inline SVG in the text color: the Lucide set
(
assets/vendor/lucide.json, ISC) and the few brand marks Lucide doesn’t carry, from Simple Icons (CC0). - index
- The served folder’s index: which files are document files and of what
kind, and which paths its
.gitignorefiles exclude — and, when asked for, the search index of their text. Built once at start and kept current by the watcher, so serving never scans folders. - markup
- Reading a page’s Markdown as text, before it is rendered: its front
matter, its title, its
<Notes>, and the scanner that finds widget tags outside code. A leaf: it depends on nothing else in devpage, so documents, rendering, widgets and checking can all use it. - nav
- Navigation: the tree a document’s pages form through their
## Topicssections. - navbar
- A site’s navbar — its title, then the links, dropdowns and icons its
navbarfield lists — and the light/dark selector every page carries. - problem
- A problem: one broken thing a document holds, where it was found — the value link checking, the navbar, widgets and comments report, and the page lists above itself. A leaf: it depends on nothing else in devpage.
- render
- Markdown to a full page: the rendered file inside the document’s frame.
- resolve
- What a request for a path in the served folder is answered with: a page,
a redirect, a file’s bytes, a design’s or a slide’s PNG, or why there is
none. Decided here from the documents alone, so every route is tested
without a socket; the HTTP server only turns an
Answerinto a response and draws the PNGs it names. - search
- Full-text search over what the served document publishes: the pages its nav reaches, and the chapters and slides of every document those reach, split at their headings into sections, in a tantivy index held in memory. Built at start beside the document index and kept current by the watcher, so a search never reads a file.
- served
- The served folder: the one place that decides whether a path is part of what devpage serves. Every link, chapter, slide, widget folder, logo or URL that names a file is resolved here — symbolic links followed — and anything that lands outside the folder is refused. A leaf: it depends on nothing else in devpage.
- widgets
- Widgets: React components used as capitalized HTML tags in Markdown.