Commit Graph

8 Commits

Author SHA1 Message Date
715c8068f8 feat(editor): run markdown source editing on CodeMirror 5 2026-11-06 08:23:13 +08:00
8b4d1fa03e build: vendor CodeMirror 5.65.16 for the source editor 2026-11-06 08:23:13 +08:00
b2a4fd41ca refactor(page): route editor access through an adapter 2026-11-06 08:17:59 +08:00
1115052762 refactor: split the page, markdown pipeline and escaping out of main.rs
- assets/page/{page.html,page.css,page.js} now hold the UI. build_page only
  fills __MDP_*__ placeholders, so editing the page no longer means escaping
  braces inside a format! string. Output was verified byte-identical for the
  home page, a math/mermaid document and the startup page.
- src/markdown.rs: md -> html pipeline (GFM, AI-output dialect, front matter,
  embedded images, ==highlight==, heading ids).
- src/page.rs: page assembly.
- src/escape.rs: shared JS/HTML escaping.
- src/main.rs drops from 5535 to 3709 lines. No behavior change; 62 tests.
2026-11-03 23:02:58 +08:00
b01553e421 feat: fixed-size chevron fold toggles
Use 30px hit area and 13.5x20 chevron (90% of the previous H2 marker) for every heading level, restore the outlined arrow, and keep it vertically centered to the left of the heading.
2026-10-21 17:20:52 +08:00
f74a04bd13 feat: fold heading sections with hover toggles
- Wrap #preview children into nested section.mdp-fold/.mdp-fold-body by heading level
- Chevron button appears on heading hover; H2 folds to next H2, H3 to next H3, nested sections included
- No persistence: every render starts fully expanded
- Find auto-expands collapsed ancestors before scrolling to a hit
- Print expands all sections and hides the toggles
2026-10-21 16:53:03 +08:00
9717dc9690 feat: always-dark VS code blocks, remove Find button
- Replace github light/dark hljs themes with assets/hljs/vs-dark.css (#1e1e1e bg, VS token colors)
- Drop the prefers-color-scheme stylesheet switch; code blocks stay dark in both themes
- Remove the toolbar Find button and its strings/icon; Ctrl+F and the findbar are unchanged
- Print keeps the dark background via print-color-adjust: exact
- Delete unused github.min.css / github-dark.min.css
2026-10-21 16:33:56 +08:00
f63aff47a8 chore: baseline md-preview 1.4.2 + agent workspace 2026-10-21 16:06:27 +08:00