Is there any way to "export" a Portal session such that I can share it with people who don't have Clojure installed?
There's an atom containing all the tap>'d values as a sequence. You could write those values to a file as EDN I guess?
Or do you mean you want them to be able to see that data in a Portal browser, on another machine? (right now, that would require Clojure in order to run the Portal server)
If you can select the specific value you'd like to share, and it isn't too large, you can use https://github.com/djblue/portal/blob/master/src/portal/ui/commands.cljc#L761-L766. It constructs a url for http://djblue.github.io/portal and formats the data via a url fragment, so the data doesn't even get sent to the server hosting the standalone UI.
That standalone command is pretty cool, but I'm afraid my data is too large for it. I often use portal for exploring data sets. When I'm done, I'll typically ask the LLM to generate a report using hiccup and Vega-lite charts. Actually the best option I see so far is to save page as a complete webpage. It misses some of the interactivity but it's generally pretty good.
Actually, that doesn't work as well as I thought. My thinking was that everything in the export would be static, but that doesn't seem to be the case. I made an export command that does the trick.
If you take a look at https://djblue.github.io/blog/porting-portal-to-basilisp.html, you can see a few examples of embedding the Portal UI in standalone html page
(function (embed) {
embed.renderOutputItem({
mime: 'x-application/edn',
text: function () {
return "{}";
}
}, document.getElementById('e52644cc-4e04-4087-b186-ce6d100eabfc'))
})(window.portal_api.embed())
☝️ is what the code to embed looks likeI could see adding a command to generate a standalone html snippet if people would like it 🤔
It's got my vote! Thank you for your consideration and advice.