KLIPSE is a clojure[script] web REPL built on top of self-host clojurescript.
In this article, we describe how to tweak KLIPSE.
URL parameters
KLIPSE configuration is done with the url parameters:
cljs_in=<cljs_code>- initial content of theclojurescriptbox (codemust be encoded properly)cljs_in.gist=<gist_id>- load code from a gist; e.g. http://app.klipse.tech?cljs_in.gist=viebel/368d3bec58d3ec47e935ad488bafb600&eval_only=1container=1- container more useful for UI stuff: instead of the compilation box, you have your klipse containerjs_only=1- display onlyinputandjsboxeseval_only=1- display onlyinput,evalandprintboxesstatic-fns=true- eval and transpile js code with static dispatchexternal-libs- array of external libs to resolve the namespace dependencies. Here is an example with the gadjett library. Each lib name must me wrapped in double quotes.verbose- (default false) passed to bootstrapedevalandcompilefunctions as:verboseoptscache-buster- (default false) when true the namespaces are loaded with a cache bustermax-eval-duration- (default 1000) max number of 1000 seconds the code is allowed to run synchronously before being interrupted.compile-display-guard: (default false) when true, display the anti-starvation code inside result of compilationprint-length: (default 1000) max number of items in collections to display - useful to prevent browser stuck when evaluating infinite sequences like(range)beautify-strings: (default false) when evaluation result is a string - display the “interior” of the string without escaping the quotes.
Hotkeys
Interaction with the REPL is done with hotkeys:
Ctrl-EnterorCmd-Enter- eval and transpileCtrl-S- display in the console and alert box shareable url that embeds the content of your current KLIPSE session.Ctrl-R- reload the app with the same content (pass the content tocljs_inurl parameter).