Refactoring

Summary

Features that help update the structure of Dendron.

Features

  • 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

  1. Create a note called foo with the following content:

    ## One
    
    -   Some content
    
    ## Two
    
    -   More content
    
    ### Let's go deeper
    
    -   Deep content
    
  2. Create a note called bar with the following content:

    [[foo#two]]
    
  3. Go back to the note foo, place the cursor anywhere on the line where the header Two is

  4. Run Dendron: Rename Header and type Second

  5. The header is now renamed to Second, and the link in the note bar is automatically updated to [[foo#second]]

  6. Position the cursor again on the header Second and run Dendron: Move Header

  7. Type baz in the lookup bar.

  8. A new note baz is created and the header Second is moved to this note along with the child header Let's go deeper

  9. 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

  1. Create a note called foo with any content
  2. Create another note that contains a link to foo
  3. Go back to the note foo and run Dendron: Rename Note
  4. Type baz in the lookup bar.
  5. The note foo is now renamed to baz, and the link in the note is also updated to [[baz]]

Moving a note or multiple notes

See Dendron: Move Note for more information

  1. Create notes called foo, bar, and baz with any content
  2. Create a new local vault by running Create New Vault
  3. Create another note in any vault that links to any of these notes.
  4. Run Dendron: Move Note in the command palette
  5. 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.
  6. You will be prompted to select the vault you want to move the selected note(s) to.
  7. 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

  1. Create notes called source, dest, with any content, and ref with wikilinks that point to source.
  2. Open the note source.
  3. Run Dendron: Merge Note in the command palette
  4. When prompted for the destination, select dest.
  5. Notice that the note source is deleted, and the content of source is appended at the end of note dest.
  6. Also note that the wikilinks in ref that used to point to source is now updated to point to the note dest.

Refactoring an entire hierarchy

See Dendron: Refactor Hierarchy for more information

  1. Create notes called foo, foo.child, and foo.child.grandchildren with any content.
  2. Create another note that links to any of these notes.
  3. Run Dendron: Refactor Hierarchy fron the command palette.
  4. You will be prompted to enter a match text. Type foo and hit enter.
  5. You will be prompted again to enter a replace text. Type bar and hit enter.
  6. A preview of all the affected notes will appear along with another prompt to confirm the changes.
  7. Hitting enter will rename all notes as listed in the preview, and links to all affected notes are also updated.

Children


Children
  1. Commands

Backlinks