Wikilinks

Obsidian-style [[link]] syntax in knowledge notes — how they resolve to internal /knowledge entity pages.

Knowledge notes use Obsidian-flavored double-bracket syntax to cross-reference other entities. The renderer converts these into internal links to the corresponding /knowledge/[entityId] pages.

Syntax

FormMeaningRenders as
[[repos/foo/note]]Link to repo foo<a href="/knowledge/repo-foo">repos/foo/note</a>
[[repos/foo/note|Foo]]Link with custom label<a href="/knowledge/repo-foo">Foo</a>
[[papers/bpid-2024]]Link to a paper<a href="/knowledge/paper-bpid-2024">papers/bpid-2024</a>
#tagTag (not yet rendered as link)Plain text

The pipe separator (|) introduces an optional display label — the part before the pipe is the target, the part after is what the user sees.

How conversion works

The conversion happens in frontend/app/knowledge/[entityId]/page.tsx before the Markdown is handed to react-markdown. A simple regex replaces:

/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g

…with:

<a href={convertToHref(target)}>{label ?? target}</a>

where convertToHref("repos/foo/note") yields /knowledge/repo-foo.

Why not render in place from the backend?

Notes are authored in the kb-api system and stored as plain Obsidian Markdown. Keeping wikilinks in Obsidian syntax means the same note can be:

  • Viewed in Obsidian directly (diacritics, backlinks, and graph view all work)
  • Rendered on bensevern.dev with the conversion applied
  • Copied via the Copy markdown button and pasted into another Obsidian vault

A round-trip-safe representation beats pre-rendered HTML.

If a wikilink points to an entity that no longer exists in the graph (deleted repo, renamed concept), the link still renders — clicking it lands on the /knowledge/[entityId] page, which will 404 from the backend. The link text itself stays visible so authors can spot dangling references.

  • Entity pages — where wikilinks resolve to
  • Map — how to visually find the entity you meant to link