Sublime Forum

How to open html file in sublime (webview)?

#1

I know that we can have dynamic webview using minihtml preview.
Is it possible to open a *.html file directly in minihtml preview ?

0 Likes

#2

As the name implies, minihtml is only a very small subset of html. So no, you cannot open any random .html file and put it in a minihtml preview (unless of course the html file consists of only tags that are defined by minihtml which is highly unlikely).

Unlike VS Code & Atom (that have been built on top of Electron and ships the entire chromium browser), Sublime Text has been built on top of a custom UI toolkit and does not embed a browser to preview html files.

Since you have mentioned WebView, VS Code has a WebView API where you can actually build fully customizable views using HTML & JavaScript and iirc register it as a tree view icon and access it from there. That’s how you can see Angular or Azure plugins icons (If you install them) at the tree view container I believe.

I had myself asked this question a few weeks back which might be of some interest to you:

0 Likes

#3

I’m aware of this thing that mini html doesn’t support complete html and css tags.
But my purpose is simple and it doesn’t require much of html tags only available basic tags are sufficient.
Only think I required is to open certain file in webview instead of browser.

0 Likes

#4

Pop-ups are provided with a string of HTML to render. Where that string comes from is left to your imagination, I. e. it can of course come from a file if you read its contents first.

2 Likes