Viewer

The viewer is the devpage program. It serves documents from a folder in the browser — a site of pages, a doc read top to bottom, a deck of slides, or a design drawn on a canvas and clicked through as a prototype — keeps every open page current as the files change, lets readers leave comments on any page of a site, a doc or a deck (a design is discussed on the page that embeds it), checks every link, prints a doc or a deck to PDF exactly as the browser shows it, and records a deck as a narrated video. This page says what its parts are and where each is explained; it belongs to the system catalog.

Point it at a document's YAML file, at a folder holding devpage.yml, or at a single Markdown file, and it prints the address it serves on:

devpage docs/devpage.yml      # or: devpage docs
devpage design.md             # one Markdown file, served as a doc
devpage check docs            # every link, exit 1 if one is broken
devpage pdf talks/launch      # the deck as a PDF
devpage video talks/launch    # the deck as an mp4, its notes read aloud
devpage app/checkout.design   # one design, on a canvas

Every page is rendered when it is requested, straight from the files on disk, so what the browser shows is what the files hold, and an open page swaps in the fresh one the moment a file changes.

flowchart LR
  files["Markdown and<br/>document files"] --> serving["Serving pages"]
  serving --> page["Open page<br/>widgets, diagrams"]
  files -. "a save" .-> live["Live updates"]
  live -. "change" .-> page
  page --> pdf["PDF"]
  designfiles[".design files"] --> engine["Design engine"]
  engine -->|"changed nodes"| page
  engine --> png["PNG of a design"]
  click files href "./writing-a-document/README.md" "Writing a document"
  click serving href "./serving-pages/README.md" "Serving pages"
  click page href "./widgets/README.md" "Widgets"
  click live href "./live-updates/README.md" "Live updates"
  click pdf href "./pdf/README.md" "Printing to PDF"
  click designfiles href "./designs/README.md" "Designs"
  click engine href "./design-engine/README.md" "The design engine"
  click png href "./designs/README.md#looking-at-a-design-as-a-png" "A design as a PNG"

Its parts

Each card opens the page that explains it.

Write

  • Writing a document — The four kinds, the document file and the served folder.
  • Making a site — Root page, sidebar, navbar, logo and theme switch.
  • Writing a doc — Chapters, the outline, and the PDF's paper, header and footer.
  • Making slides — One file per slide on a 16:9 stage.
  • Widgets — React components as tags in Markdown, devpage's and your own.
  • Diagrams — Mermaid fences drawn as SVG, with nodes that are links.
  • Designs — A UI as a .design file: a canvas to click through, an embed in any page, a PNG for the agent.

Read

  • Organizing navigation — How Topics sections build a site's sidebar.
  • Themes — The light and dark tokens behind the page, its code and its diagrams.
  • Live updates — From a saved file to a swapped page.

Share

  • Comments — Threads on text or a paragraph, kept as files git never sees.
  • Printing to PDF — devpage pdf has Chrome print a doc or a deck as it shows.
  • Making a video — devpage video records a deck, each slide's notes read aloud by GPT-Live.
  • Deploying devpage — For a team, behind the auth proxy you already run.

Check

Topics

Essentials

Concepts and tasks

Mechanisms

Reference

Constraints