This is a very creative package! Thanks for sharing!
There are a couple of minor details that I think could be improved:
- The attributes after section headers can be removed, such as
{-}
afterYihui Xie
in the mind map for the blogdown book (the second image above). - To identify section headers robustly, you may try to convert Markdown to JSON via Pandoc, instead of using regular expressions. In your first image,
a literal code chunk
is not a section header but a comment. - You'll have to adjust the levels of headers for parts and appendices, e.g., when you find
# (APPENDIX)
, it is probably a better idea to show all the rest of first-level headers as second-level headers (andAppendix
is the first-level header).