Links created with mdpopups.new_html_sheet
doesn't work
#142
Replies: 2 comments
-
After looking at the sheet doc (from ST), i tried to follow what's in the protocol to call a command, and it still didn't work https://www.sublimetext.com/docs/minihtml.html#protocols <div class="btn-goto-def">
<a href='subl:global_goto_file { "path": "test", "row": 1, "col": 2 }'> Test </a>
</div> |
Beta Was this translation helpful? Give feedback.
-
Let me be specific. Links work fine if they are HTML links. I think you are complaining about commands. But commands work fine as well. You just have to use them correctly. Sheets don't support import mdpopups
import sublime_plugin
class ExampleSheetCommand(sublime_plugin.WindowCommand):
def run(self):
mdpopups.new_html_sheet(
self.window,
'Sheet Test',
'''<a href='subl:mdpopups_sheet_open {"fn": "/Users/facelessuser/Desktop/test.txt"}'>link</a>''',
wrapper_class='mdpopups-test'
)
class MdpopupsSheetOpenCommand(sublime_plugin.WindowCommand):
"""Url handle command."""
def run(self, fn=''):
"""Command?"""
# If no path, do nothing
if not fn:
return
# Make sure we were called with a sheet
sheet = None
if self.window is not None:
group = self.window.active_group()
if group is not None:
sheet = self.window.active_sheet_in_group(group)
# Execute command
if sheet is not None:
self.window.open_file(fn) |
Beta Was this translation helpful? Give feedback.
-
I tried both markdown and html links, none work
css:
content:
script:
Beta Was this translation helpful? Give feedback.
All reactions