This Python script for Windows and MacOS converts your entire Obsidian vault with markdown documents into HTML documents in a new folder with identical structure. The script uses Pandoc and will convert the following parameters:
- File name
- File creation date
- Frontmatter properties copied to HTML meta keys. You define the properties you want to be copied over in the file template.html
- All note contents, of course
- Images are embedded in-place so all notes become self-contained
- Yellow highlights are converted from markdown-style format into HTML-style div tags
- Code comments are colored correctly
- Document links are fully supported
- You can exclude folders you do not want to process using the variable "excluded_dirs". This is already set to {'_excalidraw', '_resources', '_templates', '.obsidian', '.trash'}.
- You can modify the file template.html according to your likings to change the way the HTML file looks.
To run the script you need Python and Pandoc installed. For Python environment I recommend PyCharm CE, Pandoc can be downloaded here.
You can add keys to the file template.html for the Frontmatter properties you want to be copied over. For example:
<meta name="author" content='$author$'>
<meta name="description" content='$description$'>
<meta name="keywords" content='$keywords$'>
Here is a simple example showing how elements are converted from Markdown to HTML: