This commit is contained in:
Michiel Borkent 2021-05-24 11:36:53 +02:00
parent 01fb5d679f
commit 1a6ce3312c
3 changed files with 10 additions and 11 deletions

View file

@ -54,9 +54,7 @@
<pre>
<code class="html">&lt;head&gt;
&lt;script src=&quot;https://borkdude.github.io/sci-script-tag/js/sci-script-tag.js&quot;
type=&quot;application/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;https://borkdude.github.io/sci-script-tag/js/sci-script-tag.js&quot; type=&quot;application/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;application/x-sci&quot;&gt;
(defn ^:export my-alert []
@ -71,8 +69,6 @@
&lt;/button&gt;
&lt;/body&gt;</code></pre>
<script type="text/javascript">hljs.highlightAll();</script>
<button onclick="my_alert()">
Click me!
</button>
@ -109,5 +105,7 @@
</code></pre>
<div id="app"></div>
<script type="text/javascript">hljs.highlightAll();</script>
</body>
</html>

View file

@ -50,8 +50,9 @@
(str "(require '[sci.script-tag :refer :all])"
s)))
(c/defn merge-ctx [opts]
(swap! ctx sci/merge-opts opts))
(c/defn register-plugin! [plug-in-name sci-opts]
plug-in-name ;; unused for now
(swap! ctx sci/merge-opts sci-opts))
(c/defn- load-contents [script-tags]
(when-first [tag script-tags]

View file

@ -14,7 +14,7 @@
(def reagent-dom-namespace
{'render (sci/copy-var rdom/render rdns)})
(println :merging)
(st/merge-ctx {:namespaces {'reagent.core reagent-namespace
(st/register-plugin!
::reagent
{:namespaces {'reagent.core reagent-namespace
'reagent.dom reagent-dom-namespace}})
(println :done-merging)