klipse

samedhi 2019-06-29T17:15:50.001600Z

I am Using external libraries (as referenced https://book.klipse.tech/interactive_clojure%5Bscript%5D_code_snippets.html) and it works and I am really impressed with klipse.

samedhi 2019-06-29T17:16:24.002300Z

But I would like to develop on the external library while also viewing the result of the development of the library in my existing documentation.

samedhi 2019-06-29T17:16:53.002700Z

So I have this

<pre>
<code class="klipse-cljs"
data-external-libs="<https://raw.githubusercontent.com/samedhi/firemore/master/src>"&gt;
(require '[firemore.core :as firemore])
&lt;/code&gt;
&lt;/pre&gt;

samedhi 2019-06-29T17:17:16.003200Z

Which is fine, but obviously the code only updates when I push the code to github...

samedhi 2019-06-29T17:18:59.004700Z

I would like to develop locally, so I thought I could maybe just use SimpleHTTPServer (python) at ~/firemore/src/firemore (port 8000) and do something like this

html
&lt;pre&gt;
&lt;code class="klipse-cljs"
data-external-libs="localhost:8000"&gt;
(require '[firemore.core :as firemore])
&lt;/code&gt;
&lt;/pre&gt;

samedhi 2019-06-29T17:19:18.005Z

But this does not work 😞

samedhi 2019-06-29T17:20:16.006Z

Does anyone have an idea about how to do local development on a external library with data-external-libs without pushing to github every time I want to see the change?

samedhi 2019-06-29T17:21:36.006400Z

Just for completion, the result of the above snippet looks like this in my browser.

samedhi 2019-06-29T17:21:51.006500Z

Yehonathan Sharvit 2019-06-29T18:02:25.008800Z

It should work fine with localhost also. However you need to pass the path to the src folder. You can check in the network tab of devtools what files klipse tries to load

samedhi 2019-06-29T18:14:49.009400Z

That is it, turns out the server did work but it needed to be a CORS permissive server to get it to allow.

samedhi 2019-06-29T18:20:43.009800Z

&lt;pre&gt;
 &lt;code class="klipse-cljs"
 data-external-libs="<http://localhost:8000/src>"&gt;
 (require '[firemore.core :as firemore])
 &lt;/code&gt;
 &lt;/pre&gt;

samedhi 2019-06-29T18:21:25.010400Z

cors simple server can be found here -> https://gist.github.com/khalidx/6d6ebcd66b6775dae41477cffaa601e5

samedhi 2019-06-29T18:21:53.010800Z

Thanks @viebel, klipse is so neat.