Skip to content

Commit

Permalink
mode deps reorganizing
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Oct 9, 2023
1 parent e6750ca commit 27f28a1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/scicloj/clay/v2/page.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@
["https://unpkg.com/[email protected]/dist/leaflet.js"]}
:css {:from-local-copy
["https://unpkg.com/[email protected]/dist/leaflet.css"]}}
'reagent {:js {:from-local-copy
["https://unpkg.com/react@18/umd/react.production.min.js"
"https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
"https://scicloj.github.io/scittle/js/scittle.js"
"https://scicloj.github.io/scittle/js/scittle.cljs-ajax.js"
"https://scicloj.github.io/scittle/js/scittle.reagent.js"]}}
'tmdjs {:js {:from-local-copy
["https://scicloj.github.io/scittle/js/scittle.tmdjs.js"]}}
'emmy {:js {:from-local-copy
["https://scicloj.github.io/scittle/js/scittle.emmy.js"]}}
'mathbox {:js {:from-local-copy
["https://scicloj.github.io/scittle/js/scittle.mathbox.js"]}}})
["https://scicloj.github.io/scittle/js/scittle.mathbox.js"]}}
'portal {:js {:from-local-copy [portal/url]}}})

(defn js-from-local-copies [& urls]
(->> urls
Expand Down Expand Up @@ -92,7 +99,9 @@
(map :reagent)
special-libs-in-form)
(->> items
(mapcat :deps))))]
(mapcat :deps))
(if (some :reagent items)
['reagent])))]
(when-not port
(throw (ex-info "missing port" {})))
(-> (hiccup.page/html5 [:head
Expand Down Expand Up @@ -130,17 +139,10 @@
(when toc?
(js-from-local-copies
"https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"))
(js-from-local-copies
"https://unpkg.com/react@18/umd/react.production.min.js"
"https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
"https://scicloj.github.io/scittle/js/scittle.js"
"https://scicloj.github.io/scittle/js/scittle.cljs-ajax.js"
"https://scicloj.github.io/scittle/js/scittle.reagent.js")
[:script {:type "text/javascript"}
(-> "highlight/highlight.min.js"
io/resource
slurp)]
(hiccup.page/include-js portal/url)
(->> special-libs
(mapcat (comp :from-local-copy :js special-lib-resources))
distinct
Expand Down

0 comments on commit 27f28a1

Please sign in to comment.