Skip to content

Commit a360809

Browse files
authored
Merge pull request #17 from calcit-lang/line-style
refine line style and inline code style
2 parents 384766f + 320dede commit a360809

File tree

9 files changed

+653
-43
lines changed

9 files changed

+653
-43
lines changed

.gitattributes

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

22
calcit.cirru -diff linguist-generated
33
yarn.lock -diff linguist-generated
4+
docs/* -diff linguist-generated

assets/main.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ blockquote {
5454
line-height: 1.5em;
5555
}
5656

57-
.doc-entry:hover {
58-
background-color: hsla(190, 10%, 70%, 0.1);
59-
}
60-
6157
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
6258
color: #ccc;
6359
}
@@ -71,7 +67,6 @@ blockquote {
7167
color: #ccc;
7268
}
7369

74-
7570
.calcit-tile {
7671
background-image: url('./calcit-tile.png');
7772
background-size: 163px 395px;

calcit.cirru

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

compact.cirru

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11

22
{} (: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)
44
:modules $ [] |respo.calcit/ |lilac/ |memof/ |respo-ui.calcit/ |respo-markdown.calcit/ |reel.calcit/ |respo-router.calcit/ |alerts.calcit/
55
:entries $ {}
66
:files $ {}
77
|docs-workflow.comp.container $ {}
88
:defs $ {}
9+
|*text-content $ quote
10+
defatom *text-content $ []
911
|comp-child-entries $ quote
1012
defcomp comp-child-entries (parent-path entries on-select)
1113
div
@@ -107,11 +109,22 @@
107109
defcomp comp-doc-page (target)
108110
if (some? target)
109111
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
113113
div $ {}
114114
: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 $
115128
div
116129
{} $ :style
117130
merge ui/expand $ {} (:padding "\"20px 16px")
@@ -126,7 +139,7 @@
126139
[] idx $ let
127140
target $ find-target docs path
128141
div
129-
{} (:class-name "\"doc-entry")
142+
{} (:class-name css-doc-entry)
130143
:style $ {} (:cursor :pointer) (:padding "\"0 8px") (:font-size 12)
131144
:color $ hsl 0 0 60
132145
:on-click $ fn (e d!) (on-select path d!)
@@ -139,7 +152,7 @@
139152
[] (:key entry)
140153
div ({})
141154
div
142-
{} (:class-name "\"doc-entry")
155+
{} (:class-name css-doc-entry)
143156
:style $ {} (:padding "\"0 8px") (:cursor :pointer)
144157
:on-click $ fn (e d!)
145158
on-select
@@ -171,7 +184,7 @@
171184
conj parent-path $ :key entry
172185
, d!
173186
div
174-
{} (:class-name "\"doc-entry")
187+
{} (:class-name css-doc-entry)
175188
:style $ merge style-entry
176189
if selected? $ {}
177190
:border-left $ str "\"10px solid " (hsl 200 90 70)
@@ -202,6 +215,28 @@
202215
<> $ str "\"< "
203216
or (:title target) "\"NOT FOUND"
204217
[]
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)
205240
|find-entries $ quote
206241
defn find-entries (entries path)
207242
if (empty? path) entries $ if-let
@@ -222,7 +257,7 @@
222257
, nil
223258
|md $ quote
224259
def md $ new Remarkable
225-
js-object (:html false) (:breaks true)
260+
js-object (:html true) (:breaks true)
226261
:highlight $ fn (code lang)
227262
if (= lang "\"cirru") (color/generate code)
228263
.-value $ .!highlightAuto hljs code (js-array lang)
@@ -257,6 +292,9 @@
257292
"\"highlight.js" :default hljs
258293
"\"cirru-color" :as color
259294
respo-alerts.core :refer $ use-modal
295+
respo.css :refer $ defstyle
296+
respo-ui.css :as css
297+
"\"@memkits/azure-speech-util" :refer $ speechOne
260298
|docs-workflow.config $ {}
261299
:defs $ {}
262300
|dev? $ quote

docs/about.md

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

docs/cirru.md

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"version": "0.0.6",
2+
"version": "0.0.8",
33
"name": "@calcit/docs-workflow",
44
"dependencies": {
5-
"@calcit/procs": "^0.5.41"
5+
"@calcit/procs": "^0.5.41",
6+
"@memkits/azure-speech-util": "^0.0.2"
67
},
78
"devDependencies": {
89
"bottom-tip": "^0.1.3",

0 commit comments

Comments
 (0)