Dev Build 3070 is out now.
There are a few new API functions in 3070:
class View:
def show_popup(self, content, flags = HTML, location = -1,
max_width = 320, max_height = 240,
on_navigate = None, on_hide = None):
...
def update_popup(self, content):
...
def is_popup_visible(self):
...
def hide_popup(self):
...
This enables plugins to show a tooltip style window within a View. A simple usage example is:
view.show_popup('Hello, <b>World!</b><br><a href="moo">Click Me</a>', on_navigate=print)
The popup accepts a subset of HTML and CSS. Supported tags:
p, br, a, b, u, i, a, h1…h6, big, tt, div, style
Supported CSS properties:
display (block or inline only), background-color (block elements only), color, margin, font-size, font-family, font-weight, font-style, text-decoration. Supported units are px, pt and em.
CSS may be provided in tags and style= attributes, but external style sheets aren’t supported. Only simple selectors (i.e., comma separated lists of “p”, “.class”, and “#id” selectors) are supported.
By default the popup will be run with a user style sheet matching the font size and font family that the View is using, but this can be overridden via regular CSS.
The full HTML5 parsing algorithm isn’t used, so please be mindful to pass in only well formed HTML. Only a few entities are supported: < > & and Â
Edit: Nothing in the popup API is currently set in stone, and is very much liable to change in a future build. I’m more than happy to take feedback here.
Please note that if you are using the BracketHighlighter plugin, ensure you have updated to the latest version or it will be disabled, due to an incompatibility Sublime Text introduced in 3067.