|
1 | 1 |
|
2 | 2 | {} (:package |docs-workflow) |
3 | | - :configs $ {} (:init-fn |docs-workflow.main/main!) (:reload-fn |docs-workflow.main/reload!) (:version |0.0.5) |
| 3 | + :configs $ {} (:init-fn |docs-workflow.main/main!) (:reload-fn |docs-workflow.main/reload!) (:version |0.0.8) |
4 | 4 | :modules $ [] |respo.calcit/ |lilac/ |memof/ |respo-ui.calcit/ |respo-markdown.calcit/ |reel.calcit/ |respo-router.calcit/ |alerts.calcit/ |
5 | 5 | :entries $ {} |
6 | 6 | :files $ {} |
7 | 7 | |docs-workflow.comp.container $ {} |
8 | 8 | :defs $ {} |
| 9 | + |*text-content $ quote |
| 10 | + defatom *text-content $ [] |
9 | 11 | |comp-child-entries $ quote |
10 | 12 | defcomp comp-child-entries (parent-path entries on-select) |
11 | 13 | div |
|
107 | 109 | defcomp comp-doc-page (target) |
108 | 110 | if (some? target) |
109 | 111 | div |
110 | | - {} $ :style |
111 | | - merge ui/expand $ {} (:padding "\"8px 16px") |
112 | | - :background-color $ hsl 0 0 100 0.6 |
| 112 | + {} $ :class-name css-doc-page |
113 | 113 | div $ {} |
114 | 114 | :innerHTML $ .!render md (:content target) |
| 115 | + a $ {} (:inner-text "\"Speech") |
| 116 | + :class-name $ str-spaced css/link css-speech-button |
| 117 | + :on-click $ fn (e d1) |
| 118 | + do |
| 119 | + reset! *text-content $ [] |
| 120 | + -> e :event .-target .-parentElement .-firstChild .-children js/Array.from $ .!forEach |
| 121 | + fn (child idx ? a) |
| 122 | + if |
| 123 | + not= "\"PRE" $ .-tagName child |
| 124 | + swap! *text-content conj $ .-innerText child |
| 125 | + speechOne (.join-str @*text-content &newline) (get-env "\"azure-key") (get-env "\"lang" "\"en-US") |
| 126 | + fn $ |
| 127 | + fn $ |
115 | 128 | div |
116 | 129 | {} $ :style |
117 | 130 | merge ui/expand $ {} (:padding "\"20px 16px") |
|
126 | 139 | [] idx $ let |
127 | 140 | target $ find-target docs path |
128 | 141 | div |
129 | | - {} (:class-name "\"doc-entry") |
| 142 | + {} (:class-name css-doc-entry) |
130 | 143 | :style $ {} (:cursor :pointer) (:padding "\"0 8px") (:font-size 12) |
131 | 144 | :color $ hsl 0 0 60 |
132 | 145 | :on-click $ fn (e d!) (on-select path d!) |
|
139 | 152 | [] (:key entry) |
140 | 153 | div ({}) |
141 | 154 | div |
142 | | - {} (:class-name "\"doc-entry") |
| 155 | + {} (:class-name css-doc-entry) |
143 | 156 | :style $ {} (:padding "\"0 8px") (:cursor :pointer) |
144 | 157 | :on-click $ fn (e d!) |
145 | 158 | on-select |
|
171 | 184 | conj parent-path $ :key entry |
172 | 185 | , d! |
173 | 186 | div |
174 | | - {} (:class-name "\"doc-entry") |
| 187 | + {} (:class-name css-doc-entry) |
175 | 188 | :style $ merge style-entry |
176 | 189 | if selected? $ {} |
177 | 190 | :border-left $ str "\"10px solid " (hsl 200 90 70) |
|
202 | 215 | <> $ str "\"< " |
203 | 216 | or (:title target) "\"NOT FOUND" |
204 | 217 | [] |
| 218 | + |css-doc $ quote |
| 219 | + defstyle css-doc $ {} |
| 220 | + "\"$0" $ {} (:font-size 15) |
| 221 | + "\"$0 p" $ {} (:line-height 1.56) |
| 222 | + "\"$0 p > code" $ {} |
| 223 | + :background-color $ hsl 0 0 97 |
| 224 | + :padding "\"0 6px" |
| 225 | + :border-radius "\"3px" |
| 226 | + :border $ str "\"1px solid " (hsl 0 0 90) |
| 227 | + |css-doc-entry $ quote |
| 228 | + defstyle css-doc-entry $ {} ("\"$0" style-entry) |
| 229 | + "\"$0:hover" $ {} |
| 230 | + :background-color $ hsl 190 10 70 0.1 |
| 231 | + |css-doc-page $ quote |
| 232 | + defstyle css-doc-page $ {} |
| 233 | + "\"$0" $ merge ui/expand |
| 234 | + {} (:padding "\"8px 16px") |
| 235 | + :background-color $ hsl 0 0 100 0.6 |
| 236 | + :position :relative |
| 237 | + |css-speech-button $ quote |
| 238 | + defstyle css-speech-button $ {} |
| 239 | + "\"$0" $ {} (:position :absolute) (:top 32) (:right 8) (:font-family css/font-fancy) |
205 | 240 | |find-entries $ quote |
206 | 241 | defn find-entries (entries path) |
207 | 242 | if (empty? path) entries $ if-let |
|
222 | 257 | , nil |
223 | 258 | |md $ quote |
224 | 259 | def md $ new Remarkable |
225 | | - js-object (:html false) (:breaks true) |
| 260 | + js-object (:html true) (:breaks true) |
226 | 261 | :highlight $ fn (code lang) |
227 | 262 | if (= lang "\"cirru") (color/generate code) |
228 | 263 | .-value $ .!highlightAuto hljs code (js-array lang) |
|
257 | 292 | "\"highlight.js" :default hljs |
258 | 293 | "\"cirru-color" :as color |
259 | 294 | respo-alerts.core :refer $ use-modal |
| 295 | + respo.css :refer $ defstyle |
| 296 | + respo-ui.css :as css |
| 297 | + "\"@memkits/azure-speech-util" :refer $ speechOne |
260 | 298 | |docs-workflow.config $ {} |
261 | 299 | :defs $ {} |
262 | 300 | |dev? $ quote |
|
0 commit comments