Fork me on GitHub
Yehonathan Sharvit05:05:44

@porkostomus That sounds like a cool project. You have two options here: First Option: Not using Klipse for the UI but only using Klipse for the cljs evaluation. There is a repo that exposes an eval function here: Second Option: Using Klipse for both the UI and the cljs evaluation. In that case, you can use the global var klipse_editors that is an array of codemirror editors and use getValue() to retrieve the content of each editor e.g. klipse_editors[0].getValue() (see

Yehonathan Sharvit05:05:46

I guess that you want to allow the user to add a Klipse snippet by clicking on a button or something, which is a slightly different use case than the usual use case for Klipse where the snippets are klipsified at page load time. To implement that, you need to Klipsify a snippet explicitly. See here for how to do that:

Yehonathan Sharvit05:05:58

I hope that it helps

Bobbi Towers10:05:06

Wow, this is great! Indeed the last option is what I'm going for eventually, to be able to interactively add code blocks, formulas and explanations. But since this is a learning project I'll probably try out each of them along the way. Thank you so much for all of this!