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

View file

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

View file

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