# This file defines a class called 'HtmlText', which can be used just like # a Tkinter.Text widget, except it will parse it's input as HTML and render # the output appropriately (e.g. links, font size, color, style, etc.) # # The HtmlText widget supports the following tags: # # 1. Links # Three different protocols are supported by the tag: # http: - designates that link should open a web page # https: - designates that link should open a web page # command: - designataes that link should be executed as a command # python: - designates that link should be executed as python code # # So if you wanted a link that executed the Chimera command 'open 1gcn', # the HTML tag would look like this: # Open model 1gcn # # Links appear as blue underlined text (as they do in web browsers), and # the mouse changes shape (to a pointing hand) when a link is moused over. # # 'http:' and 'https:' protocol links are handled by using Python's # webbrowser library, calling webbrowser.open with link target (which is # assumed to be an url) # # 'command:' protocol links are handled by calling midas_text.makeCommand # with the link target (which is assumed to be a valid Chimera command) # # 'python:' protocol links are handled using the built in 'exec' command # with the link target (which is assumed to be valid python code). Because # of the contents the extent of Python code that can be used as a link # target is more or less limited to statments that don't require any # indentation; multiple statements could be included by seperating them # with semicolons. # # # 2. Ordered lists
    and Unordered lists