-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlark.gohtml
More file actions
359 lines (359 loc) · 7.83 KB
/
lark.gohtml
File metadata and controls
359 lines (359 loc) · 7.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CalcMark Document</title>
<style>
:root {
--color-primary: #7D56F4;
--color-text: #1a1a1a;
--color-text-muted: #555;
--color-bg: #ffffff;
--color-bg-subtle: #f6f8fa;
--color-bg-inset: #f0f2f5;
--color-border: #d1d5db;
--color-code-bg: #f3f4f6;
--color-code-text: #1a1a1a;
--color-error: #cf222e;
--color-error-bg: #ffeef0;
--font-sans: "Inter", system-ui, -apple-system, sans-serif;
--font-mono: "JetBrains Mono", "Fira Code", ui-monospace, "SF Mono", Monaco, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--color-primary: #a371f7;
--color-text: #e5e5e5;
--color-text-muted: #8b949e;
--color-bg: #0d1117;
--color-bg-subtle: #161b22;
--color-bg-inset: #1c2128;
--color-border: #30363d;
--color-code-bg: #161b22;
--color-code-text: #e5e5e5;
--color-error: #f85149;
--color-error-bg: #3d1417;
}
}
[data-theme="dark"] {
--color-primary: #a371f7;
--color-text: #e5e5e5;
--color-text-muted: #8b949e;
--color-bg: #0d1117;
--color-bg-subtle: #161b22;
--color-bg-inset: #1c2128;
--color-border: #30363d;
--color-code-bg: #161b22;
--color-code-text: #e5e5e5;
--color-error: #f85149;
--color-error-bg: #3d1417;
}
body {
font-family: var(--font-sans);
max-width: 900px;
margin: 0 auto;
padding: 0.5rem 2rem;
line-height: 1.6;
color: var(--color-text);
background: var(--color-bg);
}
.calc-block {
margin: 1.5em 0;
padding: 1em;
background: var(--color-bg-subtle);
border-left: 4px solid var(--color-primary);
border-radius: 4px;
}
.calc-line {
display: flex;
justify-content: space-between;
align-items: baseline;
margin: 0.25em 0;
}
.calc-source {
font-family: var(--font-mono);
font-size: 0.95em;
color: var(--color-code-text);
flex: 1;
}
.calc-inline-result {
font-weight: 600;
color: var(--color-primary);
margin-left: 2em;
font-size: 0.9em;
}
.calc-inline-result::before {
content: "= ";
}
.calc-result {
font-weight: 600;
color: var(--color-primary);
margin-top: 0.5em;
padding: 0.5em;
background: var(--color-bg);
border-radius: 3px;
}
.calc-error {
color: var(--color-error);
background: var(--color-error-bg);
padding: 0.5em;
border-radius: 3px;
border-left: 3px solid var(--color-error);
margin-top: 0.5em;
}
.text-block {
margin: 1.5em 0;
}
.text-block p {
margin: 0.75em 0;
}
.cm-interpolated {
font-weight: 600;
}
.text-block h1, .text-block h2, .text-block h3 {
margin-top: 1.5em;
margin-bottom: 0.5em;
}
.text-block:first-child h1:first-child,
.text-block:first-child h2:first-child {
margin-top: 0;
}
.text-block code {
background: var(--color-code-bg);
padding: 0.2em 0.4em;
border-radius: 3px;
font-family: var(--font-mono);
font-size: 0.9em;
}
.text-block pre {
background: var(--color-code-bg);
padding: 1em;
border-radius: 6px;
overflow-x: auto;
}
.text-block pre code {
background: none;
padding: 0;
}
.text-block blockquote {
border-left: 3px solid var(--color-primary);
padding-left: 1em;
margin: 1em 0;
color: var(--color-text-muted);
}
.text-block blockquote p {
margin: 0.5em 0;
}
.text-block table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
}
.text-block th, .text-block td {
border: 1px solid var(--color-border);
padding: 0.5em 0.75em;
text-align: left;
}
.text-block th {
background: var(--color-bg-subtle);
font-weight: 600;
}
/* Embedded mode: goldmark-rendered HTML content */
.embedded-content p {
margin: 0.75em 0;
}
.embedded-content h1, .embedded-content h2, .embedded-content h3,
.embedded-content h4, .embedded-content h5, .embedded-content h6 {
margin-top: 1.5em;
margin-bottom: 0.5em;
}
.embedded-content code {
background: var(--color-code-bg);
padding: 0.2em 0.4em;
border-radius: 3px;
font-family: var(--font-mono);
font-size: 0.9em;
}
/* CalcMark evaluated blocks: purple left accent, normal text color */
.embedded-content pre:has(code.language-calcmark),
.embedded-content pre:has(code.language-cm) {
background: var(--color-bg-subtle);
border-left: 4px solid var(--color-primary);
padding: 1em;
border-radius: 4px;
overflow-x: auto;
}
.embedded-content code.language-calcmark,
.embedded-content code.language-cm {
color: var(--color-code-text);
font-weight: 400;
}
/* Regular code blocks */
.embedded-content pre {
background: var(--color-code-bg);
padding: 1em;
border-radius: 6px;
overflow-x: auto;
}
.embedded-content pre code {
background: none;
padding: 0;
}
.embedded-content blockquote {
border-left: 3px solid var(--color-primary);
padding-left: 1em;
margin: 1em 0;
color: var(--color-text-muted);
}
.embedded-content blockquote p {
margin: 0.5em 0;
}
.embedded-content table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
}
.embedded-content th, .embedded-content td {
border: 1px solid var(--color-border);
padding: 0.5em 0.75em;
text-align: left;
}
.embedded-content th {
background: var(--color-bg-subtle);
font-weight: 600;
}
.embedded-content img {
max-width: 100%;
height: auto;
}
.embedded-content hr {
border: none;
border-top: 1px solid var(--color-border);
margin: 2em 0;
}
.frontmatter {
margin-bottom: 2em;
padding: 1em 1.5em;
background: var(--color-bg-inset);
border-radius: 6px;
border: 1px solid var(--color-border);
}
.frontmatter h3 {
margin: 0 0 0.75em 0;
font-size: 0.9em;
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.frontmatter dl {
margin: 0;
display: grid;
grid-template-columns: auto 1fr;
gap: 0.25em 1em;
}
.frontmatter dt {
font-family: var(--font-mono);
font-size: 0.9em;
color: var(--color-primary);
}
.frontmatter dt::before {
content: "@";
color: var(--color-text-muted);
}
.frontmatter dd {
margin: 0;
font-family: var(--font-mono);
font-size: 0.9em;
color: var(--color-code-text);
}
.frontmatter .exchange dt::before {
content: "";
}
.frontmatter .exchange dt {
color: var(--color-text-muted);
}
.frontmatter hr {
border: none;
border-top: 1px solid var(--color-border);
margin: 0.75em 0;
}
.frontmatter-value {
margin: 0;
font-family: var(--font-mono);
font-size: 0.9em;
color: var(--color-code-text);
}
.frontmatter .extra dt::before {
content: "";
}
.frontmatter .extra dt {
color: var(--color-text-muted);
}
</style>
</head>
<body>
{{if .Content}}
<div class="embedded-content">{{.Content}}</div>
{{else}}
{{if .Frontmatter}}
<div class="frontmatter">
{{if .Frontmatter.Globals}}
<h3>Globals</h3>
<dl>
{{range .Frontmatter.Globals}}
<dt>{{.Name}}</dt>
<dd>{{.Value}}</dd>
{{end}}
</dl>
{{end}}
{{if and .Frontmatter.Globals .Frontmatter.Exchange}}<hr>{{end}}
{{if .Frontmatter.Exchange}}
<h3>Exchange Rates</h3>
<dl class="exchange">
{{range .Frontmatter.Exchange}}
<dt>{{.From}} → {{.To}}</dt>
<dd>{{.Rate}}</dd>
{{end}}
</dl>
{{end}}
{{if .Frontmatter.Scale}}
<h3>Scale</h3>
<p class="frontmatter-value">{{.Frontmatter.Scale}}</p>
{{end}}
{{if .Frontmatter.ConvertTo}}
<h3>Convert To</h3>
<p class="frontmatter-value">{{.Frontmatter.ConvertTo}}</p>
{{end}}
{{if .Frontmatter.Extra}}
<hr>
<dl class="extra">
{{range .Frontmatter.Extra}}
<dt>{{.Key}}</dt>
<dd>{{.Value}}</dd>
{{end}}
</dl>
{{end}}
</div>
{{end}}
{{range .Blocks}}
{{if eq .Type "calculation"}}
<div class="calc-block">
{{range $i, $line := .SourceLines}}
<div class="calc-line">
<code class="calc-source">{{$line.Source}}</code>
{{if $line.Result}}
<span class="calc-inline-result">{{$line.Result}}</span>
{{end}}
</div>
{{end}}
{{if .Error}}
<div class="calc-error"><strong>Error:</strong> {{.Error}}</div>
{{end}}
</div>
{{else}}
<div class="text-block">{{.HTML}}</div>
{{end}}
{{end}}
{{end}}
</body>
</html>