Build your personal knowledge base with Trilium Notes
How the documentation is produced and consumed
The trees
| Tree | Root noteId | Source | Generated from it |
|---|---|---|---|
| User Guide | pOsGYCXsbNQG |
docs/User Guide/ (Markdown + !!!meta.json) |
apps/server/src/assets/help/help_meta.json (the tree) + help_content.json (each page's HTML, keyed by _help_<noteId>); site/user-guide on the docs site |
| Developer Guide | jdjRLhLV3TtI |
docs/Developer Guide/ |
site/developer-guide |
| Release Notes | hD3V4hiu2VW4 |
docs/Release Notes/ |
the GitHub release body (scripts/release-notes-body.mts, release.yml) |
edit-docs-config.yaml at the repo root is the single list of these mappings; both the editor and the
headless sync read it.
The round trip
pnpm edit-docs:edit-docs (apps/edit-docs/src/edit-docs.ts) zips every non-exportOnly mapping,
imports it into an in-memory database with preserveIds: true, opens an Electron window, and — 10 s
after any entity change — rm -rfs every mapping's directory and re-exports it from the
database as Markdown, then derives the two help artifacts from the User Guide's export (the
helpMeta / helpContent keys of its mapping). Nothing exports on close, and an
untouched session writes nothing.
pnpm edit-docs:sync-docs (apps/edit-docs/src/sync-docs.ts, docs.mjs sync) is the same import
and the same export with no window: apps/edit-docs/src/docs_pipeline.ts holds the shared code.
Running it on a clean tree is byte-stable; running it after a hand edit normalizes the Markdown the
way the editor would (the import renders Markdown to HTML, the export turns it back) and regenerates
both help artifacts. ~7 s.
Consequences:
- The import resolves every relative
.mdlink to a noteId; the export re-derives paths and file names from titles. So a rename or move only needs the title/entry changed — links, attachment file names and folder names follow on the next sync. - A file in no
!!!meta.jsonentry is deleted by the export; a.mdin an existing folder with no entry makes the import throw (Cannot find parentNoteId). Tree-shape changes go throughdocs.mjs new/image/rename/move/delete, which write the entry. - The export adds
# <title>when the body does not start with it; the importer removes a matching first H1 and demotes a differing one. internalLink/imageLinkrelations are never in the meta — they are rebuilt from content.pnpm docs:build(apps/build-docs) is the site build: it importsdocs/again and share-exports it tosite/, ignoringedit-docs-config.yaml. It is not a way to regenerate the help artifacts.
!!!meta.json (formatVersion 2)
{ formatVersion: 2, files: [rootEntry] }, written 4-space indented, key order isClone, noteId, notePath, title, notePosition, prefix, isExpanded, type, mime, attributes, format, dataFileName, attachments, dirFileName, children. Types: packages/trilium-core/src/meta.ts; producer
services/export/zip.ts (createNoteMeta); consumer services/import/zip.ts (getMeta).
noteId: 12 chars[A-Za-z0-9](newEntityId()). Kept on import. Permanent once the app or a page links it.notePath: ancestor noteIds from the tree root down to the entry.notePosition: multiples of 10, ascending withinchildren(ties allowed); the root is forced to 1.type/mime:text/text/htmlfor a page (text/markdownis a legacy mime on 71 older pages);webViewfor the Script/REST API frames (webViewSrc);codefor a few.js/.jsx/.jsonnotes;bookfor the Breaking-changes folder.format: "markdown"on every text entry (that is what makes the importer render the file).dataFileName:sanitize(title) + ".md"; absent for a folder note with empty content (13 in the User Guide).dirFileName:sanitize(title), present only withchildren.sanitizestrips/ \ : * ? " < > |.attributes[]: owned labels/relations{type, name, value, isInheritable, position}. In the User Guide:shareAlias(295),iconClass(254, allbx …),webViewSrc(7),sorted(3), and on the rootlabel:shareAlias(the promoted "Slug" field, inheritable) andreadOnly.attachments[]:{attachmentId, title, role: "image", mime, position: 10, dataFileName}sorted byattachmentId; file<page base>_<title>,N_prefixed when the directory already has that name.isClone: trueentries (2) carry onlynoteId, notePath, title, prefix, dataFileName: "<Title>.clone.md", type, format, isExpanded— the same noteId appears twice in the tree.
What the app reads
- In-app help (
F1, help buttons):help_meta.jsonis aHiddenSubtreeItem[](not a NoteMetaFile) built byapps/edit-docs/src/help_meta_generator.ts: each page becomes_help_<noteId>with its own type,#docUrl(the alias chain, absent without ashareAlias) and#iconClass.help_content.json(help_bundle_generator.ts) maps each ID to its HTML, with links rewritten to#root/_help_<noteId>and assets to{{helpAssets}}/<path>. The pages are virtual notes:in_app_help.tsin core registers a provider that builds the_helpsubtree in becca on every load — never stored in the database, never synced, read-only. Server/desktop read both files throughapps/server/src/in_app_help_provider.ts, standalone/mobile throughapps/standalone/src/lightweight/in_app_help_provider.ts. Images stay indocs/User Guide/; thein-app-helpskill covers how each platform serves them. - Help buttons link by noteId (
<HelpButton helpPage="…">→openInAppHelpFromUrl→_help_<id>;Modal helpPageId;services/in_app_help.tsmaps note types, collection views and sidebar sections). ~60 IDs are hard-coded inapps/client/src;docs.mjs showlists them per page andcheckfails when one points nowhere.apps/client/src/services/in_app_help.spec.tsis the CI guard for thein_app_help.tsmaps againsthelp_meta.json. - Public URL =
https://docs.triliumnotes.org+/+ each ancestor'sshareAlias(ancestors without one contribute nothing). Unique as a full path, not globally (troubleshootingis used three times). Hard-coded inREADME.md(mirrored to 40 translated READMEs by CI),apps/website,apps/web-clipper, the about dialog;checkresolves every literal against the alias chains. - Search docs examples:
packages/trilium-core/src/services/search/docs_examples.spec.tsrequires every query shown inNavigation/Search.mdandQuick search.mdto have a test. - LLM tools read the
_helpvirtual notes through becca and search them with the application's own search (packages/trilium-core/src/services/llm/tools/help_tools.ts).
The few hand-written system snippets (launch-bar and hidden-note docs) are not part of the User
Guide: apps/client/src/services/doc_renderer.ts renders them from the client catalogue's
doc_notes keys, selected by a #docName label.
What the site build reads
.github/workflows/deploy-docs.yml runs pnpm docs:build on pushes to main/stable and on PRs
touching docs/**, apps/edit-docs/**, apps/build-docs/** or packages/share-theme/**, validates
only that site/index.html and site/developer-guide/index.html exist, and deploys to Cloudflare
Pages. No link or image check runs anywhere in CI — docs.mjs check is the only one.
Where features are documented (a map for impact)
Settings panes → Basic Concepts and Features/UI Elements/Options.md plus the feature's own page
(Appearance → Themes.md, UI Elements/{New Layout, Ribbon, Zoom, Content width}.md; Shortcuts →
Keyboard Shortcuts.md; Text notes → Note Types/Text/*; Code notes → Note Types/Code.md; Images →
Note Types/Text/Images.md, Advanced Usage/Text Extraction (OCR).md; Spellcheck → Note Types/Text/ Spell Check.md; Password/TOTP → Installation & Setup/Server Installation/*; ETAPI → Advanced Usage/ETAPI (REST API).md; Backup → Installation & Setup/Backup.md; Sync → Installation & Setup/ Synchronization.md; AI → AI.md, AI/*). Ribbon, launcher bar, right sidebar, tabs, split view,
floating buttons, note tree, global menu → Basic Concepts and Features/UI Elements/*. Note types →
Note Types/<type>.md; collection views → Collections/<view>.md; search → Basic Concepts and Features/Navigation/{Search, Quick search, Jump to & command palette}.md; attributes → Advanced Usage/Attributes/*; import/export → Basic Concepts and Features/Import & Export/*; scripting →
Scripting/*; themes/icon packs → Theme development/*; desktop/mobile → Installation & Setup/ {Desktop Installation, Mobile Frontend}.md. Feature Highlights.md is a per-version list of major
features the maintainer curates at release time.