using Obsidian
vaultdir = joinpath(root, "test", "data", "presidents-vault")
v = Vault(vaultdir)"Obsidian vault with 13 notes"
Documentation for version: 0.5.0
February 20, 2025
1. Create a Vault. We’ve predefined a variable named root to point to the base directory of this repository, and will use a sample Obsidian vault in the repository’s test/data directory.
"Obsidian vault with 13 notes"
2. Define a destination directory.
3. Export the vault to the destination.
To see how Obsidian notes are convereted to Markdown files, let’s compare the contents of the source file for Abraham Lincoln with the corresponding output file.
exportmd has several optional parameters that let you control how obsidian tags, dataview key-value properties, yaml headers, and output file names are treated. See the guides (cookbooks) section of the documentation for full examples.
This code prints the contents of the original Obsidian note:
The Markdown export maintains the directory structure of the Obsidan vault. Looking at the path of the Obsidian note for Abraham Lincoln, I saw that it was placed in a directory named people, so the Markdown output will be in a people subdirectory of the export root. By default, names of output files replace spaces with underscores, and use quarto’s .qmd extension, rather than Obsidian’s .md,
With that in mind, we can use the following code to print out the Markdown export:
As you can see in the first line of the output file, the original wikilink [[Lincoln]] has been converted to a normal Markdown link using
Using the default values for exportmd’s optional parameters, the following parts of the source file have been removed:
president#assassinated)(hiddensequence:: 16) and visible ([sequence::16]) formatsAll of these data values are available from the Vault object, v. Here are the Obsidan tags:
Here are the dataview properties (key/value pairs):