There has been Strapdownjs[1] around for quite a while now. It's simple, supports some theming as well. Anyway, good luck with this. Always fun to build something from scratch.
[1] - http://strapdownjs.com/
[1] - http://strapdownjs.com/
I use <xmp> for html code commenting - see the source code at https://elementcss.neocities.org/
The one thing these markdown examples are missing is a way to do grids! I bet there's a clever way to make columns and rows work.