# Links & Tags

> Connect notes with links and tags, and let DocGraph find the connections you missed.

Source: https://docs.docgraph.app/editing/links-and-tags/

## Links [!both]

*[Screenshot: Typing [[Harb in a line opens the link picker: three matching notes with their paths, and Create "Harb" to make a new page linked here.]*

Type `[[` anywhere in a page and start typing a note's name. A picker appears; choose a note and DocGraph inserts a link to it.

Links are stored as **ordinary HTML anchors** — `<a href="projects/Atlas.html">` — not a proprietary syntax. Open the file anywhere else and the links still work. In Markdown files the picker writes ordinary Markdown links, and `[[wikilinks]]` you already have (from Obsidian, say) are read too: found by name anywhere in the vault, kept up to date when you rename a note, and — for a name no note has yet — dimmed, with an offer to create the note when you follow it.

### Following links while you edit [!html]

In an HTML page you don't have to leave edit mode to follow a link. A plain click on a link opens it: an internal link opens the note (scrolled to the heading or block if the link names one), and an external one opens in your browser. To put the cursor inside a link's text and edit it instead, **⌥-click** it. A bare web address that isn't a link — `https://…` or `www.…` typed in the text — is drawn in blue with a dotted underline, and **⌘-click** opens it. ⌘-click also opens a `#tag` in the [Tags panel](https://docs.docgraph.app/panels/overview/#tags)'s **All tags** view, on that tag, and an `@name` on its page.

### Hover preview [!both]

Rest the pointer on a link to another note in your vault and a small card appears: the note's title, its path, how many links point **in** and **out**, an excerpt, and the link's type if it has one. It's there to tell you what a link leads to without opening it. Nothing shows for external links, for links to headings on the same page, or for a target the index doesn't know.

### Linking to one block [!both]

Following a link to a heading (`[[note#Heading]]`) or a block opens the note scrolled to it, and a link to a heading on the same page (`[[#Heading]]`, or any `#id` link in an HTML note) jumps there.

A note can have **other names**: `aliases: [Plan B, The Plan]` in a Markdown note's front matter, or `<meta name="docgraph:aliases" content="Plan B, The Plan">` in an HTML note's head. A `[[link]]` using an alias finds the note, and so do the `[[` picker and ⌘K. A real file name always wins over another note's alias.

Right-click a paragraph and choose **Copy link to block**. DocGraph gives the block an id if it has none — an `id` attribute in an HTML note, a trailing ` ^abc123` in a Markdown one, the way Obsidian writes it — and copies a `docgraph://open?…&block=…` link to it, which opens DocGraph on that block from any app — a chat, an email, another editor. Hold `⌥` when choosing it to copy a Markdown link, `[note](docgraph://…)`, instead. Adding the id is an ordinary edit, so ⌘Z takes it back.

Inside the vault you can also write the link yourself: `[[note#^abc123]]` in a Markdown note, or `note.html#id` as an HTML link's address.

You can also insert one from the slash menu with **Reference page**, or just write the anchor yourself.

### Typed relationships [!both]

A link can say *what kind* of connection it is, using the standard HTML `rel` attribute:

```html
<a href="decisions/Use CRDTs.html" rel="depends-on">the CRDT decision</a>
```

**Creating one.** Select the words, press `⌘L` (or use the link button in the selection toolbar) and the link prompt opens with the current address filled in. Applying it rewrites the link and **keeps any `rel` the link already has** — so you can retarget a typed link without losing its type. The prompt also has an optional **Link type** field (leave it blank for a plain link; Enter still applies), on HTML pages and Markdown notes alike. On a link that already exists the prompt shows **Remove** next to **Apply**; it unlinks the text and leaves the words in place. You can also write the `rel` attribute in `<>Source`, or ask the AI in [chat](https://docs.docgraph.app/ai/chat/): *"mark my link to evidence.html as a source"*. The AI's `set_link_rel` tool (it asks you to confirm) sets or clears the type on every link in a page that points at a given note; the type must be one the vault's ontology knows, such as `source`, `parent`, `child`, `related`, `contradicts` or `depends-on`. It only works on HTML pages.

**From the `[[` picker.** Type `[[` and a page name as usual. Enter links the highlighted page; **Tab** instead lists **Plain link** and the vault's link types, and picking one links the page with that type. Keep typing to go back to the page list.

**On the page**, a typed link shows its type as a small label after the link text, such as *depends-on*. `related`, `tag` and `nofollow` links get no label: they are the catch-all and housekeeping kinds.

**In a Markdown note** there is no `rel` attribute, so the type goes in braces straight after the link — the spelling Pandoc and other Markdown tools use:

```markdown
See [[Use CRDTs]]{rel=depends-on} and [the paper](papers/crdt.md){rel=source}.
Two types at once: [[Notes]]{rel="source related"}.
```

The braces are hidden on the page; the link carries the type. Inside code, or with a space before the `{`, they stay plain text. A whole note can also declare its relationships in its front matter: a key named after a relationship, with wikilinks as its value, links the note to each of them.

```markdown
---
depends-on: [[Auth service]]
parent: ["[[Roadmap]]", "[[Q4 goals]]"]
---
```

A value without `[[…]]` is not a link, and the front matter adds nothing to search. Renaming or moving a linked note keeps the type in both forms, and **Convert to HTML page** turns them into ordinary `rel` links (the front-matter ones as a line of links at the top of the page). The link prompt's **Link type** field and the `[[` picker's **Tab** write the braces for you; only the AI's `set_link_rel` is HTML-only.

Typed links are coloured in the [graph](https://docs.docgraph.app/graph/overview/), grouped in the [Links panel](https://docs.docgraph.app/panels/overview/#links-inbound-and-outbound), and filterable. `rel="contradicts"` is special: a pair of notes marked that way shows up in the [Problems panel](https://docs.docgraph.app/panels/overview/#problems) as something to resolve.

### Finding links you didn't make [!both]

The [Related panel](https://docs.docgraph.app/panels/overview/#related) lists **unlinked titles** — places where a note names another note by title without linking to it — with a one-click **Link** button. It needs no AI.

### Renaming and moving keeps links working [!both]

Rename or move a note — in the file tree, by dragging, or by renaming a folder — and every link to it across the vault is updated: HTML links, Markdown links and `[[wikilinks]]` (for a wikilink, the name changes), plus whiteboard embeds and links inside boards. Each link keeps its relative or absolute style, its `#heading` or `#^block` part and its link type; the rest of each file is left byte for byte as it was. A moved note's own relative links are recalculated from its new folder.

All the changed files are prepared first, so a failure changes nothing on disk, and the whole rename can be undone.

### Where links show up [!both]

Every link feeds the [graph](https://docs.docgraph.app/graph/overview/), the **Links** panel (its **In** / **Out** switch), and the *Referenced by* block at the foot of a note. A link to a file that doesn't exist is reported in [Problems](https://docs.docgraph.app/panels/overview/#problems).

## Tags [!partial]

Type `#` followed by a word — `#project`, `#reading` — and it becomes a tag. Inline tags are part of the file's text, so they're searchable and travel with the note. A note can also declare tags without writing them in the text: `tags: [a, b]` in a Markdown note's front matter, or `<meta name="keywords" content="a, b">` in an HTML note's head.

Typing `#` and a few letters opens a suggestion list of the tags already in your vault, with how many times each is used; pick one to complete it. In an HTML note, a tag the vault doesn't have yet gets a row reading `#yourtag` · **Create new**. In a `.md` note the list offers existing tags only, and there's no tag chip.

Search for a tag with `#` in the command palette (`⌘K`) to list every tag with its count, then drill into the files carrying one.

The [Tags panel](https://docs.docgraph.app/panels/overview/#tags) shows all of a note's tags together, including two kinds that *aren't* in the file: tags you add from the panel, and tags the AI suggests. Those are stored beside the vault and never modify your document — which also means they aren't found by full-text search.

### Tags from a `tags` property [!both]

A `tags` [page property](https://docs.docgraph.app/panels/properties/) — a list, or text with the tags separated by commas or spaces, `#` optional — counts as the note's tags too: the Tags panel, `tag:` search and the graph all see them. In the Tags panel their chip has a list icon ("From the note's tags property") and no remove button; change them by editing the property. Renaming a tag across the vault doesn't rewrite property values.

## Dates [!partial]

Type `@@` anywhere in a page — a paragraph, a heading, a list item — and a date menu opens: **Today**, **Tomorrow**, **In 3 days**, **Next week** and **Next Monday**, plus timed rows such as **This afternoon** and **Tomorrow morning** while they're still ahead, and **Pick a date & time…** for a calendar. You can also keep typing in plain words — `@@friday 5pm`, `@@next tuesday` — and the menu offers the date that phrase means.

Whatever you pick, what lands in the file is a fixed date, such as `@@2026-10-02` or `@@2026-10-02T17:00+02:00` with a time. It never re-evaluates, so "tomorrow" stays the day you meant. In an HTML note the date shows as a 📅 chip with the `@@` hidden; click the chip to change the date. **Settings → General → Editor → Dates** changes only how it's displayed.

A bare `@@date` **dates** the text, it is not a deadline: it says the text is about that day. Dated text shows in the [Timeline](https://docs.docgraph.app/panels/timeline/) and, in later years, under **On this day** in the [Calendar](https://docs.docgraph.app/panels/overview/#calendar). To give a todo a deadline, write `due:` before it — see [Task tokens](https://docs.docgraph.app/panels/task-tokens/).

In a `.md` note `@@` works too, with a shorter menu — **Today**, **Tomorrow**, **In 3 days**, **Next week** and whatever date you typed — and no time rows or calendar.

## Mentions [!partial]

Type `@` followed by a name — `@omar`, `@acme`, `@lisbon` — to mention someone or something. A suggestion list offers the names already in your vault. A mention is plain text in your file; it shows as a chip in DocGraph. In a `.md` note the suggestion list works too and `@names` feed the Mentions panel, but there's no chip or ⌘-click.

Dates are not mentions. If what you type after a single `@` reads as a date — `@friday`, `@2026-10-18` — the last row of the list offers it **as a date**, which writes the `@@` form. It is never the first row, so pressing Enter on a half-typed name like `@mar` never turns it into March.

Every name becomes one of your vault's @mentions: the [Mentions panel](https://docs.docgraph.app/panels/mentions/) lists them, each with a kind (person, organisation, place, project, or one you add). A page collects everything about one of them, and for a person a 1:1 note carries your action items from one meeting to the next. In an HTML note, hovering an `@name` chip shows a card about it, and ⌘-click opens its page.

## Something to know about portability

Links and inline `#hashtags` live in your files. [Properties](https://docs.docgraph.app/panels/properties/) and panel-added tags live beside the vault in `.docgraph/`. Both travel if you copy the whole vault; only the first survives copying a single note out on its own.
