This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-21
Channels
- # announcements (2)
- # aws (1)
- # beginners (172)
- # boot (3)
- # calva (19)
- # cider (18)
- # clj-kondo (5)
- # cljsrn (18)
- # clojure (47)
- # clojure-europe (9)
- # clojure-finland (7)
- # clojure-italy (3)
- # clojure-nl (15)
- # clojure-spec (20)
- # clojure-sweden (2)
- # clojure-uk (72)
- # clojurescript (45)
- # cursive (42)
- # datomic (6)
- # duct (4)
- # emacs (4)
- # expound (48)
- # figwheel-main (7)
- # fulcro (64)
- # graphql (8)
- # hoplon (9)
- # hyperfiddle (1)
- # jackdaw (8)
- # jobs (4)
- # jobs-discuss (61)
- # klipse (5)
- # leiningen (6)
- # off-topic (72)
- # pathom (2)
- # planck (11)
- # re-frame (1)
- # reagent (3)
- # reitit (16)
- # remote-jobs (17)
- # ring-swagger (3)
- # shadow-cljs (49)
- # spacemacs (12)
- # sql (3)
- # tools-deps (124)
- # vim (64)
- # xtdb (4)
@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: https://github.com/viebel/klipse-clj
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 https://github.com/viebel/klipse#access-the-codemirror-editors-programmaticaly).
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: https://github.com/viebel/klipse/wiki/How-to-Klipsify-an-arbitrary-HTML-element
I hope that it helps
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!
My pleasure @porkostomus