Skip to content

doc renderers: changelog entries as highlighted IDL lines, and a theme toggle - #103

Merged
Kinflou merged 3 commits into
masterfrom
doc/changelog-entries-and-theme
Nov 1, 2026
Merged

Kinflou merged 3 commits into
masterfrom
doc/changelog-entries-and-theme

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 1, 2026

Copy link
Copy Markdown
Member

Two improvements to comline doc's renderers, on core#162's old / new changelog lines.

Changelog entries. Each entry renders as:

  • a severity badge (major / minor / patch, from the list core put it in), a short title (Orders.place: signature changed) whose subject links to the unit's anchor in that version (a function's own anchor for a protocol member; no link when the unit is gone);
  • then core's IDL lines: − old (removed styling) and + new (added styling); an addition shows only +, a removal only −;
  • or, for a kind with no IDL (docstring change, error ordinal, guarantees, function reorder, namespace rename), a short sentence instead of the old field dump.

Shared in comline_codegen::doc_model: Entry / entries / entry (titles and sentences), unit_target, and a lexical IDL tokenizer (tokens: keywords, types, names, punctuation, literals, annotations, comments). The HTML renderer highlights at render time as classed spans, no JS, with colours for both themes. compare.js gets each entry's rendered HTML inlined in its data (no rules in JS); the grid's badges carry the entries' titles as tooltips. The Markdown renderer writes a heading line (#### MAJOR · [Orders.place](api.md#orders-place): signature changed) and a fenced diff block. The changelog heading is now just "Changelog" in both.

Theme toggle. Every HTML page (version pages, the site index and compare.html) has a header button cycling auto → light → dark, with an icon, label and aria-label. The choice is kept in localStorage (try/catch, so blocked storage and file:// work) and applied by a tiny inline <head> script before first paint. CSS: tokens on :root, dark under @media (prefers-color-scheme: dark) guarded by :root:not([data-theme="light"]), and again under :root[data-theme="dark"].

Goldens re-blessed; the fixtures carry old / new (and a changed signature).

Pins. comline-core on core#162's branch (codegen and conformance); conformance's generator pins on comline-rust / comline-typescript's matching bumps. Merge after core#162, then the generator PRs.

Kinflou added 3 commits November 1, 2026 22:38
…e toggle

Each changelog entry renders as a severity badge, a short title linking
to the unit's anchor, then core's old and new IDL lines (− / +),
highlighted at render time as classed spans; a kind with no IDL gets a
sentence instead of a field dump. The same entry HTML is inlined into
compare.js for the two-version view, and the grid's badges carry the
titles as tooltips. The Markdown renderer shows a heading line and a
fenced diff block. The changelog heading is just "Changelog".

Every HTML page's header gets a theme toggle (auto, light, dark), kept
in localStorage when allowed and applied before first paint.

Pins comline-core on core#162's branch.
So the generators can depend on this commit's conformance crate with one
comline-core in their graph; the generator pins follow once they're on it.
comline-rust and comline-typescript on their deps/core-changelog-idl-lines
branches, which pin core#162 and this branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant