Fork me on GitHub
#klipse
<
2019-06-29
>
samedhi17:06:50

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.

samedhi17:06:24

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.

samedhi17:06:53

So I have this

<pre>
<code class="klipse-cljs"
data-external-libs="">
(require '[firemore.core :as firemore])
</code>
</pre>

samedhi17:06:16

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

samedhi17:06:59

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
<pre>
<code class="klipse-cljs"
data-external-libs="localhost:8000">
(require '[firemore.core :as firemore])
</code>
</pre>

samedhi17:06:18

But this does not work 😞

samedhi17:06:16

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?

samedhi17:06:36

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

Yehonathan Sharvit18:06:25

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

samedhi18:06:49

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

samedhi18:06:43

<pre>
 <code class="klipse-cljs"
 data-external-libs="">
 (require '[firemore.core :as firemore])
 </code>
 </pre>

samedhi18:06:53

Thanks @viebel, klipse is so neat.