Skip to content

Reader-first: math-truncation fix, doc meta, and SlideEngine navigation - #65

Open
zereraz wants to merge 3 commits into
nicobailon:mainfrom
zereraz:feat/reader-first
Open

Reader-first: math-truncation fix, doc meta, and SlideEngine navigation#65
zereraz wants to merge 3 commits into
nicobailon:mainfrom
zereraz:feat/reader-first

Conversation

@zereraz

@zereraz zereraz commented Jun 28, 2026

Copy link
Copy Markdown

Improves the reading/consuming experience and hardens render.

render (extension.ts) — auto-applied, idempotent, lossless:

  • fixDisplayMath() escapes </> inside $$...$$ so the HTML parser can't truncate formulas like y_{<t} (KaTeX decodes the entities back). Fixes a recurring silent-failure.
  • ensureDocMeta() injects lang, viewport, and theme-color when missing.

SlideEngine (slide-deck.html) — for pages read over multiple sittings:

  • deep-link hashes (#slide-N) + back/forward nav
  • resume where you left off (localStorage)
  • reading percent in the counter
  • outline overlay (O) with clickable slide titles
  • keyboard help panel (?)

SKILL.md — reader-first defaults (TL;DR-first, recap, <abbr> glossary, no motion-gated content, a11y) + checklist.

All additive; no API change.

zereraz added 3 commits June 27, 2026 22:05
- SKILL.md: add favicon to delivery rules + final checklist, plus a KaTeX
  '<'-escaping note that prevents formula truncation
- templates: add the data-URI favicon to all 4 reference templates
- extension.ts: ensureFavicon() deterministically injects the favicon after
  </title> (or into <head>) on render unless an icon link already exists,
  so pages get it even if the agent omits it

The favicon is a self-contained data-URI SVG (node-graph glyph, dark/accent
palette), consistent with the self-contained-HTML requirement.
- scripts/update-fork.sh: --check / --apply / --continue with agent-friendly
  exit codes (10 behind, 20 conflict); merges upstream into main preserving
  local commits, pushes, and runs 'pi update' to refresh the install
- commands/update-visual-explainer.md: /update-visual-explainer command that
  checks first, applies if behind, and has the agent resolve conflicts keeping
  both upstream behavior and our additive customizations
- docs/MANAGED-FORK.md: remotes, philosophy (on-demand > automatic), usage
render (extension.ts):
- fixDisplayMath(): escape < and > inside $$...$$ so the HTML parser can't
  truncate formulas like y_{<t} (the recurring KaTeX bug), idempotent + lossless
- ensureDocMeta(): inject lang, viewport, theme-color if missing
- render pipeline now: fixDisplayMath -> ensureDocMeta -> ensureFavicon

SlideEngine (slide-deck.html template):
- deep-link hashes (#slide-N) + hashchange nav
- resume where you left off (localStorage per path)
- reading percent in the counter
- outline overlay (press O) with clickable slide titles
- keyboard help panel (press ?)

SKILL.md:
- reader-first defaults: TL;DR-first, recap, <abbr> glossary, no motion-gated
  content, a11y (no color-only, reduced-motion, >=16px); checklist updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant