Forum moved here!

Home / [Feature Request] Support viewing markdown

JohnC

Please consider adding support for viewing Markdown files as use of this as a markup tool is growing. There are a lot of markdown editors and a few browser plugins to allowing previewing markdown text files, but no stand-alone viewers like Sumatra PDF. This would enhance SumatraPDF significantly.

GitHubRulesOK

SumatraPDF can show text files such as those used in MD editors if the extension is changed to native .txt

here is the same .md file in both although I suspect its not what you are alluding to

if what you are expecting is the HTML rendered output as seen in a browser, then that is a different request and is unlikely to meet by this viewer application as its a totally different format that needs to be generated by the .md editor (and every editor does it differently)

JohnC

True, but what I had in mind was rendering Markdown output similar to plugins for Firefox, Chrome, editors like Notepad++, and dedicated Markdown editors like Dillinger, probably centering on a ‘flavour’ of Markdown like Github (which you seem to like) or Pagedown. The leap from Markdown to Epub is conceivable as epub has html content. Here is someone’s experience: https://puppet.com/blog/how-we-automated-our-ebook-builds-pandoc-and-kindlegen. I use NppMarkdown for viewing/editing markdown in Notepad++ (https://github.com/ningg/npp-markdown). Loading pandoc epub output into SumatraPDF is another option.

GitHubRulesOK

I agree MarkDown is basically a dialect of MHTML just as e-pub is

What needs to be understood is that SumatraPDF has consolidated on using ONE rendering engine (Artiflex MuPDF) and as both indicate the are primarily pdf viewers however there is very basic support for handling other formats

from the MuPDF documentation

14.3.3 EPUB
Support for EPub v2 is provided by epub document handler. Tables are not
currently supported, but is planned. Support for v3 is not planned.
The same document handler supports the FB2 (Fiction Book 2) electronic book
format.

14.3.4 HTML
Support for basic HTML + simple CSS is provided by
htdoc document handler. Tables are not currently supported, but is
planned.

In summary without using for the present an external translation app such as Pandoc (and all the bugs that entails) to convert to e-pub the lightweight “viewer” is unlikely to retain its small size

as you point out you could drop an md file onto a pandoc shortcut and get the following opened in SumatraPDF automatically

JohnC

Good answer - very clear. Thank you.