[TxMt] HTML Output of Command to Execute Ruby Function

Dru Kepple drukepple at gmail.com
Thu Oct 10 18:49:15 UTC 2019


Let's suppose I have a command written in Ruby, that is outputting to HTML
in a new window.

Is there a way to create a link in the HTML output that, when clicked, will
actually execute a Ruby function that I define in the command?

For example, something like:

def do_something(x)
    # do something with x
end

puts "<a href=\"command:do_something(42)\">Edit X</a>"

My end goal is to provide an interface for manipulating the current
document; maybe the answer is to do the logic in JS within the HTML window,
and then update the document from there, but I'm equally unsure of how to
do that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macromates.com/textmate/attachments/20191010/e1f5b033/attachment.html>


More information about the TextMate mailing list