You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS_TECHNICAL.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,18 +115,57 @@ This document explains the internal architecture, algorithms, and design decisio
115
115
116
116
## Overview
117
117
118
-
as-notes is a VS Code extension that turns `[[double bracket]]` text in markdown files into navigable links. Each wikilink maps to a `.md` file in the same directory. The extension provides highlighting, click navigation, hover tooltips, auto-creation of missing pages, and automated rename synchronisation between link text and filenames.
118
+
as-notes is a monorepo containing a VS Code extension, a shared wikilink parsing library, and an HTML conversion utility.
`vs-code-extension` and `html-conversion` both depend on `as-notes-common` via `"file:../common"` in `package.json`. This creates a symlink in `node_modules/as-notes-common` — no npm publish needed. esbuild resolves the symlink and bundles the shared code.
146
+
147
+
### VS Code extension
119
148
120
149
The extension is built with:
121
150
122
151
-**TypeScript 5.7**, strict mode, ES2022 target
123
152
-**esbuild** for bundling via custom `build.mjs` (`src/extension.ts` → `dist/extension.js`, CJS format, `vscode` external). Includes a custom `sqlJsCacheResetPlugin` that patches sql.js at bundle time — see [Manual rebuild](#manual-rebuild)
124
153
-**sql.js ^1.14.0** — WASM SQLite for the persistent index (zero native dependencies, works in VS Code remote/Codespaces)
125
-
-**vitest 3.x** for unit tests (219 tests across 8 test files)
154
+
-**vitest 3.x** for unit tests (448 tests across 13 test files)
126
155
-**VS Code API ^1.85.0** (`DocumentLinkProvider`, `HoverProvider`, `TextEditorDecorationType`, `WorkspaceEdit`)
127
156
128
157
The build script (`build.mjs`) copies the `sql-wasm.wasm` binary to `dist/` alongside the bundled extension.
129
158
159
+
### HTML conversion utility
160
+
161
+
A standalone CLI tool for converting an AS Notes workspace (markdown files with `[[wikilinks]]`) into static HTML:
162
+
163
+
-**FileResolver** — scans a directory for `.md` files, builds a case-insensitive filename→href lookup map (same semantics as the extension: spaces URL-encoded). Tracks missing targets during resolution and exposes them via `getMissingTargets()` so placeholder pages can be generated.
164
+
-**convert.ts** — CLI entry point: parses `--input <dir>` and `--output <dir>` args, wipes the output directory, runs markdown-it with the shared `wikilinkPlugin`, wraps each page in an HTML shell with `<nav>` sidebar, writes `.html` files. After converting real pages, generates placeholder pages for any missing wikilink targets with a "This page has not been created yet" message and the same nav sidebar.
165
+
-**Nav generation** — `index.html` appears as "Home", other pages sorted alphabetically. Minimal semantic markup with class names (`site-nav`, `nav-current`, `content`, `missing-page`) for future CSS styling
166
+
-**CI integration** — the `build-docs` job in `.github/workflows/ci.yml` builds and runs the conversion: `docs-src/pages/` → `docs/`
167
+
-**npm script** — `npm run convert -- --input <dir> --output <dir>` runs the built CLI from `dist/convert.js`
0 commit comments