Skip to content

Commit d73cb26

Browse files
authored
docs: add MOC link dashboard example (#1138)
1 parent 720ee31 commit d73cb26

6 files changed

Lines changed: 112 additions & 0 deletions

File tree

docs/docs/Choices/CaptureChoice.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ If you do not enable this, QuickAdd will default to `{{VALUE}}`, which will inse
218218
You can use [format syntax](/FormatSyntax.md) here, which allows you to use dynamic values in your capture format.
219219

220220
If you want to insert `.base` content into your current note, keep **Capture to active file** enabled and use a `.base` template token in the capture format. See [Capture: Insert a Related Notes Base into an MOC Note](/Examples/Capture_InsertBaseTemplateIntoActiveFile.md).
221+
If you want QuickAdd to create a brand new note that already contains an
222+
embedded Base, use a Template choice instead. See
223+
[Template: Create an MOC Note with a Link Dashboard](/Examples/Template_CreateMOCNoteWithLinkDashboard.md).
221224

222225
If your capture format includes an inline `js quickadd` block and you need to
223226
transform user input, prefer reading input in script code through

docs/docs/Choices/TemplateChoice.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The template choice type is not meant to be a replacement for [Templater](https:
88
**Template Path**. This is a path to the template you wish to insert. Paths are vault-relative; a leading `/` is ignored.
99

1010
QuickAdd supports markdown (`.md`), canvas (`.canvas`), and base (`.base`) templates. The created file uses the same extension as the template.
11+
If you want a new markdown note to include a live embedded Base dashboard, see
12+
[Template: Create an MOC Note with a Link Dashboard](/Examples/Template_CreateMOCNoteWithLinkDashboard.md).
1113

1214
## Optional
1315
**File Name Format**. You can specify a format for the file name, which is based on the format syntax - which you can see further down this page.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: "Template: Create an MOC Note with a Link Dashboard"
3+
---
4+
5+
Use this pattern when you want QuickAdd to create a new map-of-content note
6+
that already contains a live Base dashboard for both backlinks and outgoing
7+
links.
8+
9+
## Why this pattern
10+
11+
A Template choice can create the note and insert the dashboard in one step.
12+
The note stays markdown, while the embedded `.base` block gives you a live view
13+
of how that note connects to the rest of your vault.
14+
15+
This works well for maps of knowledge, hub notes, topic notes, and evergreen
16+
indexes.
17+
18+
## Setup
19+
20+
1. Create a reusable `.base` template, for example
21+
`Templates/MOC Link Dashboard.base`:
22+
23+
```yaml
24+
formulas:
25+
note_link: "file.asLink()"
26+
properties:
27+
formula.note_link:
28+
displayName: Note
29+
file.folder:
30+
displayName: Folder
31+
file.mtime:
32+
displayName: Updated
33+
views:
34+
- type: table
35+
name: Backlinks
36+
filters:
37+
and:
38+
- 'file.ext == "md"'
39+
- "file.hasLink(this.file)"
40+
- "file.path != this.file.path"
41+
order:
42+
- formula.note_link
43+
- file.folder
44+
- file.mtime
45+
- type: table
46+
name: Outgoing links
47+
filters:
48+
and:
49+
- 'file.ext == "md"'
50+
- "this.file.hasLink(file)"
51+
- "file.path != this.file.path"
52+
order:
53+
- formula.note_link
54+
- file.folder
55+
- file.mtime
56+
```
57+
58+
2. Create a markdown template, for example `Templates/MOC Link Dashboard.md`:
59+
60+
````markdown
61+
---
62+
tags:
63+
- moc
64+
---
65+
66+
# {{VALUE:moc_title}}
67+
68+
## Link Dashboard
69+
70+
Use the view picker in this embedded base to switch between backlinks and
71+
outgoing links for this note.
72+
73+
```base
74+
{{TEMPLATE:Templates/MOC Link Dashboard.base}}
75+
```
76+
77+
## Notes
78+
79+
- Start linking this note to related ideas.
80+
````
81+
82+
3. Create a **Template** choice with settings like these:
83+
84+
- **Template Path**: `Templates/MOC Link Dashboard.md`
85+
- **File Name Format**: `{{VALUE:moc_title}}`
86+
- **Create in folder**: your MOC folder, for example `MOCs`
87+
- **Open**: enabled
88+
- **File already exists behavior**: `Increment the file name`
89+
90+
4. Run the Template choice and enter a title such as `Alpha Project`.
91+
92+
## What you get
93+
94+
QuickAdd creates a new markdown note with an embedded Base block.
95+
Inside the note:
96+
97+
- `Backlinks` shows notes that link to the new MOC.
98+
- `Outgoing links` shows notes the MOC links to.
99+
- Both views use `this.file`, so the dashboard automatically scopes itself to
100+
the note that was just created.
101+
102+
After the note exists, add links in either direction and the dashboard updates
103+
with the current graph around that note.
104+
105+
![MOC link dashboard template demo](../Images/template_moc_link_dashboard_demo.png)
85.7 KB
Loading

docs/docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Take a look at some examples...
3434
- [Capture: Add Journal Entry](docs/Examples/Capture_AddJournalEntry.md)
3535
- [Macro: Log book to daily journal](docs/Examples/Macro_LogBookToDailyJournal.md)
3636
- [Template: Add an Inbox Item](docs/Examples/Template_AddAnInboxItem.md)
37+
- [Template: Create an MOC note with a link dashboard](docs/Examples/Template_CreateMOCNoteWithLinkDashboard.md)
3738
- [Macro: Move all notes with a tag to a certain folder](docs/Examples/Macro_MoveNotesWithATagToAFolder.md)
3839
- [Template: Automatically create a new book note with notes & highlights from Readwise](docs/Examples/Template_AutomaticBookNotesFromReadwise.md)
3940
- [Capture: Add a task to a Kanban board](docs/Examples/Capture_AddTaskToKanbanBoard.md)

docs/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const sidebars = {
117117
label: "📄 Template Examples",
118118
items: [
119119
"Examples/Template_AddAnInboxItem",
120+
"Examples/Template_CreateMOCNoteWithLinkDashboard",
120121
"Examples/Template_AutomaticBookNotesFromReadwise",
121122
],
122123
},

0 commit comments

Comments
 (0)