crossnote 0.9.36 → 0.9.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +27 -14
  2. package/out/cjs/index.cjs +321 -295
  3. package/out/cli/index.cjs +753 -135
  4. package/out/esm/index.mjs +334 -308
  5. package/out/server-app/server-app.css +1 -1
  6. package/out/server-app/server-app.js +115 -7
  7. package/out/types/src/markdown-engine/index.d.ts +34 -3
  8. package/out/types/src/notebook/types.d.ts +1 -0
  9. package/out/types/src/serve/graph-host-shim.d.ts +6 -0
  10. package/out/types/src/serve/markdown-files.d.ts +1 -0
  11. package/out/types/src/serve/preview-host-shim.d.ts +1 -0
  12. package/out/types/src/server-app/components/FilePicker.d.ts +3 -1
  13. package/out/types/src/server-app/components/LayoutView.d.ts +4 -0
  14. package/out/types/src/server-app/components/PreviewFrame.d.ts +2 -1
  15. package/out/types/src/server-app/components/TabStrip.d.ts +3 -1
  16. package/out/types/src/server-app/components/TitleBar.d.ts +3 -1
  17. package/out/types/src/server-app/components/Welcome.d.ts +2 -1
  18. package/out/types/src/server-app/lib/api.d.ts +70 -10
  19. package/out/types/src/server-app/lib/preview-theme.d.ts +1 -0
  20. package/out/types/src/server-app/lib/wiki.d.ts +20 -0
  21. package/out/types/src/server-app/types.d.ts +4 -0
  22. package/out/types/src/utility.d.ts +1 -1
  23. package/out/types/src/webview/containers/preview.d.ts +1 -0
  24. package/out/types/src/webview/lib/utility.d.ts +4 -0
  25. package/out/types/src/wiki/index.d.ts +49 -1
  26. package/out/types/test/nul-character.test.d.ts +1 -0
  27. package/out/types/test/serve/markdown-files.test.d.ts +1 -0
  28. package/out/types/test/server-app/preview-theme.test.d.ts +1 -0
  29. package/out/types/test/server-app/types.test.d.ts +1 -0
  30. package/out/types/test/server-app/wiki.test.d.ts +1 -0
  31. package/out/types/tsconfig.tsbuildinfo +1 -1
  32. package/out/webview/backlinks.css +1 -1
  33. package/out/webview/backlinks.js +4 -4
  34. package/out/webview/graph-view.css +1 -1
  35. package/out/webview/graph-view.js +6 -6
  36. package/out/webview/preview.css +1 -1
  37. package/out/webview/preview.js +189 -189
  38. package/package.json +1 -1
  39. package/out/types/src/wiki-app/wiki-app.d.ts +0 -17
  40. package/out/wiki-app/wiki-app.css +0 -1
  41. package/out/wiki-app/wiki-app.js +0 -18
package/README.md CHANGED
@@ -148,9 +148,11 @@ same-origin script against the app.
148
148
  ## CLI: `crossnote build-wiki`
149
149
 
150
150
  `crossnote build-wiki` packs the directories' markdown notes into a single
151
- standalone HTML file — a read-only snapshot of the serve experience, like a
152
- TiddlyWiki: a file list with a fuzzy filter, one note at a time, and note-to-note
153
- links that keep working inside the file.
151
+ standalone HTML file — a read-only snapshot of the `serve` experience, like a
152
+ TiddlyWiki: the file embeds the serve app itself (titlebar, tabs, split panes,
153
+ `Ctrl/Cmd+P` fuzzy file picker, zen mode) with every note pre-rendered as a
154
+ regular preview page, so it looks and behaves exactly like `crossnote serve`
155
+ with the writable parts removed.
154
156
 
155
157
  ```sh
156
158
  $ npx crossnote build-wiki [directory...] # default output ./index.html
@@ -158,21 +160,32 @@ $ crossnote build-wiki ~/notes -o ~/public/wiki.html
158
160
  $ crossnote build-wiki docs wiki --vscode # reuse VS Code settings, too
159
161
  ```
160
162
 
161
- - Every note is rendered through the regular HTML export pipeline: CDN-hosted
162
- assets (KaTeX/MathJax, mermaid, wavedrom, vega, …) load when the reader is
163
- online, and local images/SVGs are embedded as data URIs so the file travels
164
- on its own (front matter `html: { embed_local_images: false }` opts out).
165
- - Notes are pre-rendered and shown inside a sandboxed iframe — the wiki has
166
- no write channel at all. Task-list checkboxes are disabled, external links
167
- open new tabs, and links to notes that are not part of the wiki explain so
168
- instead of navigating away.
163
+ - Every note is the exact preview page the serve server renders, shown in a
164
+ sandboxed (`allow-scripts`) iframe: diagrams, math, the sidebar TOC and
165
+ zoom all work. Shared assets (the webview bundle, mermaid, themes, …) are
166
+ stored once and inlined when a note is opened; local images **and remote
167
+ `http(s)` images** (fetched once per build, capped at 8 MB with a 10 s
168
+ timeout, best-effort) are embedded as data URIs, so the file renders
169
+ offline — CDN-hosted math assets still need the reader to be online.
170
+ - The wiki is read-only by construction — nothing in the file can write
171
+ anywhere. Editing UI, code-chunk run buttons and task-list checkboxes are
172
+ hidden or inert, note-to-note links resolve inside the file, external
173
+ links open new tabs, and links to notes that are not part of the wiki
174
+ explain so instead of navigating away. The graph view opens as a pane
175
+ beside the active one and backlinks resolve from data embedded at export
176
+ time — both work offline inside the file. Themes _can_ be changed from
177
+ the preview's right-click menu — every stylesheet ships in the file and
178
+ the selection persists in the browser's localStorage.
169
179
  - Config resolution is the same as `serve`
170
180
  (`defaults ← VS Code settings with --vscode ← global crossnote config ←
171
181
  <directory>/.crossnote`), per directory.
182
+ - The exported file carries no absolute paths of the machine it was built
183
+ on — notes are keyed by root-relative paths (prefixed with the root's
184
+ folder name when several roots are packed).
172
185
  - The preview context menu (in `serve` and in the VS Code extension) has an
173
- "Export standalone HTML (wiki)" item that builds the same file: the server
174
- writes it next to the notes as `crossnote-wiki.html` (never overwriting a
175
- previous export); the extension asks where to save it.
186
+ **Export ▸ Wiki** item that builds the same file: the server writes it
187
+ next to the notes as `crossnote-wiki.html` (never overwriting a previous
188
+ export); the extension asks where to save it.
176
189
 
177
190
  The file is a full snapshot — for very large note collections (thousands of
178
191
  notes with big images) it can get large; the build reports its size and any