Cookbook
General
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
Bucket
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.
Launch the command bar
This lets you execute commands inside vscode
- Linux:
Ctrl+Shift+P
- macOS:
Cmd+Shift+P
- Windows:
Ctrl+Shift+P
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:
- Export your data using the JSON Export Pod
- Create an index in elasticsearch (we're using version 7.9)
PUT notes
{
"mappings": {
"properties": {
"created": {
"type": "date",
"format": "epoch_millis"
}
}
}
}
- 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 @-
- 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
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
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:
- Git Journal
- iA Writer
- Epsilon Notes
- Neutrinote (Android only)
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
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.
Markdown Preview
Prevent newly opened files from replacing the preview pane?
Set the following option in your workspace settings
"markdown-preview-enhanced.automaticallyShowPreviewOfMarkdownBeingEdited": true,
Customize Theme
To change the color theme, you can update the markdown-preview-enhanced.previewTheme
vscode setting
Customize CSS
You can see instructions for customizing css here
VSCode
Use Dendron with a current folder
-
- start by initializing a workspace
Initialize Workspace
- shortcuts: none
Create a new workspace
-
- by default, dendron uses a
vaults
folder underneath your workspace to store you vaults. Update your settings and changevault
to the path of your current notes (alternatively, you can also copy your current notes intovault
)
- by default, dendron uses a
"folders": [
{
"path": "vault"
},
...
],
-
- Run
> Dendron: Reload Index
for Dendron to pick up changes
- Run
Access Dendron Workspace from multiple windows
There are usually two scenarios:
- you want two windows of different workspaces
- 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
- a. initialize a new workspace in a different directory. open the settings using
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)
Change the sorting oder in the Explorer Panel
See instructions here
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
- Navigate to the extensions pane
- Search for
@installed
Navigation
Enable Table of Contents
When viewing your notes locally, you can view the toc either from the outline view or by toggling the preview
-
from the outline
From WorkbenchGo to text → -
from the preview
From PreviewGo to text →You can toggle a table of contents from the preview pane using a button toggle.
Issues
- Preview does not persist between reloads/restarts
- Workaround: Always show preview of md being edited
- Preview does not persist between reloads/restarts
Publishing
Incremental Builds
You can do incremental builds from Jekyll and Dendron
- when previewing the site locally, add the
incremental
flagbundle exec jekyll s --watch --incremental
- when building the site, also add an incremental flag
- NOTE: you'll need
rsync
installed to use the incremental flag
- NOTE: you'll need
dendron-cli buildSite --wsRoot {path/to/ws} --vault {path/to/vault} --incremental
Automatically Update Site while editing
The following instructions cover how to update your local preview everytime you make a change to your notes
-
install
dendron-cli
From Dendron CLIGo to text →npm install -g @dendronhq/dendron-cli
-
have jekyll watch your site-root
cd {your-site-root}
bundle exec jekyll s --watch
- use
nodemon
to watch your vault
npm install -g nodemon
nodemon --watch {path/to/vault} --ext md dendron-cli buildSite --wsRoot {path/to/ws} --vault {path/to/vault}
- NOTE: you can combine this with incremental builds to have the best editing experience
Publish password protected site using AWS Amplify
You can click here to see a demo of the end result.
You can access the site with username: dendron
, password: hierarchy
.
- NOTE: this requires hosting your site on AWS. For most people, this will end up costing you a few cents a month.
Setup your github repo
- Create a new github repo using this template.
- In your Dendron workspace, remove the
docs
directory and clone your newly created repositorycd {your-workspace} rm -r docs git clone {your-repo} docs
Setup aws
- Create an aws account
- Login to your AWS account and go select the Amplify Service
- Follow the instructions here to connect your github with your amplify
- Follow the instructions here to restrict access to your site.
- Verify that your site is now password protected
Publish your notes
- Update
siteRepoDir
indendron.yml
with the location of your github directory- Your
dendron.yml
should look similar to the one belowsite: copyAssets: true siteHierarchies: - root siteRootDir: docs usePrettyRefs: true siteRepoDir: docs
- Your
- Run
> Dendron: Publish
to build your notes for publication and push your notes - Your notes are now published privately behind a password
Workspace
Using Dendron with Github and Git
One of our users published a great beginners guide on this here
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
- If you're vault is committed along with your workspace, use
git rm --cached
to remove it from the workspace repo and usegit init
to initialze your vault as a standalone repo - Create a remote repo and push your vault to that repo
- Run Configure (yaml) and add the git remote urls to the repo. the entries should look like what you see below
Using Dendron with Code
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
Renaming a Vault
We currently haven't implemented a command to do but you can use the current manual steps to implement.
- Update the name property in
dendron.yml
- Update the name property on the corresponding workspace folders
- Replace any cross Vault Links with the name of the new workspace
- ctrl search
dendron://{vaultName}
and replace it with the new vaultName
- 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