Refactoring
Summary
Features that help update the structure of Dendron.
Features
Automatic Link Synchronization
- With refactoring, you can organize your notes without breaking links that exists to the notes you are organizing.
- When you are renaming a note, moving a note to another vault, refactoring an entire hierarchy, or even renaming / moving a header section of a note, refactor will ensure that all the affected link are updated accordingly.
Reorganize knowledge at any scale
- Refactor lets you reorganize your knowledge with a single command regardless of scale; You can refactor a header in a note, an entire note, or multiple notes.
- Beyond notes, entire hierarchies can be refactored by leveraging the power of regular expression to match and replace parts of the hierarchy.
Getting Started
Refactoring headers
See Dendron: Move Header and Dendron: Move Header for more information
-
Create a note called
foo
with the following content:## One - Some content ## Two - More content ### Let's go deeper - Deep content
-
Create a note called
bar
with the following content:[[foo#two]]
-
Go back to the note
foo
, place the cursor anywhere on the line where the headerTwo
is -
Run Dendron: Rename Header and type
Second
-
The header is now renamed to
Second
, and the link in the notebar
is automatically updated to[[foo#second]]
-
Position the cursor again on the header
Second
and run Dendron: Move Header -
Type
baz
in the lookup bar. -
A new note
baz
is created and the headerSecond
is moved to this note along with the child headerLet's go deeper
-
Notice that the link in the note
bar
has been updated to[[baz#second]]
Refactoring notes
Renaming a note
See Dendron: Rename Note for more information
- Create a note called
foo
with any content - Create another note that contains a link to
foo
- Go back to the note
foo
and run Dendron: Rename Note - Type
baz
in the lookup bar. - The note
foo
is now renamed tobaz
, and the link in the note is also updated to[[baz]]
Moving a note or multiple notes
See Dendron: Move Note for more information
- Create notes called
foo
,bar
, andbaz
with any content - Create a new local vault by running Create New Vault
- Create another note in any vault that links to any of these notes.
- Run Dendron: Move Note in the command palette
- Select note(s) you want to move to the new vault and hit enter. Clicking the square icon in the lookup bar will enable multi-select.
- You will be prompted to select the vault you want to move the selected note(s) to.
- Notice the notes have been moved to the selected vault and links to those notes have also been updated.
Merge one note with another note
See Dendron: Merge Note for more information
- Create notes called
source
,dest
, with any content, andref
with wikilinks that point tosource
. - Open the note
source
. - Run Dendron: Merge Note in the command palette
- When prompted for the destination, select
dest
. - Notice that the note
source
is deleted, and the content ofsource
is appended at the end of notedest
. - Also note that the wikilinks in
ref
that used to point tosource
is now updated to point to the notedest
.
Refactoring an entire hierarchy
See Dendron: Refactor Hierarchy for more information
- Create notes called
foo
,foo.child
, andfoo.child.grandchildren
with any content. - Create another note that links to any of these notes.
- Run Dendron: Refactor Hierarchy fron the command palette.
- You will be prompted to enter a match text. Type
foo
and hit enter. - You will be prompted again to enter a replace text. Type
bar
and hit enter. - A preview of all the affected notes will appear along with another prompt to confirm the changes.
- Hitting enter will rename all notes as listed in the preview, and links to all affected notes are also updated.
Children
- Commands: Refactoring Commands
Children
Backlinks