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.
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.
So I have this
<pre>
<code class="klipse-cljs"
data-external-libs="<https://raw.githubusercontent.com/samedhi/firemore/master/src>">
(require '[firemore.core :as firemore])
</code>
</pre>
Which is fine, but obviously the code only updates when I push the code to github...
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>
But this does not work 😞
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?
Just for completion, the result of the above snippet looks like this in my browser.
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
That is it, turns out the server did work but it needed to be a CORS permissive server to get it to allow.
<pre>
<code class="klipse-cljs"
data-external-libs="<http://localhost:8000/src>">
(require '[firemore.core :as firemore])
</code>
</pre>
cors simple server can be found here -> https://gist.github.com/khalidx/6d6ebcd66b6775dae41477cffaa601e5
Thanks @viebel, klipse is so neat.