web: refactor display pipeline #4

Manually merged
leoqi merged 0 commits from web/fix-styles into main 2026-06-08 15:57:04 +00:00
Owner

Use pandoc lua filters and style updates to decrease the surface area of the code.

Use pandoc lua filters and style updates to decrease the surface area of the code.
This reverts commit 4fff0808ea.
This reverts commit e26504e114.
- Narrow bottom bar content (On This Page, All RFDs) to match page content width
- Remove all comments from styles.css
- Add syntax highlighting for code blocks (keywords, comments, types, etc.)
- Wrap code blocks in <details open><summary>Code …</summary> via pandoc filter
- Style code blocks with RFC-editor-inspired #f9f9f9 background on summary,
  no background on code content, 1px #eee border, rounded corners
- Code blocks extend right with 0.65em font size for ~120 char fit
- Add panflute filter (filter.py) to wrap CodeBlock elements in details/summary
- Add python3 and python313Packages.panflute to devshell and build inputs
- Patch shebangs for both build.osh and filter.py in nix build
main.js contained a full copy of the Stork search initialization, escaping,
highlighting, and rendering that already exists in search.js. This commit
removes the ~80 lines of duplicated search code, leaving only the TOC
toggle logic. The landing page initializes search via initSearch() from
search.js, which handles all search functionality.
searchbar.css was only loaded by index.html with only page-specific
overrides for the landing page search bar. Merged these 44 lines of CSS
into styles.css under a landing-page section and deleted the standalone
file. Removed the CSS link from index.html.
Create an extract_rfd_metadata() shell function that parses a markdown
file once and outputs number\ttitle\tstate\tlabels. All three metadata
consumers (RFD page build, index table, index JSON) now call this single
function, eliminating the duplicated grep/sed extraction logic.
Replace Python-based pandoc filter (filter.py) with Lua filter
(filter.lua). Lua is pandoc's native filter language, eliminating the
python3 and python313Packages.panflute dependencies. Remove
patchShebangs filter.py from build phase.
Remove the CSS sibling selector hack (#toc-cb:checked ~ header nav#TOC) that\nshared toggle state with JS. Now JS is the sole owner of the TOC\nopen/close state, controlling max-height for animation. The checkbox is\nstill used as the click target (accessible), but JS explicitly sets\nmaxHeight for all transitions.
Lua filters must be invoked with pandoc --lua-filter, not --filter.\nLua filters are built into pandoc and do not require an external\nexecutable.
Fix code block right margin calculation to correctly extend from
content area to viewport edge (calc(content-width + bar-pad + 2rem)).
Fix TOC auto-opening when tabbing into links by setting maxHeight
immediately in focus handler, ensuring the panel opens while the
checkbox remains checked throughout the transition.
Code block: margin-right must be negative to extend beyond the content
area. calc(content-width - page-width) = 33rem - 47rem = -14rem,
matching the original -14rem value.

TOC: toc was lazily initialized only inside openToc/closeToc, but the
focus handler referenced toc.style before initialization, causing a
null error. Initialize toc eagerly at IIFE entry.
leoqi manually merged commit 8dac2d2b7c into main 2026-06-08 15:57:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
simplefast/rfd!4
No description provided.