From 7c2bbd69788674b076350d67046d036005edb223 Mon Sep 17 00:00:00 2001 From: Mark Choi Date: Tue, 14 Jun 2022 01:33:34 +0900 Subject: [PATCH 1/4] chore: refactor dendron.topic.refactoring --- vault/dendron.ref.commands.md | 10 +- ...dron.roadmap.project.n.2020.multi-vault.md | 4 +- vault/dendron.topic.code-actions.md | 4 +- vault/dendron.topic.links.md | 4 +- vault/dendron.topic.multi-vault.md | 4 +- ...topic.refactoring.commands.convert-link.md | 53 ++++++ vault/dendron.topic.refactoring.commands.md | 34 ++++ ....topic.refactoring.commands.move-header.md | 30 +++ ...on.topic.refactoring.commands.move-note.md | 33 ++++ ...refactoring.commands.refactor-hierarchy.md | 87 +++++++++ ...opic.refactoring.commands.rename-header.md | 30 +++ ....topic.refactoring.commands.rename-note.md | 58 ++++++ vault/dendron.topic.refactoring.md | 176 ++---------------- vault/dendron.topic.tags.md | 4 +- vault/dendron.topic.teams.md | 6 +- vault/dendron.tutorial.linking-notes.md | 10 +- 16 files changed, 361 insertions(+), 186 deletions(-) create mode 100644 vault/dendron.topic.refactoring.commands.convert-link.md create mode 100644 vault/dendron.topic.refactoring.commands.md create mode 100644 vault/dendron.topic.refactoring.commands.move-header.md create mode 100644 vault/dendron.topic.refactoring.commands.move-note.md create mode 100644 vault/dendron.topic.refactoring.commands.refactor-hierarchy.md create mode 100644 vault/dendron.topic.refactoring.commands.rename-header.md create mode 100644 vault/dendron.topic.refactoring.commands.rename-note.md diff --git a/vault/dendron.ref.commands.md b/vault/dendron.ref.commands.md index b27213c1f..cb910bd4d 100644 --- a/vault/dendron.ref.commands.md +++ b/vault/dendron.ref.commands.md @@ -2,7 +2,7 @@ id: eea2b078-1acc-4071-a14e-18299fc28f47 title: Commands desc: "" -updated: 1655306976878 +updated: 1655740491760 created: 1595261816971 nav_order: 3.1 --- @@ -282,7 +282,7 @@ Running it in the note `recipe.eggs` will insert the following at cursor positio ### Move Note -![[dendron://dendron.dendron-site/dendron.topic.refactoring#move-note,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.move-note#summary,1:#*]] ### Paste Link @@ -290,7 +290,7 @@ Transform URL in clipboard to nicely formatted Markdown link ### Convert Link -![[dendron://dendron.dendron-site/dendron.topic.refactoring#convert-link,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.convert-link#summary,1:#*]] ### Random Note @@ -759,7 +759,7 @@ Dendron recognises a new Markdown file created from VS Code context menu and pop #### Rename Note -![[dendron://dendron.dendron-site/dendron.topic.refactoring#rename-note,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note#summary,1:#*]] ### Header Operations @@ -771,7 +771,7 @@ A header action is announced by a lightbulb when the cursor is within a header. #### Rename Header -![[dendron://dendron.dendron-site/dendron.topic.refactoring#rename-header,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-header#summary,1:#*]] #### Copy Header Reference diff --git a/vault/dendron.roadmap.project.n.2020.multi-vault.md b/vault/dendron.roadmap.project.n.2020.multi-vault.md index d20ae2bc6..c4abb406f 100644 --- a/vault/dendron.roadmap.project.n.2020.multi-vault.md +++ b/vault/dendron.roadmap.project.n.2020.multi-vault.md @@ -2,7 +2,7 @@ id: 45cfb9f2-46cf-4f67-a41e-834818fbd06e title: Multi Vault Support desc: '' -updated: 1640796114452 +updated: 1655136035164 created: 1599501659137 stub: false start: 2020.10.07 @@ -132,7 +132,7 @@ Cloning is the act of checking out a workspace on another machine. To clone, Den This can be done with the `Move Note` command. -![[dendron://dendron.dendron-site/dendron.topic.refactoring#move-note,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.move-note#summary,1:#*]] ### Publishing Notes diff --git a/vault/dendron.topic.code-actions.md b/vault/dendron.topic.code-actions.md index 7105d4e08..872d5e7fb 100644 --- a/vault/dendron.topic.code-actions.md +++ b/vault/dendron.topic.code-actions.md @@ -2,7 +2,7 @@ id: 2gHesjl7XP5Q9QNJWRv7E title: Code Actions desc: '' -updated: 1640446800793 +updated: 1655136128851 created: 1640418773306 --- @@ -13,7 +13,7 @@ Code actions provide quick fixes and refactoring capabilities in the editor. For ## Commands ### Rename Symbol -![[dendron://dendron.dendron-site/Rename Symbol|dendron.topic.refactoring#rename-symbol,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note#renaming-a-note-that-is-linked-using-rename-symbol,1]] ### Rename Header diff --git a/vault/dendron.topic.links.md b/vault/dendron.topic.links.md index 276f5b772..f90290591 100644 --- a/vault/dendron.topic.links.md +++ b/vault/dendron.topic.links.md @@ -2,7 +2,7 @@ id: 3472226a-ff3c-432d-bf5d-10926f39f6c2 title: Links desc: '' -updated: 1655251218643 +updated: 1655740511986 created: 1595003088839 --- @@ -106,6 +106,6 @@ Markdown links can be used for local files and stuff on the internet (websites, ### Convert Link -![[dendron://dendron.dendron-site/dendron.topic.refactoring#convert-link,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.convert-link#summary,1:#*]] diff --git a/vault/dendron.topic.multi-vault.md b/vault/dendron.topic.multi-vault.md index ea6ff44a2..509956352 100644 --- a/vault/dendron.topic.multi-vault.md +++ b/vault/dendron.topic.multi-vault.md @@ -2,7 +2,7 @@ id: 24b176f1-685d-44e1-a1b0-1704b1a92ca0 title: Multi Vault desc: '' -updated: 1655317757328 +updated: 1655740525819 created: 1605630383515 --- @@ -50,7 +50,7 @@ lookupConfirmVaultOnCreate: true This can be done with the `Move Note` command. -![[dendron://dendron.dendron-site/dendron.topic.refactoring#move-note,1:#*]] +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.move-note#summary,1:#*]] ### Navigating Links diff --git a/vault/dendron.topic.refactoring.commands.convert-link.md b/vault/dendron.topic.refactoring.commands.convert-link.md new file mode 100644 index 000000000..0c388df85 --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.convert-link.md @@ -0,0 +1,53 @@ +--- +id: u8qgpl5l7r4t001meo0n0qr +title: 'Dendron: Convert Link' +desc: Convert selected link to other types of links or plaintext. +updated: 1655131992450 +created: 1655131185651 +commandId: dendron.convertLink +keybindings: + mac: none + windows: none + linux: none +--- + +## Summary +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + +{{fm.title}} is a command that lets you select a link and convert it to various other types of links. + +This command works on both broken and valid links, and provide different capabilities depending on the validity of the selected link. + +### Broken links + +Broken links are links that do not point to an existing note. + +You can use **{{fm.title}}** to convert broken links into either plaintext or a different link to an existing note. + +These are the available options for converting broken links: +- `alias`: Convert to the selected link's alias text. If the selected link does not have an alias, this option is not suggested. +- `note name`: Convert to the selected link's destination note name (basename excluding all parent hierarchies) +- `hierarchy`: Convert to the selected link's entire hierarchy string +- `prompt`: Convert to the text that the user provides. +- `change destination`: Convert the link to point to another note that exists. You will be prompted a lookup to select a valid note. + +### Valid links + +Valid links are links that point to an existing note. + +You can use **{{fm.title}}** to convert a limited set of valid links to other types of links. + +These are the available operations for valid links: +- when cursor is above a usertag, user is asked if they want to convert it to a regular wikilink. +- when cursor is above a regular wikilink with `user.*` hierarchy, user is asked if they want to convert it to a usertag (e.g. `@person`) +- when cursor is above a hashtag, user is asked if they want to convert it to a regular wikilink. +- when cursor is above a regular wikilink with `tags.*` hierarchy, user is asked if they want to convert it to a hashtag (e.g. `#my.tag`) diff --git a/vault/dendron.topic.refactoring.commands.md b/vault/dendron.topic.refactoring.commands.md new file mode 100644 index 000000000..b8f201dad --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.md @@ -0,0 +1,34 @@ +--- +id: 45ecrq7l5z9l1vpwtr05q3h +title: Commands +desc: '' +updated: 1655133020474 +created: 1655109346797 +config: + global: + enableChildLinks: false +--- + +## Rename note + +![[dendron.topic.refactoring.commands.rename-note]] + +## Move Note + +![[dendron.topic.refactoring.commands.move-note]] + +## Refactor Hierarchy + +![[dendron.topic.refactoring.commands.refactor-hierarchy]] + +## Move Header + +![[dendron.topic.refactoring.commands.move-header]] + +## Rename Header + +![[dendron.topic.refactoring.commands.rename-header]] + +## Convert Link + +![[dendron.topic.refactoring.commands.convert-link]] diff --git a/vault/dendron.topic.refactoring.commands.move-header.md b/vault/dendron.topic.refactoring.commands.move-header.md new file mode 100644 index 000000000..816ea65ac --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.move-header.md @@ -0,0 +1,30 @@ +--- +id: hdnewljy94gvsnlwwwft6zq +title: 'Dendron: Move Header' +desc: Move the selected header to another note. +updated: 1655130677907 +created: 1655130405782 +commandId: dendron.moveHeader +keybindings: + mac: none + windows: none + linux: none +--- + +## Summary +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + +{{fm.title}} is a command that lets you select a header from a note, remove it, and append it to the end of the destination note. + +All wikilinks that point to the moved header will be automatically updated to point to the new header that was appended to the destination note. + +If the destination note does not exist yet, it will be created before appending the selected header. diff --git a/vault/dendron.topic.refactoring.commands.move-note.md b/vault/dendron.topic.refactoring.commands.move-note.md new file mode 100644 index 000000000..d4ec7da0d --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.move-note.md @@ -0,0 +1,33 @@ +--- +id: 98ywiw4211q9sx0v98lbo88 +title: 'Dendron: Move Note' +desc: Move a note to another vault and update all backlinks to that note. +updated: 1655129619728 +created: 1655129267874 +commandId: dendron.moveNote +keybindings: + mac: none + windows: none + linux: none +--- + +> Dendron will not allow you to move a note if a note already exists in the destination. + +> If you are looking to move a note within a hierarchy in one vault, or simply rename the note, use [[dendron.topic.refactoring.commands.rename-note]] instead. + +## Summary +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + +{{fm.title}} is a command that lets you move a note between vaults when in a [[Multi-vault|dendron://dendron.dendron-site/dendron.topic.multi-vault]] workspace, and will also update all references in other notes of that note. + +## Moving a note using the file explorer +You can also select **{{fm.title}}** after right clicking on a note in the explorer to move that note. This will also update the backlinks as well. diff --git a/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md b/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md new file mode 100644 index 000000000..0905c03a5 --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md @@ -0,0 +1,87 @@ +--- +id: 9zwkp44wnlaa8p8dpt4w8tq +title: 'Dendron: Refactor Hierarchy' +desc: Rename multiple notes using regular expressions. +updated: 1655130388659 +created: 1655129668280 +commandId: dendron.refactorHierarchy +keybindings: + mac: none + windows: none + linux: none +--- + +## Summary +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + +{{fm.title}} is a command that works like [[Dendron: Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note]], but on multiple notes. To specify which note should be renamed, you will be prompted for three inputs: + +- Scope: The set of notes you want to apply the regular expression to. +- Match text: Regular expression that matches text you want to capture for replacement. +- Replace text: Given what has been captured with the match text, what the replaced hierarchy should look like. + - This will provide a preview of renames, allowing you to confirm that the change is as expected before actually executuing the rename operations. + +### Scope + +{{fm.title}} will first prompt you to decide the scope of the operation. + +- If you have a selection in your active editor that contains at least one wikilink, the command will prompt you if you want to use the notes in the selection as the scope of refactor. +- If you do not wish to limit the scope with selection, don't select anything in your active note. The behavior will default to the entire workspace and you will not be asked to determine the scope of refactor. + +### Match text + +This text will be used to match and capture the parts of note's hierarchy string for each note within the scope. If you leave this blank, the command will match and capture the entire hierarchy. + +For example, + +Given a set of notes: + +```md +- dendron.foo +- dendron.fries +- dendron.bar +- dendron.egg +- dendron.tree +- topic.cooking +- topic.gardening +``` + +The match text `(dendron)\.(.*)` will match all notes under the `dendron.` hierarchy. + +Notice the parentheses in the regular expression. These are capture groups. +The first and second capture group `(dendron)` and `(.*)` will later be accessible in the `Replace text` prompt as `$1` and `$2` respectively. + +See [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to learn more about the regular expressions you can use to match and capture parts of your hierarchy. + +### Replace text + +This text will be used to replace the hierarchy of the notes that matched with `match text`. If you omit the replace text, Dendron will prompt for one until you provide one or cancel the operation. + +Continuing with the above example, if the replace text is `awesome.$2.$1`, the result of refactoring would be: + +```md +- awesome.foo.dendron +- awesome.fries.dendron +- awesome.bar.dendron +- awesome.egg.dendron +- awesome.tree.dendron +- topic.cooking +- topic.gardening +``` + +Recall that part of our match text were capture groups. The first and second capture group is available here as `$1` and `$2` respectively. + +### Refactor Preview + +After providing the three inputs after running {{fm.title}}, Dendron will open a preview that shows all files that will be affected if you confirm. You will be given an option in a dropdown to either proceed with the refactor or cancel the operation. + +- NOTE: Dendron will warn you if refactoring will overwrite existing files. You will need to either change your `replace text` or move the affected files before Dendron will perform a refactor. If the preview shows any overwrites, Dendron will not allow you to proceed. diff --git a/vault/dendron.topic.refactoring.commands.rename-header.md b/vault/dendron.topic.refactoring.commands.rename-header.md new file mode 100644 index 000000000..05b1da33d --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.rename-header.md @@ -0,0 +1,30 @@ +--- +id: 58rjapuyn1yjjcrf9sh6fby +title: 'Dendron: Rename Header' +desc: Rename a header and update all backlinks to that note. +updated: 1655131172684 +created: 1655130651647 +commandId: dendron.renameHeader +keybindings: + mac: none + windows: none + linux: none +--- + +## Summary +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + +{{fm.title}} is a command that lets you select a header and rename it. All wikilinks pointing to this header will be automatically update to the new header. + +When selecting the header, you must put the caret on the header you want to rename. + +Having the cursor within a header will also show a lightbulb for the [[Contextual UI Header Operations|dendron://dendron.dendron-site/dendron.ref.commands#header-operations]], which includes a quick fix item call `Rename Header` diff --git a/vault/dendron.topic.refactoring.commands.rename-note.md b/vault/dendron.topic.refactoring.commands.rename-note.md new file mode 100644 index 000000000..657e27289 --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.rename-note.md @@ -0,0 +1,58 @@ +--- +id: g0iqmyiyxje6ndjmecshb8b +title: 'Dendron: Rename Note' +desc: Rename a note and update all backlinks to that note. +updated: 1655136188599 +created: 1655109426539 +commandId: dendron.renameNote +keybindings: + mac: none + windows: none + linux: none +--- + +> Dendron will not allow you to rename a note to a note that already exists + +> If you are looking to move a note to a different vault while keeping the same name in a [[dendron.topic.multi-vault]] workspace, use [[Move Note|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.move-note]] instead. + +## Summary +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + +![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command-rename.gif) + +{{fm.title}} is a command that lets you rename a note. When renaming, it will also update all references in other notes of that note. + +### Title generation +If the title of the note is the default title that Dendron generated when the note was created, this command will also create a new title as if a new note was created with the renamed filename. + +Otherwise (if the note's title is anything other than the Dendron-generated title), renaming a note will not change the title of that note. + +### Renaming from the file explorer +You can also select **{{fm.title}}** after right clicking on a note in the explorer to rename that note. This will also update the backlinks as well. + +See the following [video](https://www.loom.com/share/dcc2df8f598a463894278f9b5926a92e) to learn more about how to rename a Dendron note in the file explorer. + +Please note that using the `rename` command in the menu that VSCode provides will not update the backlinks and only rename the selected file. + +### Renaming a note that is linked using `Rename Symbol` + +Dendron makes use of the [VS Code `Rename Symbol` command](https://code.visualstudio.com/docs/editor/refactoring#_rename-symbol) (`F2`) to perform the equivelant of `Rename Note` on a [[wikilink|dendron://dendron.dendron-site/dendron.topic.links#wiki-links]]. + +- Place the cursor inside a wikilink +- Press `F2` (or the command `Rename Symbol`) + +`Rename Symbol` will rename the note that the wikilink is referencing, and updates all the backlinks as if you opened the linked note and used **{{fm.title}}**. + +Dendron currently supports the following symbols: + +- [[Wiki Links|dendron://dendron.dendron-site/dendron.topic.links#wiki-links]] +- [[File Links|dendron://dendron.dendron-site/dendron.topic.links#file-links]] diff --git a/vault/dendron.topic.refactoring.md b/vault/dendron.topic.refactoring.md index f1d7347b4..72cf35adc 100644 --- a/vault/dendron.topic.refactoring.md +++ b/vault/dendron.topic.refactoring.md @@ -2,175 +2,25 @@ id: srajljj10V2dl19nCSFiC title: Refactoring desc: '' -updated: 1641845401310 +updated: 1655132195560 created: 1638900089932 --- ## Summary -Features that help update the structure of Dendron +Features that help update the structure of Dendron. -## Notes and Hierarchies +## Use Cases -### Rename Note +- Renaming a note. +- Renaming a linked note. +- Moving a note. +- Refactoring a hierarchy. +- Moving a Markdown header. +- Renaming a Markdown header. +- Converting a link. -> If looking to move a note to a different vault, within a [[dendron.topic.multi-vault]] workspace, use [[Move Note|dendron://dendron.dendron-site/dendron.topic.refactoring#move-note]] instead. +## Getting Started -- shortcuts: none - -Rename a note and all backlinks. - -If the title is the same as what Dendron would autogenerate (kebab-case capitalized), then refactor will change the title as well. Otherwise, it will preserve the existing title. - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command-rename.gif) - -You can also rename a note from the explorer, and all of the backlinks to that note will be updated automatically (see an [example loom video](https://www.loom.com/share/dcc2df8f598a463894278f9b5926a92e)): - -- Right Click on the note -- Select `Dendron: Rename Note` - -> NOTE: Dendron will not allow you to rename a note to a note that already exists - -#### Rename Symbol - -Dendron makes use of the [VS Code `Rename Symbol` command](https://code.visualstudio.com/docs/editor/refactoring#_rename-symbol) (`F2`) to do the equivelant of `Rename Note` on a wikilink. - -- Place the cursor in a wikilink -- Press `F2` (or the command `Rename Symbol`) - -`Rename Symbol` will rename the note that the wikilink is referencing, and updates all the backlinks. - -Dendron currently supports the following symbols: - -- [[Wiki Links|dendron://dendron.dendron-site/dendron.topic.links#wiki-links]] -- [[File Links|dendron://dendron.dendron-site/dendron.topic.links#file-links]] - -### Move Note - -> If looking to move a note within a hierarchy in a local vault, or just to rename the note, use [[Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring#rename-note]] - -- shortcuts: none - -Move a note between vaults when in a [[dendron://dendron.dendron-site/dendron.topic.multi-vault]] workspace, and update all backlinks. - -You can also move a note from the explorer, and all of the backlinks to that note will be updated automatically: - -- Right Click on the note -- Select `Dendron: Move Note` - -> NOTE: Dendron will not allow you to move a note to a note that already exists - -### Refactor Hierarchy - -- shortcuts: none - -Update hierarchy using regular expressions. - -This command works like `Rename Note` but on multiple notes. When using this command you will be prompted for three inputs: - -- Scope: The set of notes you want to apply the operations to. -- Match text: Regular expression that matches text you want to capture for replacement. -- Replace text: Given what has been captured with the match text, what the replaced hierarchy should look like. - - This will provide a preview of renames, allowing you to confirm that the change is as expected. - -#### Scope - -The command will first prompt you to decide the scope of the operation. - -- If you have a selection in your active editor that contains at least one wikilink, the command will prompt you if you want to use the notes in the selection as the scope of refactor. -- If you do not wish to limit the scope with selection, don't select anything in your active note. The behavior will default to the entire workspace and you will not be asked to determine the scope of refactor. - -#### Match text - -This text will be used to match and capture the parts of each note's hierarchy within the scope. If you leave this blank, the command will match and capture the entire hierarchy. - -For example, - -Given a set of notes: - -```md -- dendron.foo -- dendron.fries -- dendron.bar -- dendron.egg -- dendron.tree -- topic.cooking -- topic.gardening -``` - -The match text `(dendron)\.(.*)` will match all notes under the `dendron.` hierarchy. -The first and second capture group `(dendron)` and `(.*)` will later be accessible in the `Replace text` prompt as `$1` and `$2` respectively. - -See [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to learn more about the regular expressions you can use to match and capture parts of your hierarchy. - -#### Replace text - -This text will be used to replace the hierarchy of the notes that matched with `match text`. If you omit the replace text, Dendron will prompt for one until you provide one or cancel the operation. - -Continuing with the above example, if the replace text is `awesome.$2.$1`, the result of refactoring would be: - -```md -- awesome.foo.dendron -- awesome.fries.dendron -- awesome.bar.dendron -- awesome.egg.dendron -- awesome.tree.dendron -- topic.cooking -- topic.gardening -``` - -#### Refactor Preview - -After running the command, you will be taken to a preview that shows all files that will be affected. You will be given an option in a dropdown to either proceed with the refactor or cancel the operation. - -- NOTE: Dendron will warn you if refactoring will overwrite existing files. You will need to either change your `replace text` or move the affected files before Dendron will perform a refactor. - -## Headers - -### Move Header - -- shortcuts: none - -This command removes the selected header from the note and appends it to the end of the destination note body. - -All wikilinks that link to this header will automatically get updated to the new header. - -If the destination note does not exist yet, it will be created before moving the selected header. - -### Rename Header - -- shortcuts: none - -Rename the selected header. - -You must put the caret on the header you want to rename. -All wikilinks that link to this header (like `[[note#header]]`) will automatically get updated to the new header. - -Having the cursor within a header will also show a lightbulb for the [[Contextual UI Header Operations|dendron://dendron.dendron-site/dendron.ref.commands#header-operations]], which includes a [[Rename Note|dendron://dendron.dendron-site/dendron.ref.commands#rename-note]] quick fix. - -## Links - -### Convert Link - -Converts links of various statuses and kinds. - -#### Broken links - -You can use `Convert Link` to convert broken links into either plaintext or a different link to an existing note. -These are the available options for converting broken links: -- `alias`: use link's alias if exists (otherwise option isn't suggested) -- `note name`: use link destination's note name (basename excluding all parent hierarchies) -- `hierarchy`: use link destination's entire hierarchy -- `prompt`: user is prompted to manually input text to use -- `change destination`: user is prompted a lookup to choose a different existing note to link. - -#### Valid links - -You can use `Convert Link` to convert a limited set of valid links to other types of links. -These are the available operations: -- when cursor is above a usertag, user is asked if they want to convert it to a regular wikilink -- when cursor is above a regular wikilink with `user.*` hierarchy, user is asked if they want to convert it to a usertag (ex. `@person`) -- when cursor is above a hashtag, user is asked if they want to convert it to a regular wikilink -- when cursor is above a regular wikilink with `tags.*` hierarchy, user is asked if they want to convert it to a hashtag (ex. `#my.tag`) - -## +### Children +- [[Commands|dendron://dendron.dendron-site/dendron.topic.refactoring.commands]]: Refactoring Commands diff --git a/vault/dendron.topic.tags.md b/vault/dendron.topic.tags.md index 3e772db3c..569848aa8 100644 --- a/vault/dendron.topic.tags.md +++ b/vault/dendron.topic.tags.md @@ -2,7 +2,7 @@ id: 8bc9b3f1-8508-4d3a-a2de-be9f12ef1821 title: Tags desc: '' -updated: 1646587789452 +updated: 1655136223643 created: 1601910058115 tags: - example.from-frontmatter @@ -87,7 +87,7 @@ are just wikilinks. ### Details You might have already noticed this when you opened the tag, but tags are just notes under the `tags.` hierarchy. This has a lot of benefits: -- You can use commands like [[Rename Note|dendron.topic.refactoring#rename-note]] or [[Refactor Hierarchy|dendron.ref.commands#refactor-hierarchy]] to rename or reorganize your tags, and it will update all notes where these tags were used. +- You can use commands like [[Rename Note|dendron.topic.refactoring.commands.rename-note]] or [[Refactor Hierarchy|dendron.topic.refactoring.commands.refactor-hierarchy]] to rename or reorganize your tags, and it will update all notes where these tags were used. - You can add content to your tag and it will show up when you hover over the tag in the editor, or when you publish it. Try clicking on the example tag above! - You can organize your tags into hierarchies (like `#cuisine.ethiopian` and `#cuisine.swedish`). - You can link tags together by adding links in their content. diff --git a/vault/dendron.topic.teams.md b/vault/dendron.topic.teams.md index cae51262b..279dd2e66 100644 --- a/vault/dendron.topic.teams.md +++ b/vault/dendron.topic.teams.md @@ -2,7 +2,7 @@ id: 98f6d928-3f61-49fb-9c9e-70c27d25f838 title: Teams desc: '' -updated: 1628125026019 +updated: 1655136280364 created: 1617062224981 --- @@ -82,11 +82,11 @@ When you're working with multiple repositories, here are a few useful commands t Adding vaults to your team's workspace is as easy as running this command and pointing to either a local or remote vault. -### Move note ([[docs|dendron.ref.commands#move-note]]) +### Move note ([[docs|dendron.topic.refactoring.commands.move-note]]) Move note will allow you to move notes quickly from one vault to another (potentially to make it public or provide more strict access control). -### Refactor Hierarchy ([[dendron.ref.commands|dendron.topic.refactoring#refactor-hierarchy]]) +### Refactor Hierarchy ([[docs|dendron.topic.refactoring.commands.refactor-hierarchy]]) Use the refactor hierarchy command to bulk-move notes from one hierarchy/structure to another. diff --git a/vault/dendron.tutorial.linking-notes.md b/vault/dendron.tutorial.linking-notes.md index 3a33e61f4..44aacb87f 100644 --- a/vault/dendron.tutorial.linking-notes.md +++ b/vault/dendron.tutorial.linking-notes.md @@ -2,7 +2,7 @@ id: 9MZBqhrijEM4QpZRa5t08 title: Linking Notes desc: Linking Notes -updated: 1645804061198 +updated: 1655136360661 created: 1625563999532 nav_order: 2 --- @@ -49,7 +49,7 @@ You may wonder what happens to your links if you want to change the name of a no ### Rename Note -The [[Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring#rename-note]] command is used to change the name of, and all links to, a single note. +The [[Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note]] command is used to change the name of, and all links to, a single note. > 🌱 **ACTION:** Use the lookup to navigate to `[[recipes.italian.desserts.tiramisu]]`. Then: > - Run the command `Dendron: Rename Note` to change the title to `[[recipes.italian.desserts.gelato]]`. @@ -57,18 +57,18 @@ The [[Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring#renam ### Rename Header -The [[Rename Header|dendron://dendron.dendron-site/dendron.topic.refactoring#rename-header]] command is used to change the name of, and all links to, a single header. +The [[Rename Header|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-header]] command is used to change the name of, and all links to, a single header. > 🌱 **ACTION:** Use the lookup to navigate to `[[recipes.italian.desserts.gelato]]`. Then: > - Place the cursor in `## Ingredients`, and run the command `Dendron: Rename Header` > - Rename the header to `## Best Ingredients` > - Use the lookup to navigate to `[[recipes.ingredients.shopping-list]]`. You should see the wikilink there has updated from `[[recipes.italian.desserts.gelato#ingredients]]` to `[[recipes.italian.desserts.gelato#best-ingredients]]`, ensuring links are updated! -If you want to migrate a section beneath a certain header to a different note entirely, [[Move Header|dendron://dendron.dendron-site/dendron.topic.refactoring#move-header]] will do the job and ensure links are updated. +If you want to migrate a section beneath a certain header to a different note entirely, [[Move Header|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.move-header]] will do the job and ensure links are updated. ### Refactor Hierarchy -The [[Refactor Hierarchy|dendron.topic.refactoring#refactor-hierarchy]] command is used to change the name of, and all links to, a collection of notes. +The [[Refactor Hierarchy|dendron.topic.refactoring.commands.refactor-hierarchy]] command is used to change the name of, and all links to, a collection of notes. > 🌱 **ACTION:** This section will be all about creating and refactoring notes, in order to get an idea for how it all works. From ec3b1846d05041bd7c0b44f457c0200f54f6e0ec Mon Sep 17 00:00:00 2001 From: Mark Choi Date: Tue, 14 Jun 2022 14:38:44 +0900 Subject: [PATCH 2/4] chore: scrub dendron.ref.commands and update cheatsheet --- vault/dendron.cheatsheet.md | 318 ++---------------- vault/dendron.ref.commands.md | 43 +-- ....refactoring.commands.archive-hierarchy.md | 36 ++ vault/dendron.topic.refactoring.commands.md | 6 +- 4 files changed, 82 insertions(+), 321 deletions(-) create mode 100644 vault/dendron.topic.refactoring.commands.archive-hierarchy.md diff --git a/vault/dendron.cheatsheet.md b/vault/dendron.cheatsheet.md index 28c5efafa..bf078f0d6 100644 --- a/vault/dendron.cheatsheet.md +++ b/vault/dendron.cheatsheet.md @@ -2,311 +2,53 @@ id: f9540bb6-7a5a-46db-ae7c-e1a606f28c73 title: Cheatsheet desc: '' -updated: 1645122299784 +updated: 1655183646134 created: 1596374871110 +tags: + - stage.seed nav_exclude: true +config: + global: + enableChildLinks: false + enablePrettyRefs: true --- + -#prune +This is a cheatsheet that maps every UI element and feature in Dendron to a document that explains it. -This is a cheatsheet for Dendron. +## Activity Bar -# Useful Links -- [Dendron Discord](https://link.dendron.so/discord): Get answers to all your questions here -- [Dendron Onboarding](https://calendly.com/d/mqtk-rf7q/onboard): If you are a new user, [Kevin](http://www.kevinslin.com/), our founder, does a personal onboarding to help you setup your workspace. You can see an example of said onboarding [here](https://www.dendron.so/notes/e8d6241e-1708-4bde-bd3d-93b440a1eaad.html). -- [GitHub Issues](https://github.com/dendronhq/dendron/issues): If you found a bug or want to submit a feature request, you can file a ticket -- [Hierarchal First Approach to Note Taking](https://www.kevinslin.com/notes/3dd58f62-fee5-4f93-b9f1-b0f0f59a9b64.html): An article about the principle that Dendron was built around -- [VS Code Keyboard Shortcuts](https://code.visualstudio.com/docs/getstarted/keybindings#_keyboard-shortcuts-reference) +## Views -# Commands ---- -## Lookup -### Dendron: Contribute -- description: Become an environmentalist and keep Dendron sustainable -- shortcuts: none - - - ---- -## Notes -### Dendron: Create Daily Journal Note -- description: Create a global journal note -- shortcuts: - - key: `ctrl+shift+i` - - mac: `cmd+shift+i` - - when: `editorFocus` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/notes.daily.gif) - -### Dendron: Copy Note Link -- description: Copy wiki link to note -- shortcuts: - - key: `ctrl+shift+c` - - mac: `cmd+shift+c` - - when: `editorFocus` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command.copy-link.gif) - -### Dendron: Copy Note Ref -- description: Copies a reference to the current open document -- shortcuts: - - key: `ctrl+shift+r` - - mac: `cmd+shift+r` - - when: `editorFocus` - - - -### Dendron: Delete Node -- description: Delete a note or schema -- shortcuts: - - key: `ctrl+shift+d` - - mac: `cmd+shift+d` - - - -### Dendron: Rename Note -- description: Rename a note and all backlinks -- shortcuts: none - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command-rename.gif) - -### Dendron: Show Preview -- description: Show Markdown Preview -- shortcuts: - - windows: `windows+ctrl+p` - - mac: `cmd+ctrl+p` - - - ---- -## Navigation -### Dendron: Lookup -- description: Initiate note lookup -- shortcuts: - - mac: `cmd+L` - - key: `ctrl+l` - - - -### Dendron: Lookup (Journal Note) -- description: Initiate note lookup with journal note pre-selected -- shortcuts: - - key: `ctrl+shift+j` - - mac: `cmd+shift+j` - - args: `{'noteType': 'journal'}` - - - -### Dendron: Lookup (Scratch Note) -- description: Initiate note lookup with scratch note pre-selected -- shortcuts: - - key: `ctrl+shift+s` - - mac: `cmd+shift+s` - - args: `{'noteType': 'scratch', 'selectionType': 'selection2link'}` - - - -### Dendron: Lookup Schema -- description: Initiate schema lookup -- shortcuts: - - mac: `cmd+shift+L` - - key: `ctrl+shift+l` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/schema-lookup.gif) - -### Dendron: Open Link -- description: Open link to external file (eg. PDF, .mov, etc.) use system default -- shortcuts: none - - - ---- -## Hierarchies -### Dendron: Reload Index -- description: Reload the index. Necessary for Dendron to pick up on schema changes. -- shortcuts: none - - - -### Dendron: Archive Hierarchy -- description: Move current note and all children under the `archive` hierarchy -- shortcuts: none - - - -### Dendron: Refactor Hierarchy -- description: Update hierarchy using regex -- shortcuts: none - - - -### Dendron: Go Up -- description: Go to closet non-stub parent of the currently open note -- shortcuts: - - mac: `cmd+shift+up` - - key: `ctrl+shift+up` - - when: `editorFocus` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/hierarchy.go-up.gif) - -### Dendron: Go Next Sibling -- description: Go to the next sibling -- shortcuts: - - key: `ctrl+shift+]` - - when: `editorFocus` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/hierarchy.go-sibling.gif) - -### Dendron: Go Previous Sibling -- description: Go to the previous sibling -- shortcuts: - - key: `ctrl+shift+[` - - when: `editorFocus` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/hierarchy.go-sibling.gif) +## Commands -### Dendron: Go Down -- description: Go down the hierarchy -- shortcuts: - - mac: `cmd+shift+down` - - key: `ctrl+shift+down` - - when: `editorFocus` +### Rename note -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/hierarchy.go-down.gif) +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note#summary,1:#*]] ---- -## Workspace -### Dendron: Vault Add -- description: Add a new vault -- shortcuts: none - -
- -### Dendron: Vault Remove -- description: Remove a vault -- shortcuts: none - -Remove a vault from your workspace. Note that the underlying files wil **not** be deleted - the vault will lose its association with your workspace. -
- -### Dendron: Initialize Workspace -- description: Create a new workspace -- shortcuts: none - -### Dendron: Change Workspace -- description: Change into existing workspace -- shortcuts: none - - - -### Dendron: Snapshot Vault -- description: Create a snapshot of your vault -- shortcuts: none - - - -### Dendron: Restore Vault -- description: Restore your vault from a snapshot -- shortcuts: none - - - -### Dendron: Show Help -- description: Dendron will open your current browser to the [[cheatsheet|dendron.cheatsheet]] page. -- shortcuts: none - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/workbench.help.gif) - -### Dendron: Configure (yaml) -- description: Modify Dendron Config as raw YAML -- shortcuts: none - - - -### Dendron: Configure -- description: Modify Dendron Config using Dendron UI -- shortcuts: none - - - ---- -## Pods -### Dendron: Build Pod -- description: Build your notes for export. Currently, only export to GitHub Pages is supported. -- shortcuts: none +### Move Note +![[dendron.topic.refactoring.commands.move-note#summary,1:#*]] +### Refactor Hierarchy -### Dendron: Configure Pod -- description: Update your pod configuration -- shortcuts: none - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/pods.configure.gif) - -### Dendron: Import Pod -- description: Import notes from an external data source. Currently, only the local file system is supported -- shortcuts: none - - - -### Dendron: Export Pod -- description: Export notes to an external data source. Currently only JSON is supported. -- shortcuts: none - - - -### Dendron: Publish Pod -- description: Publish your note to a different format/location -- shortcuts: none - - - -### Dendron: Copy Note URL -- description: Get URL of current note from published site -- shortcuts: - - mac: `cmd+shift+u` - - windows: `ctrl+shift+u` - -![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/notes.copy-url.gif) - ---- -## Publishing -### Dendron: Publish -- description: Build, commit and publish your notes with a single command -- shortcuts: none - - - -### Dendron: Site Build -- description: Build your notes using publishing v2 -- shortcuts: none - - - -### Dendron: Site Preview -- description: Preview your notes on localhost using publishing v2 -- shortcuts: none - - - ---- -## Dev -### Dendron: Doctor -- description: Auto fix issues with frontmatter -- shortcuts: none - - +![[dendron.topic.refactoring.commands.refactor-hierarchy#summary,1:#*]] -### Dendron: Dump State -- description: Dump internal state of Dendron inside logs -- shortcuts: none +### Move Header +![[dendron.topic.refactoring.commands.move-header#summary,1:#*]] +### Rename Header -### Dendron:Dev: Open Logs -- description: Open Dendron logs for current session -- shortcuts: none +![[dendron.topic.refactoring.commands.rename-header#summary,1:#*]] +### Convert Link +![[dendron.topic.refactoring.commands.convert-link#summary,1:#*]] - +## Menus diff --git a/vault/dendron.ref.commands.md b/vault/dendron.ref.commands.md index cb910bd4d..1e33bccb6 100644 --- a/vault/dendron.ref.commands.md +++ b/vault/dendron.ref.commands.md @@ -2,11 +2,21 @@ id: eea2b078-1acc-4071-a14e-18299fc28f47 title: Commands desc: "" -updated: 1655740491760 +tags: + - stage.seed +updated: 1655740580959 created: 1595261816971 nav_order: 3.1 --- +> ⚠️ This page is currently under active refactoring. + +![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands]] + +*** + + + ## Doctor ![[dendron://dendron.dendron-site/dendron.topic.doctor#commands,1:#*]] @@ -280,18 +290,10 @@ Running it in the note `recipe.eggs` will insert the following at cursor positio - configuration : [[insertNoteIndex|dendron.ref.config#insertnoteindex]] -### Move Note - -![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.move-note#summary,1:#*]] - ### Paste Link Transform URL in clipboard to nicely formatted Markdown link -### Convert Link - -![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.convert-link#summary,1:#*]] - ### Random Note Navigates to a random note in the workspace. By default, all notes are included in the set that can be navigated to with this command. This can be adjusted with the `randomNote` setting in the Dendron Config (see [[Configure (yaml)|dendron.ref.commands#configure-yaml]]). @@ -430,8 +432,6 @@ This command is a convenience command to open backup files saved under `{workspa ## Organizing -- [[Refactoring Commands|dendron://dendron.dendron-site/dendron.topic.refactoring]] - --- ## Hierarchies @@ -442,19 +442,6 @@ This command is a convenience command to open backup files saved under `{workspa Reload the index. Necessary for Dendron to pick up on schema changes. -### Archive Hierarchy - -- shortcuts: none - -Move current note and all children under the `archive` hierarchy - -This is a convenience method around `Refactor Hierarchy` for the case of archiving hierarchies you are no longer using. For example, if you were currently at `pro.foo`, running `Archive Hierarchy` would be equivalent to running `Refactor Hierarchy` with the following arguments: - -- matcher: `pro.foo` -- replacement: `archive.pro.foo` - - - --- ## Hooks @@ -757,10 +744,6 @@ any reason. Dendron recognises a new Markdown file created from VS Code context menu and populate it with the frontmatter. -#### Rename Note - -![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note#summary,1:#*]] - ### Header Operations These are Dendron-specific features made available as [Quick Fix operations in VS Code](https://code.visualstudio.com/docs/editor/refactoring#_code-actions-quick-fixes-and-refactorings). @@ -769,10 +752,6 @@ A header action is announced by a lightbulb when the cursor is within a header. > 💡 **TIP:** If you prefer to not see the Code Action lightbulb in your editor, you can disable lightbulbs with the `editor.lightbulb.enable` [setting](https://code.visualstudio.com/docs/getstarted/settings). You can still open Quick Fixes through Quick Fix command and `Ctrl+.` keyboard shortcut. -#### Rename Header - -![[dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-header#summary,1:#*]] - #### Copy Header Reference ![[dendron://dendron.dendron-site/dendron.ref.commands#header-selection,1:#*]] diff --git a/vault/dendron.topic.refactoring.commands.archive-hierarchy.md b/vault/dendron.topic.refactoring.commands.archive-hierarchy.md new file mode 100644 index 000000000..f9f8fb4b1 --- /dev/null +++ b/vault/dendron.topic.refactoring.commands.archive-hierarchy.md @@ -0,0 +1,36 @@ +--- +id: o350dnypumec34m7xha2g6f +title: "Dendron: Archive Hierarchy" +desc: "Move current note and all children under the `archive` hierarchy" +updated: 1655184589843 +created: 1655184272177 +commandId: dendron.archiveHierarchy +keybindings: + mac: none + windows: none + linux: none +--- + +## Summary + +{{fm.desc}} + +- Command Title: **{{fm.title}}** +- Command ID: **{{fm.commandId}}** +- keybindings: + - mac: **{{fm.keybindings.mac}}** + - windows: **{{fm.keybindings.windows}}** + - linux: **{{fm.keybindings.linux}}** + +## Details + + + +{{fm.title}} is a convenience command for archiving an entire hierarchy that is no longer in use. This is built to use [[dendron.topic.refactoring.commands.refactor-hierarchy]] to match everything under the current active note's hierarchy in to the hierarchy `archive`. + +### Example + +Given that we have the note `pro.foo` open, running this command is equivalent to running [[dendron.topic.refactoring.commands.refactor-hierarchy]] with the following inputs: + +match text: `pro.foo` +replace text: `archive.pro.foo` diff --git a/vault/dendron.topic.refactoring.commands.md b/vault/dendron.topic.refactoring.commands.md index b8f201dad..c59d82b34 100644 --- a/vault/dendron.topic.refactoring.commands.md +++ b/vault/dendron.topic.refactoring.commands.md @@ -2,7 +2,7 @@ id: 45ecrq7l5z9l1vpwtr05q3h title: Commands desc: '' -updated: 1655133020474 +updated: 1655184644664 created: 1655109346797 config: global: @@ -21,6 +21,10 @@ config: ![[dendron.topic.refactoring.commands.refactor-hierarchy]] +## Archive Hierarchy + +![[dendron.topic.refactoring.commands.archive-hierarchy]] + ## Move Header ![[dendron.topic.refactoring.commands.move-header]] From 3adcf6c7db7cfccaccc1429cb46ba739e99edb65 Mon Sep 17 00:00:00 2001 From: Mark Choi Date: Tue, 14 Jun 2022 15:38:22 +0900 Subject: [PATCH 3/4] chore: update --- vault/dendron.cheatsheet.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vault/dendron.cheatsheet.md b/vault/dendron.cheatsheet.md index bf078f0d6..43cf96fd3 100644 --- a/vault/dendron.cheatsheet.md +++ b/vault/dendron.cheatsheet.md @@ -2,7 +2,7 @@ id: f9540bb6-7a5a-46db-ae7c-e1a606f28c73 title: Cheatsheet desc: '' -updated: 1655183646134 +updated: 1655188695200 created: 1596374871110 tags: - stage.seed @@ -52,3 +52,5 @@ This is a cheatsheet that maps every UI element and feature in Dendron to a docu ![[dendron.topic.refactoring.commands.convert-link#summary,1:#*]] ## Menus + +## Configs \ No newline at end of file From 97a6a62a911a5202289e6cac46350cc610110640 Mon Sep 17 00:00:00 2001 From: Mark Choi Date: Tue, 21 Jun 2022 00:46:41 +0900 Subject: [PATCH 4/4] chore: simplify command notes --- ....refactoring.commands.archive-hierarchy.md | 18 ++++------------ ...topic.refactoring.commands.convert-link.md | 17 ++++----------- vault/dendron.topic.refactoring.commands.md | 16 +++++++------- ....topic.refactoring.commands.move-header.md | 15 +++---------- ...on.topic.refactoring.commands.move-note.md | 17 ++++----------- ...refactoring.commands.refactor-hierarchy.md | 21 ++++++------------- ...opic.refactoring.commands.rename-header.md | 17 ++++----------- ....topic.refactoring.commands.rename-note.md | 17 ++++----------- 8 files changed, 37 insertions(+), 101 deletions(-) diff --git a/vault/dendron.topic.refactoring.commands.archive-hierarchy.md b/vault/dendron.topic.refactoring.commands.archive-hierarchy.md index f9f8fb4b1..062f9c3aa 100644 --- a/vault/dendron.topic.refactoring.commands.archive-hierarchy.md +++ b/vault/dendron.topic.refactoring.commands.archive-hierarchy.md @@ -2,31 +2,21 @@ id: o350dnypumec34m7xha2g6f title: "Dendron: Archive Hierarchy" desc: "Move current note and all children under the `archive` hierarchy" -updated: 1655184589843 +updated: 1655739478339 created: 1655184272177 -commandId: dendron.archiveHierarchy -keybindings: - mac: none - windows: none - linux: none --- ## Summary - {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details -{{fm.title}} is a convenience command for archiving an entire hierarchy that is no longer in use. This is built to use [[dendron.topic.refactoring.commands.refactor-hierarchy]] to match everything under the current active note's hierarchy in to the hierarchy `archive`. +**{{fm.title}}** is a convenience command for archiving an entire hierarchy that is no longer in use. This is built to use [[dendron.topic.refactoring.commands.refactor-hierarchy]] to match everything under the current active note's hierarchy in to the hierarchy `archive`. ### Example diff --git a/vault/dendron.topic.refactoring.commands.convert-link.md b/vault/dendron.topic.refactoring.commands.convert-link.md index 0c388df85..e8559d214 100644 --- a/vault/dendron.topic.refactoring.commands.convert-link.md +++ b/vault/dendron.topic.refactoring.commands.convert-link.md @@ -2,28 +2,19 @@ id: u8qgpl5l7r4t001meo0n0qr title: 'Dendron: Convert Link' desc: Convert selected link to other types of links or plaintext. -updated: 1655131992450 +updated: 1655739333889 created: 1655131185651 -commandId: dendron.convertLink -keybindings: - mac: none - windows: none - linux: none --- ## Summary {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details -{{fm.title}} is a command that lets you select a link and convert it to various other types of links. +**{{fm.title}}** is a command that lets you select a link and convert it to various other types of links. This command works on both broken and valid links, and provide different capabilities depending on the validity of the selected link. diff --git a/vault/dendron.topic.refactoring.commands.md b/vault/dendron.topic.refactoring.commands.md index c59d82b34..dff397586 100644 --- a/vault/dendron.topic.refactoring.commands.md +++ b/vault/dendron.topic.refactoring.commands.md @@ -2,7 +2,7 @@ id: 45ecrq7l5z9l1vpwtr05q3h title: Commands desc: '' -updated: 1655184644664 +updated: 1655739692915 created: 1655109346797 config: global: @@ -11,28 +11,28 @@ config: ## Rename note -![[dendron.topic.refactoring.commands.rename-note]] +![[dendron.topic.refactoring.commands.rename-note#summary,1:#*]] ## Move Note -![[dendron.topic.refactoring.commands.move-note]] +![[dendron.topic.refactoring.commands.move-note#summary,1:#*]] ## Refactor Hierarchy -![[dendron.topic.refactoring.commands.refactor-hierarchy]] +![[dendron.topic.refactoring.commands.refactor-hierarchy#summary,1:#*]] ## Archive Hierarchy -![[dendron.topic.refactoring.commands.archive-hierarchy]] +![[dendron.topic.refactoring.commands.archive-hierarchy#summary,1:#*]] ## Move Header -![[dendron.topic.refactoring.commands.move-header]] +![[dendron.topic.refactoring.commands.move-header#summary,1:#*]] ## Rename Header -![[dendron.topic.refactoring.commands.rename-header]] +![[dendron.topic.refactoring.commands.rename-header#summary,1:#*]] ## Convert Link -![[dendron.topic.refactoring.commands.convert-link]] +![[dendron.topic.refactoring.commands.convert-link#summary,1:#*]] diff --git a/vault/dendron.topic.refactoring.commands.move-header.md b/vault/dendron.topic.refactoring.commands.move-header.md index 816ea65ac..b0b0c8e59 100644 --- a/vault/dendron.topic.refactoring.commands.move-header.md +++ b/vault/dendron.topic.refactoring.commands.move-header.md @@ -2,24 +2,15 @@ id: hdnewljy94gvsnlwwwft6zq title: 'Dendron: Move Header' desc: Move the selected header to another note. -updated: 1655130677907 +updated: 1655739303941 created: 1655130405782 -commandId: dendron.moveHeader -keybindings: - mac: none - windows: none - linux: none --- ## Summary {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details diff --git a/vault/dendron.topic.refactoring.commands.move-note.md b/vault/dendron.topic.refactoring.commands.move-note.md index d4ec7da0d..1c0801d2e 100644 --- a/vault/dendron.topic.refactoring.commands.move-note.md +++ b/vault/dendron.topic.refactoring.commands.move-note.md @@ -2,13 +2,8 @@ id: 98ywiw4211q9sx0v98lbo88 title: 'Dendron: Move Note' desc: Move a note to another vault and update all backlinks to that note. -updated: 1655129619728 +updated: 1655739264942 created: 1655129267874 -commandId: dendron.moveNote -keybindings: - mac: none - windows: none - linux: none --- > Dendron will not allow you to move a note if a note already exists in the destination. @@ -18,16 +13,12 @@ keybindings: ## Summary {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details -{{fm.title}} is a command that lets you move a note between vaults when in a [[Multi-vault|dendron://dendron.dendron-site/dendron.topic.multi-vault]] workspace, and will also update all references in other notes of that note. +**{{fm.title}}** is a command that lets you move a note between vaults when in a [[Multi-vault|dendron://dendron.dendron-site/dendron.topic.multi-vault]] workspace, and will also update all references in other notes of that note. ## Moving a note using the file explorer You can also select **{{fm.title}}** after right clicking on a note in the explorer to move that note. This will also update the backlinks as well. diff --git a/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md b/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md index 0905c03a5..3052a40ff 100644 --- a/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md +++ b/vault/dendron.topic.refactoring.commands.refactor-hierarchy.md @@ -2,28 +2,19 @@ id: 9zwkp44wnlaa8p8dpt4w8tq title: 'Dendron: Refactor Hierarchy' desc: Rename multiple notes using regular expressions. -updated: 1655130388659 +updated: 1655739540902 created: 1655129668280 -commandId: dendron.refactorHierarchy -keybindings: - mac: none - windows: none - linux: none --- ## Summary {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details -{{fm.title}} is a command that works like [[Dendron: Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note]], but on multiple notes. To specify which note should be renamed, you will be prompted for three inputs: +**{{fm.title}}** is a command that works like [[Dendron: Rename Note|dendron://dendron.dendron-site/dendron.topic.refactoring.commands.rename-note]], but on multiple notes. To specify which note should be renamed, you will be prompted for three inputs: - Scope: The set of notes you want to apply the regular expression to. - Match text: Regular expression that matches text you want to capture for replacement. @@ -32,7 +23,7 @@ keybindings: ### Scope -{{fm.title}} will first prompt you to decide the scope of the operation. +**{{fm.title}}** will first prompt you to decide the scope of the operation. - If you have a selection in your active editor that contains at least one wikilink, the command will prompt you if you want to use the notes in the selection as the scope of refactor. - If you do not wish to limit the scope with selection, don't select anything in your active note. The behavior will default to the entire workspace and you will not be asked to determine the scope of refactor. @@ -82,6 +73,6 @@ Recall that part of our match text were capture groups. The first and second cap ### Refactor Preview -After providing the three inputs after running {{fm.title}}, Dendron will open a preview that shows all files that will be affected if you confirm. You will be given an option in a dropdown to either proceed with the refactor or cancel the operation. +After providing the three inputs after running **{{fm.title}}**, Dendron will open a preview that shows all files that will be affected if you confirm. You will be given an option in a dropdown to either proceed with the refactor or cancel the operation. - NOTE: Dendron will warn you if refactoring will overwrite existing files. You will need to either change your `replace text` or move the affected files before Dendron will perform a refactor. If the preview shows any overwrites, Dendron will not allow you to proceed. diff --git a/vault/dendron.topic.refactoring.commands.rename-header.md b/vault/dendron.topic.refactoring.commands.rename-header.md index 05b1da33d..96d6b2c6d 100644 --- a/vault/dendron.topic.refactoring.commands.rename-header.md +++ b/vault/dendron.topic.refactoring.commands.rename-header.md @@ -2,28 +2,19 @@ id: 58rjapuyn1yjjcrf9sh6fby title: 'Dendron: Rename Header' desc: Rename a header and update all backlinks to that note. -updated: 1655131172684 +updated: 1655739372467 created: 1655130651647 -commandId: dendron.renameHeader -keybindings: - mac: none - windows: none - linux: none --- ## Summary {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details -{{fm.title}} is a command that lets you select a header and rename it. All wikilinks pointing to this header will be automatically update to the new header. +**{{fm.title}}** is a command that lets you select a header and rename it. All wikilinks pointing to this header will be automatically update to the new header. When selecting the header, you must put the caret on the header you want to rename. diff --git a/vault/dendron.topic.refactoring.commands.rename-note.md b/vault/dendron.topic.refactoring.commands.rename-note.md index 657e27289..babeac8da 100644 --- a/vault/dendron.topic.refactoring.commands.rename-note.md +++ b/vault/dendron.topic.refactoring.commands.rename-note.md @@ -2,13 +2,8 @@ id: g0iqmyiyxje6ndjmecshb8b title: 'Dendron: Rename Note' desc: Rename a note and update all backlinks to that note. -updated: 1655136188599 +updated: 1655739187896 created: 1655109426539 -commandId: dendron.renameNote -keybindings: - mac: none - windows: none - linux: none --- > Dendron will not allow you to rename a note to a note that already exists @@ -18,18 +13,14 @@ keybindings: ## Summary {{fm.desc}} -- Command Title: **{{fm.title}}** -- Command ID: **{{fm.commandId}}** -- keybindings: - - mac: **{{fm.keybindings.mac}}** - - windows: **{{fm.keybindings.windows}}** - - linux: **{{fm.keybindings.linux}}** +## Keybindings +none ## Details ![](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command-rename.gif) -{{fm.title}} is a command that lets you rename a note. When renaming, it will also update all references in other notes of that note. +**{{fm.title}}** is a command that lets you rename a note. When renaming, it will also update all references in other notes of that note. ### Title generation If the title of the note is the default title that Dendron generated when the note was created, this command will also create a new title as if a new note was created with the renamed filename.