-
-
Notifications
You must be signed in to change notification settings - Fork 149
How to Klipsify an arbitrary HTML element
Yehonathan Sharvit edited this page May 12, 2019
·
1 revision
By default Klipse klipsifies the HTML elements specified in klipse_settings at page load time.
You can klipsify an arbitrary HTML element at any time, by calling the function klipse.plugin.klipsify and pass it:
- the element to klipsify
- the klipse settings
- the mode of the element (the language of the snippet)
For instance, in order to klipsify the HTML element with id is 'my-js-snippet' that contains javascript code, you run:
klipse.plugin.klipsify(document.getElementById('my-js-snippet'), klipse_settings, "eval-javascript")The list of available modes can be retrieved at run time by running this code:
Object.keys(cljs.core.clj__GT_js(cljs.core.deref(klipse.common.registry.mode_options)))The modes are defined by the files under the src/klipse/lang folder.