Sublime Forum

Use Sublime text markdown viewer

#1

I like the little markdown viewer pop-up for updates. Is there a way to use this viewer while editing markdown?

0 Likes

#2

You may want to check out MarkdownLivePreview, though note that Sublime supports minihtml and not full HTML, so this package (and others) that display the preview directly in Sublime can’t provide a true representation of what the result will ultimately looks like.

0 Likes

#3

Not to mention the final HTML may differ based on the Markdown parser. Two major flavors are “John Gruber Markdown” and “CommonMark”.

0 Likes

#4

I think what OP was trying to say is if this functionality already exists (in the form of update changelog pop-ups), why can’t we have it for viewing custom md files?

0 Likes

#5

That is because the changelog window you see using Help -> Changelog ... is not a markdown viewer. There is a changelog.txt in the root of where the application is installed, that contains some simple minihtml (ST’s own rudimentary HTML rendering engine). The changelog uses an internal html control to render that changelog.txt html in an update window.

ST by default neither has a built in markdown parser for any spec nor a viewer for it.

1 Like

#6

ST4 provides so called HtmlSheets, which could be used to display formated/html content in a side-by-side fashion as we know it from other modern editors. The main issue is ST’s minihtml to support only basic html. Tables or sophisticated stylesheet powered layouts are not supported. Thus any existing markdown to html converter’s output won’t be rendered well.

HtmlSheets also don’t have the concept of a live updateable DOM such as normal browsers. Thus any update results in a complete reparse html content and redraw it, which may not be very efficient when working with large documents.

1 Like