I am following along with this guide on developing a plugin with input handlers. The section on rendering a preview mentions that you can use text or minihtml. I’ve looked at the minihtml reference page, but it is still not clear to me how you pass the html to be processed in the preview
function. For example, how would you change the following preview
function to instead use minihtml? For the sake of brevity, let’s assume my minihtml is already a string in a variable called template
. Thanks!
class MyTextInputHandler(sublime_plugin.TextInputHandler):
def name(self):
return "text"
def placeholder(self):
return "Text to insert"
def preview(self, text):
return "Characters: {}".format(len(text))