Link Search Menu Expand Document

Multi Vault Support

Goals

Users should be able to create multiple vaults for a given workspace. Each vault is a folder that can contain any number of hierarchies.

Use Cases

  • for sensitive notes, multi-vault enables local only vaults vs vaults that can are 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

Concepts

Workspace

In Dendron, your workspace is the root of where all your files are located. It’s set when you first run Dendron: Initialize Workspace.

Vaults 🚧

Your workspace is made up of vaults. A dendron vault stores a collection of related notes. If you’re familiar with git, it’s just like a code repo. By default, Dendron creates a vaults folder when you first initialize a workspace. All your notes are stored on a per vault basis.

.
└── workspace
    β”œβ”€β”€ vault.main
    β”‚   β”œβ”€β”€ foo.md
    β”‚   β”œβ”€β”€ foo.one.md
    β”‚   └── foo.two.md
    └── vault.secret (hypothetical)
        β”œβ”€β”€ secret.one.md
        └── secret.two.md

By default, when you look for notes in Dendron, it will search over all vaults.

Hierarchies

Within a vault, your notes are stored hierarchically as . delimited markdown files.

Below is a hypothetical hierarchy for a file tree:

.
└── project1/
    β”œβ”€β”€ project1/designs/
    β”‚   └── project1/designs/promotion.png
    β”œβ”€β”€ project1/paperwork/
    β”‚   └── project1/paperwork/legal.md
    └── project1/tasks/
        β”œβ”€β”€ project1/tasks/task1.md
        └── project1/tasks/task2.md

The same hiearchy in Dendron would look like the following:

.
β”œβ”€β”€ project1.md
β”œβ”€β”€ project1.designs.md
β”œβ”€β”€ project1.designs.promotion.md
β”œβ”€β”€ project1.paperwork.md
β”œβ”€β”€ project1.paperwork.legal.md
β”œβ”€β”€ project1.tasks.md
β”œβ”€β”€ project1.tasks.task1.md
└── project1.tasks.task2.md

You can read more about hierarchies here

Domain

A domain is the root of a hierarchy. In the example below, project1 would be the domain.

.
β”œβ”€β”€ project1.md
β”œβ”€β”€ project1.designs.md
β”œβ”€β”€ project1.designs.promotion.md
β”œβ”€β”€ project1.paperwork.md
β”œβ”€β”€ project1.paperwork.legal.md
β”œβ”€β”€ project1.tasks.md
β”œβ”€β”€ project1.tasks.task1.md
└── project1.tasks.task2.md

This enables many use cases like keeping a private local only vault and a synced dropbox vault.

Specs

  • a workspace can have any number of vaults
  • vaults have a name and a path relative to the workspace
  • the initial vault is called main
  • vaults can be referred to by name using the $ prefix

Flow

Add a new Vault

  • run Dendron: Add Vault
    • specify file path
      • placeholder text of current workspace path
    • eg: {workspace}/local-only-vault
  • when the user hits enter, the vault is created as an β€œempty vault”
    • empty vaults will contain a root.md and root.schema.yml file

Lookup

This layout is used as the basis for all examples

.
└── Dendron
    β”œβ”€β”€ vault1
    β”‚   β”œβ”€β”€ foo.md
    β”‚   └── foo.two.md
    └── vault2
        β”œβ”€β”€ foo.md
        └── foo.one.md
  • lookup: {empty query}
    • show all top level results of all vaults. note how the vault name shows up in parenthesis next to the result
    • results
      root ($vault1)
      root ($vault2)
      foo ($vault1)
      foo ($vault2)
      
  • lookup: $vault1/
    • by prefixing lookup with the vault name, you can narrow results to a particular vault
    • results
      root ($vault1)
      foo ($vault1)
      
  • lookup: foo.
    • dendron will merge all results from all vaults when you do a lookup
    • results
      foo.one ($vault2)
      foo.two ($vault1)
      
  • lookup: foo.new
    • when you lookup a note that doesn’t exist, you’ll have the option of creating the note in either vault
    • results
      Create New ($vault2)
      Create New ($vault1)
      

This layout is used as the basis for all examples

.
└── Dendron
    β”œβ”€β”€ vault1
    β”‚   β”œβ”€β”€ foo.md
    β”‚   └── foo.two.md
    └── vault2
        β”œβ”€β”€ foo.md
        └── foo.one.md
  • navigating to [[foo]] will result in a display prompting the user to select the vault to navigate to
    • the UI should be similar to the Peek Action
  • 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

Publishing Notes

This layout is used as the basis for all examples

.
└── Dendron
    β”œβ”€β”€ vault1
    β”‚   β”œβ”€β”€ foo.md
    β”‚   └── foo.two.md
    └── vault2
        β”œβ”€β”€ foo.md
        └── foo.one.md
  • configuration to publish everything under foo
    • config ```yml vaults:
      • name: main path: vault1
      • name: private path: vault2 publish: siteHierarchies: [foo] ```
    • published notes:
      $vault1/foo.md
      $vault1/two.md
      $vault2/foo.md
      $vault2/one.md
      
  • configuration that denies publication from vault2
    • config ```yml vaults:
      • name: main path: vault1
      • name: private path: vault2 allowPublish: false publish: siteHierarchies: [foo] ```
    • published notes:
      $vault1/foo.md
      $vault1/two.md
      

Special Cases

Adding a vault under another vault

  • you want to put all notes from vault2 under vault1 under the vault2 node
  • eg: lookup should see the following hierarchy
β”œβ”€β”€ foo.md
β”œβ”€β”€ foo.two.md
β”œβ”€β”€ vault2.foo.md
└── vault2.foo.one.md

This can be achieved with the following config

vaults:
- name: main
    path: vault1
- name: private
    path: vault2
    mountUnder: vault2

Ref

File Layout

This layout is used as the basis for all examples

.
└── Dendron
    β”œβ”€β”€ vault1
    β”‚   β”œβ”€β”€ foo.md
    β”‚   └── foo.two.md
    └── vault2
        β”œβ”€β”€ foo.md
        └── foo.one.md

Configuration

vaults

  • top level directive in dendron.yml
  • collection of one or more vaults

{vault}.name

  • name of vault

{vault}.path

  • path to vault

{vault}.mountUnder

  • optional
  • by default, all hierarchies are mounted at the root
  • you change this by adding a mountpoint which is equivalent of adding a prefix to all files within the vault

Additional Resources

Discussions