Cookbook

Basics

Launch the command palette

This lets you execute commands inside vscode

  • Linux: Ctrl+Shift+P
  • macOS: Cmd+Shift+P
  • Windows: Ctrl+Shift+P

Manual Install

To manually install a custom version of Dendron, first obtain the Dendron vsix file (most likely, Kevin will send you a dropbox link šŸ˜…). Afterwards, you can install it by the extended options in the extensions pane.

Checking Logs

You can diagnose most problems by checking the logs. You can view the logs using the Open Logs Command

Server Logs

Dendron has two sets of logs - client and server. The client logs you can access using the Open Logs Command. You can access the server logs by following the tutorial here.

Logs from previous session

Dendron has logs for the current session and the previous session.

You can get logs of the previous session by following instructions here

Mobile Support

Dendron does not have a dedicated mobile client at this time. There are numerous mobile markdown editors that can be used to view and edit Dendron notes. Some popular options are listed below:

Most mobile apps do not have git support.

  • If you are on iOS, you can follow the instructions here to sync your git backed Dendron with any note taking tool on iOS.
  • If you are on Android, you can read this writeup by one of users on having Git Sync on Android devices

Vaults

Adding a Remote Vault to your Dendron Workspace

If you haven't already done so, install Dendron and initialize a workspace by following the instructions here.

Use the Vault Add command via the command palette, select remote vault, and paste the git url of the vault that you like to add

Converting a local vault to a remote vault

  1. If your vault is committed along with your workspace, use git rm --cached to remove it from the workspace repo and use git init to initialze your vault as a standalone repo
  2. Navigate to the root of your vault and initialize a git repository
    cd {vaultName}
    git init
    git add .
    git commit -m "initial commit"
    git add origin {your origin}
    git push -u origin HEAD
    
  3. Run Configure (yaml) and add the git remote urls to the repo. the entries should look like what you see below

vaults:
    -
        fsPath: dendron
        remote:
            type: git
            url: 'git@github.com:dendronhq/dendron.git'

When someone pulls down a workspace with a dendron.yml that contains a remote vault, Dendron will automatically initialize the vault at the given fsPath. If the vault is a Workspace Vault (Private), Dendron will pull down the workspace to {workspaceName}/fsPath.

Create note in a specific vault

There are multiple ways to create a note in a specific vault

  • open a note that is already in the vault (all vaults have a root note by default so thats a quick way to select a particular vault)
  • use the vaultSelectionMode modifier on lookup to select a new vault on creation

Renaming a Vault

We currently haven't implemented a command to do but you can use the current manual steps to implement.

  1. Update the name property in dendron.yml
  2. Update the name property on the corresponding workspace folders
  3. Replace any cross Vault Links with the name of the new workspace
  • ctrl search dendron://{vaultName} and replace it with the new vaultName
  1. Run > Reload Window when these steps are completed

Private Vaults

You can create private vaults that won't be published or initialized when others clone the workspace. To do this, run Vault Add and add your private vault as a local vault. After it's been added, run Configure (yaml) and set the visibility of the vault to "private" in dendron.yml.

vaults:
    - fsPath: vault
      visibility: private

Publishing

How do I exclude certain vaults from being published?

Workspace

Access Dendron Workspace from multiple windows

There are usually two scenarios:

  1. you want two windows of different workspaces
  2. you want two windows of the same workspace
  • for 1, create a new window and initialize a new workspace in some directory that is different from your first workspace
  • for 2, you have a few options
    • a. initialize a new workspace in a different directory. open the settings using > Open User Workspace settings (JSON). change the folder to the path of your vault in the initial workspace. run > Reload Window for the changes to take affect
    • b. use a different version of vscode to open the same workspace (eg. vscode insider, vscodium, vscode regular). you need to do this because vscode will re-use the same window when opening the same workspace

Add Dendron to application launchers on Linux desktops

Linux desktop systems often include application launchers where you can see the applications installed on your computer and launch them. You can add an entry for Dendron to the application launcher by creating a file at ~/.local/share/applications/dendron.desktop, then pasting the following contents into it.

[Desktop Entry]
Comment=A personal knowledge management tool that grows as you do.
Exec=code --no-sandbox --new-window ~/Dendron/dendron.code-workspace
Name=Dendron
Type=Application
StartupWMClass=code
Keywords=dendron;notes;pkm;
Categories=Utility;TextEditor;

Make sure the path to the dendron workspace matches your setup. Then, run update-desktop-database ~/.local/share/applications/ in a terminal or restart your system. You should now see Dendron in the launcher under the Utilities section, or if you search for Dendron in your launcher. Launching Dendron from here will launch VSCode with your Dendron workspace open.

Change the sorting order in the Outline Panel

Click the three little dots next to outline to change the sorting order. You can sort by Name (alphabetical) or Position (linear order)

Drag and Drop files into Dendron

To drag files into Dendron, open the workspace pane on the side to drag and drop. We currently recommend you only do this for non-markdown files that you want to link to inside your vaults.

Find Installed Extensions

  1. Navigate to the extensions pane
  2. Search for @installed

Use Dendron with a current folder

  1. start by initializing a workspace

Initialize Workspace

  • shortcuts: none

Create a new workspace

  1. by default, dendron uses a vaults folder underneath your workspace to store you vaults. Update your settings and change vault to the path of your current notes (alternatively, you can also copy your current notes into vault)
"folders": [
    {
        "path": "vault"
    },
    ...
],
  1. Run > Dendron: Reload Index for Dendron to pick up changes

Using Multiple Workspaces

The easiest current way to do this is to have multiple instances of VSCode open and toggle between the two. If you are very adventurous, you might even have multiple versions of vscode for different contexts.

We are working on being able to run Dendron without the need for a workspace. You can track the progress of this on this issue

Other

How can I paste HTML content as Markdown?

If you use VSCode, you can use the Markdown Kit extension. Unfortunately this is not available in VSCodium at this time.

Syncing Dendron between devices

Using git and github

One of our users published a great guide on this here

Use Dendron on a separate instance of VS Code

You can use Dendron on a separate instance of VS Code by launching it with the command line flags --user-data-dir and --extensions-dir:

code --user-data-dir=/path/to/code-dendron --extensions-dir=/path/to/code-dendron-ext

Star/Favorite/Pin Notes

Dendron doesn't currently provide native support for this. You can download the Bookmarks extension to achieve the functionality in the interim.

Analyze notes using elasticsearch

  • WARNING: this is advanced material

With Dendron, you can export your notes using the JSON Export Pod and then use that data to analyze your notes using elasticsearch.

This video walkthrough walks you through that process.

You can download the repo used in this walkthrough from github

Pre-requisites:

  • download and run elasticsearch

Steps:

  1. Export your data using the JSON Export Pod
  2. Create an index in elasticsearch (we're using version 7.9)
PUT notes
{
  "mappings": {
    "properties": {
      "created": {
        "type":   "date",
        "format": "epoch_millis"
      }
    }
  }
}
  1. Pipe exported JSON into the newly created index.
cat /path/to/exported/notes.json | jq -c '.[] | {"index": {"_index": "notes", "notes", "_id": .id}}, .' | curl -H'Content-Type: application/json' -XPOST localhost:9200/_bulk --data-binary @-
  1. Profit!

Some potential use cases you can do using elasticsearch and Dendron:

  • filter your notes by any logical combination of custom attributes
  • make a heatmap of notes created by date
  • get a full list of tags used across your vault and on a per hierarchy basis
  • anything else you can thin of :)

Some useful additional links:

Convert timestamps in the frontmatter

Currently, Dendron notes show timestamps in epoch time which is not the most parsable for humans. You can use the timestamp converter extension order to see a human representation of said timestamp.

Use Dendron with Anki

WebClipper

You can use the markdownload-markdown-web extension to clip content as markdown from Chrome.

Regex

To get familiar with regex syntax, try regexr is a great place to experiment with different queries.

Automatically Convert Casing on a Note

You can use the string converter extension to change [[normal note with spaces]] to [[normal-note-with-spaces]] as well as a series of other text transformations.