├── resources ├── main.png └── screenshot1.png ├── src ├── dev │ └── shadow │ │ └── user.cljs └── main │ └── cljs_playground │ └── core.cljs ├── .gitignore ├── shadow-cljs.edn ├── package.json ├── index.html └── readme.md /resources/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiensonqin/logseq-cljs-playground/HEAD/resources/main.png -------------------------------------------------------------------------------- /resources/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tiensonqin/logseq-cljs-playground/HEAD/resources/screenshot1.png -------------------------------------------------------------------------------- /src/dev/shadow/user.cljs: -------------------------------------------------------------------------------- 1 | (ns shadow.user 2 | (:require [shadow.cljs.devtools.api :as api])) 3 | 4 | (defn cljs-repl 5 | [] 6 | (api/watch :app) 7 | (api/repl :app)) 8 | -------------------------------------------------------------------------------- /src/main/cljs_playground/core.cljs: -------------------------------------------------------------------------------- 1 | (ns cljs-playground.core) 2 | 3 | (defn main [] 4 | (js/logseq.App.showMsg "Hello from Clojure!")) 5 | 6 | (defn init [] 7 | (-> (js/logseq.ready main) 8 | (.catch js/console.error))) 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | public/js 3 | 4 | /target 5 | /checkouts 6 | /src/gen 7 | 8 | pom.xml 9 | pom.xml.asc 10 | *.iml 11 | *.jar 12 | *.log 13 | .shadow-cljs 14 | .idea 15 | .lein-* 16 | .nrepl-* 17 | .DS_Store 18 | 19 | .hgignore 20 | .hg/ 21 | 22 | .cpcache/ 23 | main.js 24 | cljs-runtime 25 | manifest.edn 26 | -------------------------------------------------------------------------------- /shadow-cljs.edn: -------------------------------------------------------------------------------- 1 | ;; shadow-cljs configuration 2 | {:source-paths 3 | ["src/main" "src/test" "src/dev"] 4 | 5 | :dependencies 6 | [] 7 | 8 | :dev-http {8080 "./"} 9 | 10 | :nrepl {:port 8702} 11 | 12 | :builds 13 | {:app 14 | {:target :browser 15 | :output-dir "./" 16 | :modules {:main {:init-fn cljs-playground.core/init}} 17 | }} 18 | 19 | } 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "logseq-cljs-playground", 3 | "version": "0.0.1", 4 | "private": true, 5 | "main": "index.html", 6 | "author": "Tienson Qin", 7 | "license": "MIT", 8 | "devDependencies": { 9 | "shadow-cljs": "2.16.2" 10 | }, 11 | "logseq": { 12 | "id": "_byud67luv" 13 | }, 14 | "scripts": { 15 | "watch": "npx shadow-cljs watch app", 16 | "release": "npx shadow-cljs release app" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 7 | 8 |