Dendron is a markdown based note taking tool, and Pandoc is a document conversion tool. However, they don't always play nice together. I wanted to be able to compile my Dendron vault into nice PDFs using pandoc, which is why this exists.
- Pandoc filters for making Dendron links work properly
- a script for adding bibliography information (or other data) to all markdown files in a vault
- also, you should use
pandoc-mermaid-filter
Dendron links look like [[link.to.a.file]]
, which does not work by default with Pandoc. Pandoc filters are provided to convert the links.
dendron_links_md.py
: parses the links into the Pandoc AST.dendron_links_pdf.py
: parses the links, but will additionally link to pdfs files of the same name instead of raw markdown files._dendron_link_tools.py
provides the utilities for working with the Pandoc AST.
pandocfilters
(a python package)- Pandoc itself
To convert a markdown file to a .tex
file with working links to the original markdown:
pandoc my.dendron.file.md -o my.dendron.file.tex --filter dendron_links_md.py
Or, if you intent to compile every file into a pdf:
pandoc my.dendron.file.md -o my.dendron.file.tex --filter dendron_links_pdf.py
If you intent to compile many files, you may create a defaults.yaml
file with the following:
filters:
- dendron_links_pdf.py
and invoke it with
pandoc my.dendron.file.md -o my.dendron.file.tex --defaults defaults.yaml
more information about pandoc filters: https://pandoc.org/filters.html
To be able to cite things from a bibtex file in your notes, you need to set the bibliography in the frontmatter. update_frontmatter.py
sets the same bibliography in the frontmatter in all files in a directory.
First, in update_frontmatter.py
set MY_REFS
equal to a list of paths (absolute, or relative to the markdown file itself, not the python script).
Then, run the script, pointing it to your Dendron vault
python update_frontmatter.py vault
(note: there may be some weirdness for joining paths)
designed to work with the vscode extension PandocCiter
mermaid is a tool for making charts and diagrams that is used in Dendron. Thankfully, there already exists a filter for making this work with Pandoc: pandoc-mermaid-filter
- somehow getting citations to look nice in the Dendron preview
- resolving LaTeX macros into raw LaTeX for the Dendron preview