From drukepple@gmail.com Thu Oct 10 18:49:31 2019 From: Dru Kepple To: textmate@lists.macromates.com Subject: [TxMt] HTML Output of Command to Execute Ruby Function Date: Thu, 10 Oct 2019 12:49:15 -0600 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1919549864842458743==" --===============1919549864842458743== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 "Edit X" 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. --===============1919549864842458743== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.htm" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGRpdj5MZXQmIzM5O3Mgc3VwcG9zZSBJIGhhdmUgYSBjb21tYW5kIHdy aXR0ZW4gaW4gUnVieSwgdGhhdCBpcyBvdXRwdXR0aW5nIHRvIEhUTUwgaW4gYSBuZXcgd2luZG93 LjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+SXMgdGhlcmUgYSB3YXkgdG8gY3JlYXRlIGHCoGxp bmsgaW4gdGhlIEhUTUwgb3V0cHV0IHRoYXQsIHdoZW4gY2xpY2tlZCwgd2lsbCBhY3R1YWxseSBl eGVjdXRlIGEgUnVieSBmdW5jdGlvbiB0aGF0IEkgZGVmaW5lIGluIHRoZSBjb21tYW5kPzwvZGl2 PjxkaXY+PGJyPjwvZGl2PjxkaXY+Rm9yIGV4YW1wbGUsIHNvbWV0aGluZyBsaWtlOjwvZGl2Pjxk aXY+PGJyPjwvZGl2PjxkaXY+ZGVmIGRvX3NvbWV0aGluZyh4KTwvZGl2PjxkaXY+wqAgwqAgIyBk byBzb21ldGhpbmcgd2l0aCB4PC9kaXY+PGRpdj5lbmQ8L2Rpdj48Z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