diff --git a/docs/docs/Choices/CaptureChoice.md b/docs/docs/Choices/CaptureChoice.md index 8e7af615..6d8890c0 100644 --- a/docs/docs/Choices/CaptureChoice.md +++ b/docs/docs/Choices/CaptureChoice.md @@ -218,6 +218,9 @@ If you do not enable this, QuickAdd will default to `{{VALUE}}`, which will inse You can use [format syntax](/FormatSyntax.md) here, which allows you to use dynamic values in your capture format. 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). +If you want QuickAdd to create a brand new note that already contains an +embedded Base, use a Template choice instead. See +[Template: Create an MOC Note with a Link Dashboard](/Examples/Template_CreateMOCNoteWithLinkDashboard.md). If your capture format includes an inline `js quickadd` block and you need to transform user input, prefer reading input in script code through diff --git a/docs/docs/Choices/TemplateChoice.md b/docs/docs/Choices/TemplateChoice.md index ae38ee0c..dc0cc746 100644 --- a/docs/docs/Choices/TemplateChoice.md +++ b/docs/docs/Choices/TemplateChoice.md @@ -8,6 +8,8 @@ The template choice type is not meant to be a replacement for [Templater](https: **Template Path**. This is a path to the template you wish to insert. Paths are vault-relative; a leading `/` is ignored. QuickAdd supports markdown (`.md`), canvas (`.canvas`), and base (`.base`) templates. The created file uses the same extension as the template. +If you want a new markdown note to include a live embedded Base dashboard, see +[Template: Create an MOC Note with a Link Dashboard](/Examples/Template_CreateMOCNoteWithLinkDashboard.md). ## Optional **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. diff --git a/docs/docs/Examples/Template_CreateMOCNoteWithLinkDashboard.md b/docs/docs/Examples/Template_CreateMOCNoteWithLinkDashboard.md new file mode 100644 index 00000000..b044ffde --- /dev/null +++ b/docs/docs/Examples/Template_CreateMOCNoteWithLinkDashboard.md @@ -0,0 +1,105 @@ +--- +title: "Template: Create an MOC Note with a Link Dashboard" +--- + +Use this pattern when you want QuickAdd to create a new map-of-content note +that already contains a live Base dashboard for both backlinks and outgoing +links. + +## Why this pattern + +A Template choice can create the note and insert the dashboard in one step. +The note stays markdown, while the embedded `.base` block gives you a live view +of how that note connects to the rest of your vault. + +This works well for maps of knowledge, hub notes, topic notes, and evergreen +indexes. + +## Setup + +1. Create a reusable `.base` template, for example + `Templates/MOC Link Dashboard.base`: + +```yaml +formulas: + note_link: "file.asLink()" +properties: + formula.note_link: + displayName: Note + file.folder: + displayName: Folder + file.mtime: + displayName: Updated +views: + - type: table + name: Backlinks + filters: + and: + - 'file.ext == "md"' + - "file.hasLink(this.file)" + - "file.path != this.file.path" + order: + - formula.note_link + - file.folder + - file.mtime + - type: table + name: Outgoing links + filters: + and: + - 'file.ext == "md"' + - "this.file.hasLink(file)" + - "file.path != this.file.path" + order: + - formula.note_link + - file.folder + - file.mtime +``` + +2. Create a markdown template, for example `Templates/MOC Link Dashboard.md`: + +````markdown +--- +tags: + - moc +--- + +# {{VALUE:moc_title}} + +## Link Dashboard + +Use the view picker in this embedded base to switch between backlinks and +outgoing links for this note. + +```base +{{TEMPLATE:Templates/MOC Link Dashboard.base}} +``` + +## Notes + +- Start linking this note to related ideas. +```` + +3. Create a **Template** choice with settings like these: + +- **Template Path**: `Templates/MOC Link Dashboard.md` +- **File Name Format**: `{{VALUE:moc_title}}` +- **Create in folder**: your MOC folder, for example `MOCs` +- **Open**: enabled +- **File already exists behavior**: `Increment the file name` + +4. Run the Template choice and enter a title such as `Alpha Project`. + +## What you get + +QuickAdd creates a new markdown note with an embedded Base block. +Inside the note: + +- `Backlinks` shows notes that link to the new MOC. +- `Outgoing links` shows notes the MOC links to. +- Both views use `this.file`, so the dashboard automatically scopes itself to + the note that was just created. + +After the note exists, add links in either direction and the dashboard updates +with the current graph around that note. + +![MOC link dashboard template demo](../Images/template_moc_link_dashboard_demo.png) diff --git a/docs/docs/Images/template_moc_link_dashboard_demo.png b/docs/docs/Images/template_moc_link_dashboard_demo.png new file mode 100644 index 00000000..6db5e4bb Binary files /dev/null and b/docs/docs/Images/template_moc_link_dashboard_demo.png differ diff --git a/docs/docs/index.md b/docs/docs/index.md index 96a53583..be7b6047 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -34,6 +34,7 @@ Take a look at some examples... - [Capture: Add Journal Entry](docs/Examples/Capture_AddJournalEntry.md) - [Macro: Log book to daily journal](docs/Examples/Macro_LogBookToDailyJournal.md) - [Template: Add an Inbox Item](docs/Examples/Template_AddAnInboxItem.md) +- [Template: Create an MOC note with a link dashboard](docs/Examples/Template_CreateMOCNoteWithLinkDashboard.md) - [Macro: Move all notes with a tag to a certain folder](docs/Examples/Macro_MoveNotesWithATagToAFolder.md) - [Template: Automatically create a new book note with notes & highlights from Readwise](docs/Examples/Template_AutomaticBookNotesFromReadwise.md) - [Capture: Add a task to a Kanban board](docs/Examples/Capture_AddTaskToKanbanBoard.md) diff --git a/docs/sidebars.js b/docs/sidebars.js index 4002342c..4b9c8d28 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -117,6 +117,7 @@ const sidebars = { label: "📄 Template Examples", items: [ "Examples/Template_AddAnInboxItem", + "Examples/Template_CreateMOCNoteWithLinkDashboard", "Examples/Template_AutomaticBookNotesFromReadwise", ], },