Link Search Menu Expand Document

Multi Vault

Summary

Multi vault refers to managing multiple vaults within your workspace.

Use Cases

  • for sensitive notes, multi-vault enables local only vaults vs vaults that can be synced on file sharing services like Dropbox
  • for modularizing knowledge, multi-vault enables users to mix and match existing vaults depending on context
  • for federating and curating knowledge, multi-vault enables users to publish/subscribe to public vaults using protocols like git
  • for access control, multi-vault lets users configure specific vaults to be private which turns off publication and sharing of any notes inside said vault

Topics

Lookup

Lookup supports multiple vaults. When using lookup to find a note, each search result is labeled with which vault it belongs to.

Vault Location when Creating a Note

When creating a note in lookup, Dendron will try to create your note in the correct vault. By default, it will place the note into the same vault as the currently opened note. But if it detects that the new note matches an existing hierarchy in a different vault, you will get prompted to pick the destination vault:

Prompt for Vault Selection Each Time

lookupConfirmVaultOnCreate

With this set, you will be prompted to select the vault location each time you create a note when you have multiple vaults in your workspace.

To enable, add lookupConfirmVaultOnCreate: true in the dendron configuration. Instructions to do so below.

  1. Dendron: Configure (yaml)

  2. add lookupConfirmVaultOnCreate: true so your configuration looks like the following:
version: 0
...
lookupConfirmVaultOnCreate: true
  • Sample workspace

.
└── Dendron
    |── .git
    |── dendron.code-workspace
    |── dendron.yml
    |── pods
    |── docs
    ├── vault1
    │   |── .git
    │   ├── foo.md
    │   └── foo.two.md
    └── vault2
        |── .git
        ├── foo.md
        └── foo.one.md

  • navigating to [[foo]] will result in a display prompting the user to select the vault to navigate to
  • navigating to [[foo.two]] will directly navigate to the note since it is unique across all vaults
  • navigating to [[vault1/foo]] will open foo in vault1
  • navigating to [[dendron://vault2/foo]] will open foo in vault1

Note References

When you make a reference, Dendron will include the note from the same note. You can create a reference to a note in a different vault by using cross vault links.

Publishing

You can publish from a multi-vault enabled workspace if you are using dendron-11ty to publish.

We have added a new configuration, duplicateNoteBehavior, which controls how Dendron handles duplicate notes across multiple vaults.

Version Control

For multi-vault, there are several approaches to version control. If you are using Git, you can either commit everything as one repo or version control your workspace and each vault separately as distinct repos.

If you use Vault: Add with a remote vault, Dendron will automatically add the remote properties to your dendron.yml file. See example below.

vaults:
    -
        fsPath: handbook-vault
        workspace: handbook-workspace
        name: handbook
workspaces:
    handbook:
        remote:
            type: git
            url: 'git@github.com:dendronhq/handbook.git'

This will have the following file layout

.
└── workspace
    └── handbook-workspace
        └── handbook-vault

Versioned controlled vaults will be auto-initialized when someone pulls in the workspace.

If you want to convert a local vault to a remote vault, you can follow the instructions here.

File Layout for Multi-Vault Workspace

.
└── Dendron
    ├── .git
    ├── dendron.code-workspace
    ├── dendron.yml
    ├── ...
    ├── vault1
    │   ├── .git
    │   ├── root.md
    │   └── ...
    └── vault2
        ├── .git
        ├── root.md
        └── ...

Examples

  • Sample Multi-Vault workspace