I would say if you want to write it yourself, that's probably your best bet. For TiddlyWiki we just use the browser console, and TiddlyWiki doesn't focus on Javascript as a user feature so this isn't a core focus.
I would say use a widget. If you look through the /core/modules/widgets/ folder you should find one that's close. The text widget comes to mind as a good example that I recently used. That will show you how to insert a DOM node at that place in the document which can then be operated on however you want. If you use the text widget, just replace the text node with a div element or something like that. It's pretty simple. You can also use the set widget to pass in variables or simply refer to any tiddlers you want using "this.wiki" I believe. On Fri, May 15, 2020 at 5:16 PM Scott Sauyet <[email protected]> wrote: > My recent success dynamically building a stand-alone TW to document a > corporate system -- with many thanks due to helpful people here! -- has > made me want to revisit something > <https://groups.google.com/d/msg/tiddlywiki/2E5bvI1KI_E/hwJfG1oLAgAJ> I > stopped working on several years ago when I changed jobs. It's another bit > of documenting a system (this time a code library) by dynamically > generating a TW. I have most of the pieces in place given what I've done > recently. (It's behind a corporate wall, I'm afraid, so I can't share, but > it's working quite well.) > > But there is one piece that I haven't even considered yet. If you visit > the Ramda documentation <https://ramdajs.com/docs/>, you will see in the > top-right of the code examples the choice of visiting that example in Ramda's > REPL <https://ramdajs.com/repl/> or to open it inline. For the inline > part we're embedding <https://runkit.com/docs/embed> RunKit > <https://runkit.com/>. This is a nice feature for library > documentation. Sanctuary.js <https://sanctuary.js.org/> has something > even nicer. > > I have no problem trying to write my own version of something like this as > a TW plugin, but I was wondering if this has already been done. Searches > for REPL and Tiddlywiki turned up nothing useful. > > Are there any code sandbox / REPL plugins already available? Or is there > anything similar that I might look to for inspiration, some way to sandbox > some dynamic JS code away from the TW environment? > > Cheers, > > -- Scott > > -- > You received this message because you are subscribed to the Google Groups > "TiddlyWiki" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywiki/101de743-eab4-45c7-a251-2ed782815e59%40googlegroups.com > <https://groups.google.com/d/msgid/tiddlywiki/101de743-eab4-45c7-a251-2ed782815e59%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAJ1vdSTJhB662-U%2BuoFMOJ3buXuhpMQ%2BkFhEhO4TxXTqQSBVNQ%40mail.gmail.com.

