Commit Graph

65 Commits

Author SHA1 Message Date
Julien Calixte
f9906cba30 feat(notes): highlight rust code blocks and .rs file views
All checks were successful
CI / verify (push) Successful in 1m7s
2026-07-08 00:12:17 +02:00
Julien Calixte
1b6c7542d7 feat(notes): render macroplan code blocks as a delivery plan grid
All checks were successful
CI / verify (push) Successful in 2m9s
Follows the tikz pattern: the fence emits a base64 placeholder, then
the post-render hook lazily imports the parser and grid (separate
chunks) and mounts the grid only when a placeholder exists. Mono font
forced on the block because the flag-stacking math assumes Fira Code.
2026-07-08 00:01:21 +02:00
Julien Calixte
5386fa66ea feat(notes): show line numbers on non-markdown file views
All checks were successful
CI / verify (push) Successful in 2m8s
CSS counters on the per-line spans, scoped to .code-file so fenced
blocks inside notes stay untouched. The gutter width adapts to the
file's line count and numbers are excluded from text selection.
2026-07-03 16:57:09 +02:00
Julien Calixte
a04d169bd8 fix(notes): show raw-text fallback when markdown render fails
All checks were successful
CI / verify (push) Successful in 1m2s
A throwing markdown-it plugin propagated uncaught and left the note
silently blank. Wrap the central render in try/catch and degrade to the
note's escaped raw text with a gentle notice, so content stays readable.
2026-06-29 00:00:20 +02:00
Julien Calixte
ac3a641b22 fix(markdown): re-render code blocks after Shikiji loads
Some checks failed
CI / verify (push) Failing after 7s
The singleton `md` instance is mutated by `useShikiji()` asynchronously,
but `content` computeds had no reactive dep on that loading, so the
initial render on page reload never picked up syntax highlighting.
Link-click navigation appeared to work only because Shikiji was already
installed in `md` by an earlier render.
2026-06-09 14:38:40 +02:00
Julien Calixte
f2ba56e936 fix: add tsx as lang 2026-06-09 14:34:23 +02:00
Julien Calixte
9d1b6552cb feat(markdown): add hover download buttons on rendered SVGs
Attach SVG and PNG (×2) download buttons to every rendered SVG (TikZ,
Mermaid, …) once post-render finishes. Exports always use the original
colors with a white background baked in, regardless of theme.
2026-05-16 12:17:04 +02:00
Julien Calixte
572a05962c fix(markdown): load TikZ font stylesheet to keep text aligned
The obsidian-tikzjax bundle emits SVG referencing Computer Modern font
families like cmbx7 but ships the @font-face declarations in a separate
styles.css. Without it the browser substitutes a default font whose
glyph widths don't match TeX's, leaving visible gaps between each
kerned text run. Lazy-load the stylesheet alongside the engine on
first TikZ render so cache hits and misses both see correct fonts.
2026-05-15 16:25:55 +02:00
Julien Calixte
bf19e982fe feat(markdown): render TikZ fenced blocks to SVG
Adds a markdown-it extractor for ```tikz blocks that emits a sanitized
placeholder, plus a runTikz() that lazy-loads the obsidian-tikzjax 0.5.2
bundle from jsdelivr on first encounter, sanitizes the produced SVG with
DOMPurify, and caches it in PouchDB keyed by sha256(source) so repeat
views are instant and offline-capable.
2026-05-15 15:38:48 +02:00
Julien Calixte
e715fb02d3 fix(markdown): cache Shikiji init promise to avoid race on parallel callers
The boolean guard flipped synchronously before the async plugin load
resolved, so concurrent callers (e.g. multiple stacked non-markdown
notes mounting on reload) returned early and rendered before
markdown-it-shikiji was attached to the shared md instance. Cache the
in-flight promise instead so all callers await the same resolution.
2026-04-30 11:03:29 +02:00
Julien Calixte
7b4c7947aa fix: remove bottom padding 2026-04-29 22:06:58 +02:00
Julien Calixte
adb1bd5945 fix: fix height on mobile 2026-04-29 10:34:46 +02:00
Julien Calixte
cf5567de7c refactor(notes): use options object for renderCodeFile params 2026-04-27 20:36:46 +02:00
Julien Calixte
9d6f70546e feat(notes): render code files with Shikiji syntax highlighting
Non-markdown files opened as stacked notes are now highlighted using
the existing markdown-it-shikiji pipeline (4-backtick fence wrapping)
with a h1 filename heading. Edit controls are hidden for code files.
Adds alloy language grammar and a fileLanguage utility mapping
extensions to Shikiji language IDs.
2026-04-27 19:57:15 +02:00
Julien Calixte
812f393283 design: reduce padding for pre in tabs 2026-04-27 18:22:48 +02:00
Julien Calixte
37b39a6d96 design: box for tabs instead 2026-04-27 15:34:12 +02:00
Julien Calixte
df8bda0130 feat(markdown): render tabs as DaisyUI radio input pattern
Use @mdit/plugin-tab custom renderers to emit DaisyUI tabs-lift
structure (radio inputs + tab-content divs) instead of unstyled
default output. CSS-driven, no JS required.
2026-04-27 15:28:10 +02:00
Julien Calixte
4ce8c30649 fix(navigation): support anchor fragments in note links
Links like `path/to/note.md#heading` previously errored with "Note not
found" because the full href (including `#hash`) was matched against
file paths. Split the fragment off in the link handler, plumb it through
the event bus, and scroll the matching heading into view once the
target note is in place. Headings now get GitHub-style ids via
markdown-it-anchor + github-slugger so the anchors actually exist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 09:40:30 +02:00
Julien Calixte
5f48aa5690 chore: lint and fmt 2026-03-28 09:38:55 +01:00
Julien Calixte
944b128894 feat: add icons, better suited than emojis 2026-03-17 23:43:29 +01:00
Julien Calixte
f017b4f0ff fix: remove frontmatter content before rendering 2026-02-17 01:12:47 +01:00
Julien Calixte
5c70232fba deps: upgrade 2026-02-15 08:00:11 +01:00
Julien Calixte
683187b4d1 feat: render some real content 2026-02-11 03:12:52 +01:00
Julien Calixte
9f06c97028 fix: smaller size for todo title 2026-01-19 10:55:36 +01:00
Julien Calixte
5eec8f036e fix: mermaid in dark mode as the background color is already dark 2025-12-03 15:58:56 +01:00
Julien Calixte
dc94006e21 deps: upgrade deps 2025-08-02 03:08:46 +02:00
Julien Calixte
c07964844d perf: jit initialize mermaid 2025-07-12 22:31:06 +02:00
Julien Calixte
dd5d4b04f7 perf: init shikiji only when needed and limit langs 2025-07-12 22:26:07 +02:00
Julien Calixte
8ec32552a5 fix: 🐞 flux note
reload page
2025-06-14 16:02:18 +02:00
Julien Calixte
487fedf9fa feat: isolate mermaid code 2025-06-14 10:01:09 +02:00
Julien Calixte
545baf063c design: fix some problem with iframes 2024-12-27 10:39:23 +01:00
Julien Calixte
df2ac31a8f use markdown it/katex from vscode instead 2024-12-24 10:24:47 +01:00
Julien Calixte
a590ddc871 design: fix font size in table 2024-12-24 10:13:04 +01:00
Julien Calixte
7ffd6bba80 upgrade markdown and pouchdb 2024-11-26 22:09:04 +01:00
Julien Calixte
88fca0d44e add alert note display 2024-05-29 14:01:03 +02:00
Julien Calixte
4551806b0d install and use shikiji 2024-01-09 23:48:21 +01:00
Julien Calixte
69fd413224 fix(table): fix table too wide
fix #9
2023-12-18 16:10:31 +01:00
Julien Calixte
93f7dd6ead smaller youtube frame 2023-10-07 13:19:43 +02:00
Julien Calixte
80888696c9 directly update edited content 2023-08-26 18:37:21 +02:00
Julien Calixte
971df9c45b can edit raw content 2023-08-20 14:24:38 +02:00
Julien Calixte
2cab8c8e3f autoimport with eslint now 2023-08-14 18:04:27 +02:00
Julien Calixte
c0182c7f57 ♻️ (app) 2023-08-14 14:08:10 +02:00
Julien Calixte
a50ab720c9 remove svg copy as not very used 2023-07-29 13:16:12 +02:00
Julien Calixte
2d15e1cf26 (iframe) add iframe 2023-07-18 22:37:10 +02:00
Julien Calixte
57c9808412 (latex) add latex implementation for markdown 2023-07-16 10:55:02 +02:00
Julien Calixte
d6a045f96b (twitter) implement tweets in notes 2023-07-04 23:24:41 +02:00
Julien Calixte
6c251f797d (card) make the buttons work 2023-07-02 23:25:14 +02:00
Julien Calixte
492eb5ed3b refacto and never use escape method 2023-07-02 12:29:54 +02:00
Julien Calixte
c0f1ba28db 🐛 (markdown) redo the lib for audio media 2022-01-02 14:08:41 +01:00
Julien Calixte
3a71be1225 (markdown) use audio dep in useMarkdown 2022-01-02 13:35:29 +01:00