Skip to content

Commit

Permalink
goldly sci code with ns
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed May 18, 2022
1 parent 25eb855 commit 0033458
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions demo/demoapp/show.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(ns demoapp.show
(:require
[scratchpad.core :refer [show! clear!]]))


(show! [:p "hello, demo!"])


; evaled expression inside the hiccup.
(show! [:p "Multiplication result: " (* 7 7)])

; code in highlightjs
(show! ['user/codemirror "(println 5) ; this is code"])

; show pinkie tags!
(show! ['user/clock])

; show image (in static resource)
(show! [:img {:src "/r/sun.png"}])
2 changes: 1 addition & 1 deletion demo/scratchpad-config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:goldly {; build
:lazy true
; run-time
:autoload-cljs-dir ["demoapp"]
:autoload-cljs-dir ["demoapp/goldly"]
:routes {:app {"" :scratchpad}
:api {"scratchpad" {:get :scratchpad/get
:post :scratchpad/set}
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
:config ["webly/config.edn" "goldly/config.edn" "scratchpad-config.edn"]}}

; RUN SERVICES (keep running)
:demo
:goldly-run
{:extra-paths ["demo"]
:extra-deps {org.pinkgorilla/goldly-docs {:mvn/version "0.4.512"
:exclusions [org.pinkgorilla/viz-spec]} ; this project
Expand Down
10 changes: 4 additions & 6 deletions resources/ext/scratchpad.edn
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{:name "scratchpad"
; build time
; build
:lazy false ; we dont have any code, lazy fucks up size report
:cljs-namespace []
:cljs-ns-bindings {}
:cljs-bindings {}
:pinkie {}
; run time
:clj-require []
:autoload-cljs-dir ["scratchpad/goldly/lib"
"scratchpad/goldly/page"]
; run
:autoload-cljs-dir ["scratchpad"
"scratchpad/page"]
:autoload-clj-ns [scratchpad.handler]}
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
(ns scratchpad.page.scratchpad
(:require
[r]
[rf]
[user :refer [add-page info]]
[scratchpad.vizspec :refer [render-vizspec]]))

(def empty-scratchpad-hiccup
[:div ;.bg-blue-500.h-24.pt-3
[:blockquote.text-xl.italic.ml-10.text-red-600 "Goldly Scratchpad"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

(ns scratchpad.vizspec
(:require
[pinkie]
[user :refer [resolve-symbol-sci]]))

(defn safe-resolve [s]
(try
Expand Down

0 comments on commit 0033458

Please sign in to comment.