Export md-file with all linked files/images (recursively) + convert to html

I made a python-script that lets you specify a single md-file that exists in your vault, and it will copy that file with all of its linked images as well as linked md-files recursively (it goes through these files as well to finds all of its images/links and copies these as well).

You end up with a new folder (vault) that you can easily send to a friend to open in obsidian with just the files needed to show the file you started with and its linked files all the way down to last link.

As a bonus I added an option to create a html-version of the exported vault. If selected, it creates a .html next to each of the md-files. The html-version includes all the images/working links, lists, headings and code-blocks (code-highlighted). It also shows the vault-file/folders in a treeview next to current file with working links).
For easy access it creates an index.html in root of export-vault that takes you to the html-version of the selected file for export.
This feature is super-useful when you wanna share the vault with someone that doesn’t have obsidian.

Only tested in Linux, might need a small tweak to work on windows/mac?
Have fun with the script and please tell me if you think it needs something more (latex support?)

link to python-script on github
/Kalle

3 Likes