axiros/terminal_markdown_viewer

Support for CommonMark

Opened this issue · 3 comments

Are there any plans to support CommonMark? It's a tricky question, because even if it's possible to use Python-Markdown as a CommonMark parser (as stated in Python-Markdown/markdown#338), the use of https://github.com/rolandshoemaker/CommonMark-py might actually be simpler.

axgkl commented

Hi, this one shot me out of real life for a month and left me with an unfinished general html terminal viewer :-)
seriously: You are absolutely right and their parser is superconvenient plus finally a spec - but implementing it I realized that to do a really good markdown viewer you can't walk over an element tree but have to render html, since so much html is allowed in markdown (and used in the wild, e.g. for image sizes and so on). So I have to leave this one open and I guess it will become wintertime until I find time to work on that further. for now I fixed a few obvious bugs in the markdown.py based hack here, maybe you can live with it for now.

Hi, this one shot me out of real life for a month and left me with an unfinished general html terminal viewer :-)

Oh, I'm really sorry for that. This definitely wasn't the goal.

for now I fixed a few obvious bugs in the markdown.py based hack here, maybe you can live with it for now.

Thank you for the fixings. I've lived without CommonMark support up until now, so I'll survive even further ;) And I'm looking forward to the features which do not just reflect tree traversal, but take into account basic styling.

axgkl commented

Basic styling, indents, 2 column layouts, margins, all that, thats exactly where I got stuck - led me to using CSS, implemented CSS 2,then after hitting all the new stuff in CSS3 I had to delay it for matters of earning some bucks again :-/
Wintertime, as said...