Skip to content

Commit 352fc09

Browse files
committed
reset with newer template
1 parent 545bd53 commit 352fc09

File tree

21 files changed

+1086
-2160
lines changed

21 files changed

+1086
-2160
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

2-
calcit.edn -diff linguist-generated
3-
calcit.cirru -diff
2+
calcit.cirru -diff linguist-generated
43
yarn.lock -diff linguist-generated

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

2-
/target/
3-
/dist
4-
/node_modules
5-
.cpcache/
6-
.shadow-cljs/
2+
.compact-inc.cirru
3+
.calcit-error.cirru
74

8-
.nrepl-port
5+
js-out/
6+
node_modules/
7+
dist/

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
11

2-
Docs workflow
2+
Docs workflow in Calcit-js
33
----
44

5-
> a template for putting up docs.
5+
> Respo web page based on [calcit-js](https://github.com/calcit-lang/calcit).
6+
7+
Demo http://r.tiye.me/mvc-works/docs-calcit-workflow/ .
8+
9+
### Usages
10+
11+
To develop:
12+
13+
```bash
14+
cr --emit-js # watching
15+
16+
yarn # to install vite
17+
yarn vite # watching and running on localhost:3000
18+
```
19+
20+
calcit-js is using [Calcit Editor](https://github.com/calcit-lang/editor).
21+
22+
To build:
23+
24+
```bash
25+
yarn vite build
26+
http-server dist/
27+
```
628

729
### Workflow
830

9-
Workflow https://github.com/mvc-works/calcit-workflow
31+
https://github.com/mvc-works/docs-calcit-workflow
1032

1133
### License
1234

entry/main.css renamed to assets/main.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22
body {
33
margin: 0;
44
overscroll-behavior-y: none;
5+
overscroll-behavior-x: none;
56
}
67

78
body * {
8-
box-sizing: border-box;
99
flex-shrink: 0;
10+
box-sizing: border-box;
1011
}
1112

1213
::-webkit-scrollbar {
13-
width: 2px;
14-
height: 2px;
14+
width: 4px;
15+
height: 4px;
1516
}
1617

1718
::-webkit-scrollbar-track {
1819
background-color: hsla(0,0%,100%);
1920
}
2021

2122
::-webkit-scrollbar-thumb {
22-
background-color: hsla(200,100%,76%,0.8);
23+
background-color: hsla(200,80%,76%,0.8);
2324
}
2425

2526
::-webkit-scrollbar-corner {
2627
background-color: transparent;
2728
}
2829

29-
::-webkit-resizer{
30+
::-webkit-resizer {
3031
background-color:transparent;
3132
}

calcit.cirru

Lines changed: 588 additions & 991 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/build/main.clj

Lines changed: 0 additions & 27 deletions
This file was deleted.

compact.cirru

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
2+
{} (:package |app)
3+
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!)
4+
:modules $ [] |respo.calcit/ |lilac/ |memof/ |respo-ui.calcit/ |respo-markdown.calcit/ |reel.calcit/
5+
:version |0.0.1
6+
:entries $ {}
7+
:files $ {}
8+
|app.comp.container $ {}
9+
:ns $ quote
10+
ns app.comp.container $ :require (respo-ui.core :as ui)
11+
respo.core :refer $ defcomp defeffect <> >> div button textarea span input
12+
respo.comp.space :refer $ =<
13+
reel.comp.reel :refer $ comp-reel
14+
respo-md.comp.md :refer $ comp-md
15+
app.config :refer $ dev?
16+
:defs $ {}
17+
|comp-container $ quote
18+
defcomp comp-container (reel)
19+
let
20+
store $ :store reel
21+
states $ :states store
22+
cursor $ or (:cursor states) ([])
23+
state $ or (:data states)
24+
{} $ :content "\""
25+
div
26+
{} $ :style (merge ui/global ui/row)
27+
textarea $ {}
28+
:value $ :content state
29+
:placeholder "\"Content"
30+
:style $ merge ui/expand ui/textarea
31+
{} $ :height 320
32+
:on-input $ fn (e d!)
33+
d! cursor $ assoc state :content (:value e)
34+
=< 8 nil
35+
div
36+
{} $ :style ui/expand
37+
comp-md "|This is some content with `code`"
38+
=< |8px nil
39+
button $ {} (:style ui/button) (:inner-text "\"Run")
40+
:on-click $ fn (e d!)
41+
println $ :content state
42+
when dev? $ comp-reel (>> states :reel) reel ({})
43+
|app.schema $ {}
44+
:ns $ quote (ns app.schema)
45+
:defs $ {}
46+
|store $ quote
47+
def store $ {}
48+
:states $ {}
49+
:cursor $ []
50+
|app.updater $ {}
51+
:ns $ quote
52+
ns app.updater $ :require
53+
respo.cursor :refer $ update-states
54+
:defs $ {}
55+
|updater $ quote
56+
defn updater (store op data op-id op-time)
57+
case-default op
58+
do (println "\"unknown op:" op) store
59+
:states $ update-states store data
60+
:hydrate-storage data
61+
|app.main $ {}
62+
:ns $ quote
63+
ns app.main $ :require
64+
respo.core :refer $ render! clear-cache!
65+
app.comp.container :refer $ comp-container
66+
app.updater :refer $ updater
67+
app.schema :as schema
68+
reel.util :refer $ listen-devtools!
69+
reel.core :refer $ reel-updater refresh-reel
70+
reel.schema :as reel-schema
71+
app.config :as config
72+
"\"./calcit.build-errors" :default build-errors
73+
"\"bottom-tip" :default hud!
74+
:defs $ {}
75+
|render-app! $ quote
76+
defn render-app! () $ render! mount-target (comp-container @*reel) dispatch!
77+
|persist-storage! $ quote
78+
defn persist-storage! () (js/console.log "\"persist")
79+
js/localStorage.setItem (:storage-key config/site)
80+
format-cirru-edn $ :store @*reel
81+
|mount-target $ quote
82+
def mount-target $ .!querySelector js/document |.app
83+
|*reel $ quote
84+
defatom *reel $ -> reel-schema/reel (assoc :base schema/store) (assoc :store schema/store)
85+
|main! $ quote
86+
defn main! ()
87+
println "\"Running mode:" $ if config/dev? "\"dev" "\"release"
88+
if config/dev? $ load-console-formatter!
89+
render-app!
90+
add-watch *reel :changes $ fn (reel prev) (render-app!)
91+
listen-devtools! |k dispatch!
92+
js/window.addEventListener |beforeunload $ fn (event) (persist-storage!)
93+
flipped js/setInterval 60000 persist-storage!
94+
let
95+
raw $ js/localStorage.getItem (:storage-key config/site)
96+
when (some? raw)
97+
dispatch! :hydrate-storage $ parse-cirru-edn raw
98+
println "|App started."
99+
|dispatch! $ quote
100+
defn dispatch! (op op-data)
101+
when
102+
and config/dev? $ not= op :states
103+
println "\"Dispatch:" op
104+
reset! *reel $ reel-updater updater @*reel op op-data
105+
|reload! $ quote
106+
defn reload! () $ if (nil? build-errors)
107+
do (remove-watch *reel :changes) (clear-cache!)
108+
add-watch *reel :changes $ fn (reel prev) (render-app!)
109+
reset! *reel $ refresh-reel @*reel schema/store updater
110+
hud! "\"ok~" "\"Ok"
111+
hud! "\"error" build-errors
112+
|app.config $ {}
113+
:ns $ quote (ns app.config)
114+
:defs $ {}
115+
|dev? $ quote
116+
def dev? $ = "\"dev" (get-env "\"mode")
117+
|site $ quote
118+
def site $ {} (:storage-key "\"workflow")

docs/guide.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

entry/github-gist.css

Lines changed: 0 additions & 72 deletions
This file was deleted.

entry/manifest.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)