Development

Architecture

Tagdown Editor is a Tauri v2 app:

Layer Technology Where
UI Vanilla TypeScript + Vite src/
Tagdown parser and renderer TypeScript, KaTeX, Pele (Mermaid-syntax diagrams) src/tagdown/
App commands Rust (Tauri commands) src-tauri/src/commands/
Vault, search, links, history, queries Rust (tagdown-core crate) src-tauri/core/src/
CLI and MCP server Rust (tagdown binary) src-tauri/core/src/bin/tagdown.rs, src-tauri/core/src/mcp.rs

The UI never touches the filesystem directly; it calls Tauri commands, which go through tagdown-core. The CLI and MCP server use the same crate, so the app, the command line, and AI assistants all read and write notes the same way, with the same version history.

Architecture diagram: desktop UI via Tauri commands, terminal commands and an assistant via the MCP server converge on tagdown-core, which accesses the Markdown vault and history.
The three entry points share the Rust core. Changes to vault, query or history behavior belong there so every entry point gets the same behavior.

The one thing that reaches the network is saving a web link (weblink.rs): it fetches the page with the system’s curl, http and https only, so the app carries no HTTP or TLS stack of its own.

Project layout

.
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ bootstrap.ts        # entry point: the editor, or the quick capture window
β”‚   β”œβ”€β”€ main.ts             # app shell: sidebar, note list, editor, shortcuts
β”‚   β”œβ”€β”€ commandPalette.ts   # ⌘K palette
β”‚   β”œβ”€β”€ wikilinks.ts        # title/path/alias resolution and ranked autocomplete
β”‚   β”œβ”€β”€ slashCommands.ts    # the / command menu
β”‚   β”œβ”€β”€ templatePicker.ts   # /template picker and linked-note insertion helpers
β”‚   β”œβ”€β”€ listEditing.ts      # ↩, Tab and ⇧Tab in lists (continue, nest, renumber)
β”‚   β”œβ”€β”€ blockDrag.ts        # drag-and-drop reordering of preview blocks
β”‚   β”œβ”€β”€ queries.ts          # <query /> blocks (lists, tables, boards, cards) and the open-tasks view
β”‚   β”œβ”€β”€ boardLanes.ts       # which lane a board card goes in, and moving it
β”‚   β”œβ”€β”€ tableSelection.ts   # rows ticked in a table, for setting a property on all of them
β”‚   β”œβ”€β”€ queryText.ts        # rewriting a query's text (sorting, columns)
β”‚   β”œβ”€β”€ propertiesPanel.ts  # the properties panel and its value fields
β”‚   β”œβ”€β”€ templateInheritance.ts # parent selection and inherited property switches
β”‚   β”œβ”€β”€ typeHierarchy.ts    # nested type rows and descendant matching
β”‚   β”œβ”€β”€ linkFields.ts       # properties that link to notes of another type
β”‚   β”œβ”€β”€ taskRepeat.ts       # the next task of a repeating one
β”‚   β”œβ”€β”€ taskCascade.ts      # ticking a task ticks its subtasks; unticking restores them
β”‚   β”œβ”€β”€ journal.ts          # day keys, the journal calendar, appending to a page
β”‚   β”œβ”€β”€ quickCapture.ts     # appending a capture to today's page
β”‚   β”œβ”€β”€ quickCaptureWindow.ts # the floating βŒ₯⌘J capture bar
β”‚   β”œβ”€β”€ localGraph.ts       # the βŒ˜β‡§G graph of a note's links
β”‚   β”œβ”€β”€ webLinks.ts         # saving a web link as a Link note (box and paste offer)
β”‚   β”œβ”€β”€ localImages.ts      # images copied into attachments/ and loaded from the vault
β”‚   β”œβ”€β”€ figures.ts          # the size and caption bar on figures
β”‚   β”œβ”€β”€ history.ts          # version history dialog
β”‚   β”œβ”€β”€ presentation.ts     # slides
β”‚   β”œβ”€β”€ export.ts           # HTML export and print
β”‚   β”œβ”€β”€ publish.ts          # static website publishing
β”‚   β”œβ”€β”€ settings/           # settings dialog, theme, and editor preferences
β”‚   β”œβ”€β”€ styles/             # CSS (tokens.css holds the light and dark palettes)
β”‚   └── tagdown/            # parser, renderer, blocks, slides, diagrams, syntax reference data
β”œβ”€β”€ src-tauri/
β”‚   β”œβ”€β”€ src/commands/       # Tauri commands called from the UI
β”‚   β”œβ”€β”€ src/quick_capture.rs # the global βŒ₯⌘J shortcut and capture window
β”‚   └── core/src/           # vault, vaults, folders, frontmatter, properties,
β”‚                           # search_index, links (backlinks, local graph), history,
β”‚                           # tasks, query, types (inheritance), templates (built-ins),
β”‚                           # journal (day pages, "This day"),
β”‚                           # weblink (fetching pages for Link notes), watcher,
β”‚                           # site, library, mcp
β”œβ”€β”€ scripts/gen-syntax.mjs  # generates core/src/syntax.md from the reference data
β”œβ”€β”€ tests/                  # Node tests for rendering, blocks, lists, slash commands, slides,
β”‚                           # board lanes, table selection, journal, graph layout,
β”‚                           # web links, figures, task repeats and subtasks, diagrams, syntax
└── docs/                   # this documentation

Running checks

npm run build
cargo test --manifest-path src-tauri/Cargo.toml --workspace
cargo check --manifest-path src-tauri/Cargo.toml --workspace
node --test tests/*.mjs

Preserved integrations

The experimental integrations were removed from the active app and preserved on codex/reflect-integrations, at commit 868ed08221de9a7d2f4a30620d023c57b501239f. The checkpoint contains the Integrations settings, AI editing and semantic retrieval, voice transcription, browser capture and its extension, a global capture shortcut, and calendar/meeting features, with their supporting dependencies.

The branch is a snapshot of the source at that point, including other work that was in progress. It predates the revised /template workflow. Review its changes before bringing features back individually.

To resume work in a separate checkout while keeping the current working directory intact:

git fetch origin
git worktree add -b codex/resume-integrations ../tagdown-integrations origin/codex/reflect-integrations

The active app retains in-app journal capture, saved web links, and the CLI/MCP server. Their current behavior is documented in the Journal, Organizing, and CLI and MCP guides.

The syntax reference

The Tagdown reference has one source: src/tagdown/documentation.ts. It feeds the in-app Settings β†’ Tagdown Reference and, through npm run gen:syntax, the generated src-tauri/core/src/syntax.md that the CLI and MCP server hand out. Run npm run gen:syntax after changing the reference; a test fails when the generated file is out of date.

Previewing the documentation

The docs use Jekyll and a local layout in docs/_layouts/default.html. Navigation lives in docs/_data/navigation.yml; styles and browser interactions live in docs/assets/.

With Ruby and Bundler installed, run from the repository root:

cd docs
bundle install
bundle exec jekyll serve

Open http://localhost:4000/tagdown/. To check a production build, run bundle exec jekyll build. GitHub Pages builds the same docs/ directory when changes reach main.

The explanatory diagrams in docs/images/guides/ are SVGs generated from scripts/gen-doc-visuals.mjs. Edit that source and run node scripts/gen-doc-visuals.mjs to regenerate them. Keep screenshots for app controls and diagrams for relationships or before-and-after examples; add descriptive alt text and a caption wherever a visual needs explanation.

Releasing

.github/workflows/release.yml builds a universal (Apple silicon + Intel) .dmg on GitHub Actions.

  1. Bump the version in src-tauri/tauri.conf.json, src-tauri/Cargo.toml, and package.json, and commit.
  2. Tag the commit and push the tag: git tag v0.2.0 && git push origin v0.2.0. The tag must match the tauri.conf.json version, or the build stops.
  3. The workflow attaches the .dmg to a draft release named after the tag. Check it under Releases, edit the notes, and publish.

To try the build without releasing anything, run the workflow by hand (Actions β†’ Release β†’ Run workflow). The .dmg shows up as a workflow artifact.

Signing and notarization

Without Apple credentials the app is ad-hoc signed, and users get past Gatekeeper with Open Anyway (see the README). With an Apple Developer Program membership, add these repository secrets (Settings β†’ Secrets and variables β†’ Actions) and the next build is signed and notarized, with no Gatekeeper warning:

Secret Value
APPLE_CERTIFICATE Your Developer ID Application certificate exported from Keychain Access as .p12, base64-encoded: base64 -i cert.p12 \| pbcopy
APPLE_CERTIFICATE_PASSWORD The password you set when exporting the .p12
APPLE_SIGNING_IDENTITY The certificate name, e.g. Developer ID Application: Jane Doe (AB12CD34EF); security find-identity -v -p codesigning lists it
APPLE_ID The Apple ID email of your developer account
APPLE_PASSWORD An app-specific password for that Apple ID, not your account password
APPLE_TEAM_ID Your 10-character team ID from developer.apple.com/account

The certificate pair turns on signing; the three APPLE_ID… secrets add notarization. Once a signed build ships, drop the Gatekeeper steps from the README.

Conventions

  • Commits follow Conventional Commits: feat(scope): …, fix: …, docs: …, style(ui): ….
  • Notes stay plain Markdown files. New features should keep the vault readable without the app.
  • See PROJECT_PLAN.md for the roadmap.

Search the guides

Type to search all guides.

esc to close