obsidian-export is a tool that I use in my workflow to host my digital garden. You can learn more about it at obsidian-export. You can find the source code of my fork on my Github.
My Changes
Remove Obsidian Comments
I added a new command line flag —comments=[keep-unchanged|remove] This is implemented as a post_processor removing anything between two % which Obsidian uses to denote comments. However if the comment is within a code block (as seen below) it won’t be removed.
I use regex in-order to find the comments in the text.
Source Code
Remove table of contents
In my obsidian vault I have a table of contents at the top of most of my notes. However, I currently host my notes through Quartz which offers a table of contents on the right side of the screen. Because of this I don’t also need a table of contents on the top so I just remove it from the markdown file before publishing. I originally was going to render the table of contents myself (seen here Automatic Table of Contents Bug) but I decided this wasn’t worth the effort and to just use the quartz table of contents.
This code is heavily borrowed from an example provided by Nick Groenen, creator of obsidian-export. This option is invoked through the flag —remove-table-of-contents