@twango/twiki 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/.github/actions/product-cache/action.yml +32 -0
  2. package/.github/actions/product-cache/index.mjs +450 -0
  3. package/LICENSE +21 -0
  4. package/README.md +146 -2
  5. package/bun.lock +1701 -0
  6. package/cli/runtime.test.ts +420 -0
  7. package/cli/runtime.ts +385 -0
  8. package/cli/twiki.ts +305 -0
  9. package/package.json +138 -4
  10. package/site/_headers +7 -0
  11. package/site/assets/fonts/OFL.txt +93 -0
  12. package/site/assets/fonts/OverusedGrotesk-SemiBold.ttf +0 -0
  13. package/site/assets/social-background.svg +38 -0
  14. package/site/bun.lock +1701 -0
  15. package/site/database/index.ts +7 -0
  16. package/site/database/schema.ts +95 -0
  17. package/site/drizzle.config.ts +7 -0
  18. package/site/migrations/0001_auth.sql +14 -0
  19. package/site/migrations/0002_site_access.sql +5 -0
  20. package/site/migrations/0003_github_username.sql +1 -0
  21. package/site/migrations/meta/0002_snapshot.json +432 -0
  22. package/site/migrations/meta/0003_snapshot.json +439 -0
  23. package/site/migrations/meta/_journal.json +27 -0
  24. package/site/package.json +120 -0
  25. package/site/src/app.d.ts +14 -0
  26. package/site/src/app.html +11 -0
  27. package/site/src/hooks.server.ts +12 -0
  28. package/site/src/lib/analytics-config.json +1 -0
  29. package/site/src/lib/analytics.ts +40 -0
  30. package/site/src/lib/auth-config.json +3 -0
  31. package/site/src/lib/components/SEO.svelte +113 -0
  32. package/site/src/lib/components/doc/AccessLink.svelte +27 -0
  33. package/site/src/lib/components/doc/Backlinks.svelte +59 -0
  34. package/site/src/lib/components/doc/Breadcrumbs.svelte +29 -0
  35. package/site/src/lib/components/doc/ContentMeta.svelte +61 -0
  36. package/site/src/lib/components/doc/DocPager.svelte +91 -0
  37. package/site/src/lib/components/doc/DocShell.svelte +115 -0
  38. package/site/src/lib/components/doc/LicenseNotice.svelte +26 -0
  39. package/site/src/lib/components/doc/LockedContent.svelte +29 -0
  40. package/site/src/lib/components/doc/NavTree.svelte +158 -0
  41. package/site/src/lib/components/doc/NoteActions.svelte +139 -0
  42. package/site/src/lib/components/doc/PublicationBadge.svelte +49 -0
  43. package/site/src/lib/components/doc/ReaderModeToggle.svelte +19 -0
  44. package/site/src/lib/components/doc/Sidebar.svelte +351 -0
  45. package/site/src/lib/components/doc/Toc.svelte +339 -0
  46. package/site/src/lib/components/doc/enhancements.ts +146 -0
  47. package/site/src/lib/components/doc/heading-tracker.svelte.ts +39 -0
  48. package/site/src/lib/components/doc/image-preview.ts +114 -0
  49. package/site/src/lib/components/doc/reader-mode.svelte.ts +40 -0
  50. package/site/src/lib/components/embeds/mermaid.ts +353 -0
  51. package/site/src/lib/components/files/FileCode.svelte +81 -0
  52. package/site/src/lib/components/files/FileExplorer.svelte +74 -0
  53. package/site/src/lib/components/files/FileHistory.svelte +170 -0
  54. package/site/src/lib/components/files/FileIcon.svelte +28 -0
  55. package/site/src/lib/components/files/FileRmd.svelte +209 -0
  56. package/site/src/lib/components/files/FileTabs.svelte +180 -0
  57. package/site/src/lib/components/files/FileTree.svelte +67 -0
  58. package/site/src/lib/components/files/blame-gutter.ts +45 -0
  59. package/site/src/lib/components/files/code-view.ts +98 -0
  60. package/site/src/lib/components/files/file-workspace.svelte.ts +100 -0
  61. package/site/src/lib/components/graph/GraphPanel.svelte +275 -0
  62. package/site/src/lib/components/graph/GraphView.svelte +100 -0
  63. package/site/src/lib/components/graph/graph-data.ts +137 -0
  64. package/site/src/lib/components/graph/graph-model.ts +103 -0
  65. package/site/src/lib/components/graph/index.ts +3 -0
  66. package/site/src/lib/components/graph/render-graph.ts +626 -0
  67. package/site/src/lib/components/popover/index.ts +1 -0
  68. package/site/src/lib/components/popover/link-popovers.ts +233 -0
  69. package/site/src/lib/components/popover/popover.css +82 -0
  70. package/site/src/lib/components/search/SearchButton.svelte +57 -0
  71. package/site/src/lib/components/search/SearchPalette.svelte +189 -0
  72. package/site/src/lib/components/search/index.ts +3 -0
  73. package/site/src/lib/components/search/pagefind-client.svelte.ts +129 -0
  74. package/site/src/lib/components/search/pagefind-query.ts +22 -0
  75. package/site/src/lib/components/search/pagefind-url.ts +12 -0
  76. package/site/src/lib/components/search/search-state.svelte.ts +22 -0
  77. package/site/src/lib/components/ui/IconButton.svelte +30 -0
  78. package/site/src/lib/components/ui/ThemeToggle.svelte +22 -0
  79. package/site/src/lib/components/ui/index.ts +1 -0
  80. package/site/src/lib/config.ts +9 -0
  81. package/site/src/lib/content-license.ts +7 -0
  82. package/site/src/lib/file-history.ts +37 -0
  83. package/site/src/lib/file-icons.ts +27 -0
  84. package/site/src/lib/file-tabs.ts +72 -0
  85. package/site/src/lib/files.ts +73 -0
  86. package/site/src/lib/github-user.ts +70 -0
  87. package/site/src/lib/metadata.ts +166 -0
  88. package/site/src/lib/notebook-nav.ts +63 -0
  89. package/site/src/lib/publication.ts +1 -0
  90. package/site/src/lib/rmd.ts +156 -0
  91. package/site/src/lib/server/access-admin.ts +33 -0
  92. package/site/src/lib/server/content-model.ts +253 -0
  93. package/site/src/lib/server/content-provider.ts +266 -0
  94. package/site/src/lib/server/content.ts +277 -0
  95. package/site/src/lib/server/runtime-content.ts +34 -0
  96. package/site/src/lib/site-config.json +9 -0
  97. package/site/src/lib/social-image.ts +13 -0
  98. package/site/src/lib/styles/article.css +607 -0
  99. package/site/src/lib/styles/foundation.css +138 -0
  100. package/site/src/lib/styles/print.css +115 -0
  101. package/site/src/lib/styles/shell.css +182 -0
  102. package/site/src/lib/text-exports.ts +5 -0
  103. package/site/src/lib/types.ts +140 -0
  104. package/site/src/lib/utils.ts +6 -0
  105. package/site/src/routes/+error.svelte +16 -0
  106. package/site/src/routes/+layout.server.ts +10 -0
  107. package/site/src/routes/+layout.svelte +72 -0
  108. package/site/src/routes/+layout.ts +3 -0
  109. package/site/src/routes/404/+page.svelte +13 -0
  110. package/site/src/routes/[...slug]/+page.server.ts +24 -0
  111. package/site/src/routes/[...slug]/+page.svelte +180 -0
  112. package/site/src/routes/[course]/files/[...file]/+page.svelte +373 -0
  113. package/site/src/routes/[course]/files/[...file]/+page.ts +38 -0
  114. package/site/src/routes/admin/access/+page.server.ts +53 -0
  115. package/site/src/routes/admin/access/+page.svelte +118 -0
  116. package/site/src/routes/graph.json/+server.ts +7 -0
  117. package/site/src/routes/index.xml/+server.ts +7 -0
  118. package/site/src/routes/layout.css +10 -0
  119. package/site/src/routes/robots.txt/+server.ts +9 -0
  120. package/site/src/routes/sitemap.xml/+server.ts +7 -0
  121. package/site/src/routes/tags/+page.server.ts +5 -0
  122. package/site/src/routes/tags/+page.svelte +38 -0
  123. package/site/src/routes/tags/[...tag]/+page.server.ts +22 -0
  124. package/site/src/routes/tags/[...tag]/+page.svelte +52 -0
  125. package/site/static/favicon.png +0 -0
  126. package/site/static/fonts/JetBrainsMono-Italic-VF.woff2 +0 -0
  127. package/site/static/fonts/JetBrainsMono-VF.woff2 +0 -0
  128. package/site/static/fonts/OverusedGrotesk-VF.woff2 +0 -0
  129. package/site/static/fonts/OverusedGroteskItalic-VF.woff2 +0 -0
  130. package/site/static/fonts/Virgil.woff2 +0 -0
  131. package/site/svelte.config.js +71 -0
  132. package/site/tooling/LICENSE-quartz +25 -0
  133. package/site/tooling/adapter.js +55 -0
  134. package/site/tooling/assets.ts +323 -0
  135. package/site/tooling/benchmark.ts +191 -0
  136. package/site/tooling/build.ts +407 -0
  137. package/site/tooling/cache.ts +133 -0
  138. package/site/tooling/check-diagrams.ts +164 -0
  139. package/site/tooling/check-links.ts +86 -0
  140. package/site/tooling/check-targets.ts +139 -0
  141. package/site/tooling/compiler.ts +1386 -0
  142. package/site/tooling/deploy.ts +112 -0
  143. package/site/tooling/fingerprint.ts +81 -0
  144. package/site/tooling/lib/app-version.js +92 -0
  145. package/site/tooling/lib/application-asset-urls.ts +27 -0
  146. package/site/tooling/lib/application-cache.ts +269 -0
  147. package/site/tooling/lib/asset-hash-cache.ts +116 -0
  148. package/site/tooling/lib/autotag.ts +99 -0
  149. package/site/tooling/lib/build-assembly.ts +148 -0
  150. package/site/tooling/lib/build-workspace.ts +386 -0
  151. package/site/tooling/lib/cache-selection.ts +70 -0
  152. package/site/tooling/lib/cloudflare-prewarm.js +40 -0
  153. package/site/tooling/lib/comments.ts +32 -0
  154. package/site/tooling/lib/content-cache.ts +244 -0
  155. package/site/tooling/lib/content-urls.ts +50 -0
  156. package/site/tooling/lib/course-cache.ts +298 -0
  157. package/site/tooling/lib/course-files.ts +281 -0
  158. package/site/tooling/lib/currency.ts +33 -0
  159. package/site/tooling/lib/deployment-config.ts +222 -0
  160. package/site/tooling/lib/deployment-manifest.ts +274 -0
  161. package/site/tooling/lib/deployment-prepare.ts +325 -0
  162. package/site/tooling/lib/deployment-upload.ts +293 -0
  163. package/site/tooling/lib/dev-git-state.ts +130 -0
  164. package/site/tooling/lib/dev-history.ts +86 -0
  165. package/site/tooling/lib/dev-social-images.ts +38 -0
  166. package/site/tooling/lib/dev-state.ts +107 -0
  167. package/site/tooling/lib/edition-builds.ts +184 -0
  168. package/site/tooling/lib/edition-paths.js +29 -0
  169. package/site/tooling/lib/empty-tag-route.js +23 -0
  170. package/site/tooling/lib/file-history.ts +201 -0
  171. package/site/tooling/lib/file-icons.ts +93 -0
  172. package/site/tooling/lib/file-policy.ts +38 -0
  173. package/site/tooling/lib/file-search.js +13 -0
  174. package/site/tooling/lib/git-revisions.ts +41 -0
  175. package/site/tooling/lib/history-pool.ts +74 -0
  176. package/site/tooling/lib/history-worker.ts +22 -0
  177. package/site/tooling/lib/knit-rmd.R +38 -0
  178. package/site/tooling/lib/lastmod.ts +201 -0
  179. package/site/tooling/lib/markdown-files.ts +51 -0
  180. package/site/tooling/lib/ofm.ts +634 -0
  181. package/site/tooling/lib/output.ts +60 -0
  182. package/site/tooling/lib/product-cache.ts +1006 -0
  183. package/site/tooling/lib/project-config.ts +288 -0
  184. package/site/tooling/lib/public-assets.ts +38 -0
  185. package/site/tooling/lib/public-links.ts +56 -0
  186. package/site/tooling/lib/publishing.ts +156 -0
  187. package/site/tooling/lib/r-runtime.ts +257 -0
  188. package/site/tooling/lib/rebuild-queue.ts +25 -0
  189. package/site/tooling/lib/rmd-preflight.ts +166 -0
  190. package/site/tooling/lib/rmd-preview-cache.ts +93 -0
  191. package/site/tooling/lib/rmd-previews.ts +129 -0
  192. package/site/tooling/lib/runtime-data-modules.ts +30 -0
  193. package/site/tooling/lib/runtime-packaging.ts +321 -0
  194. package/site/tooling/lib/search-cache.js +165 -0
  195. package/site/tooling/lib/search-inputs.js +129 -0
  196. package/site/tooling/lib/slug.ts +377 -0
  197. package/site/tooling/lib/social-images.ts +210 -0
  198. package/site/tooling/lib/text-exports.ts +51 -0
  199. package/site/tooling/lib/visit-elements.ts +17 -0
  200. package/site/tooling/live-test.ts +138 -0
  201. package/site/tooling/pipeline.ts +103 -0
  202. package/site/tooling/prepare.ts +3 -0
  203. package/site/tooling/publish.ts +28 -0
  204. package/site/tooling/r-cache.ts +45 -0
  205. package/site/tooling/r-render-profile.json +7 -0
  206. package/site/tooling/search.js +94 -0
  207. package/site/tooling/verify-deployment.ts +109 -0
  208. package/site/tooling/vite-content.ts +240 -0
  209. package/site/tooling/wrangler-paths.js +25 -0
  210. package/site/tooling/wrangler.ts +19 -0
  211. package/site/tsconfig.json +16 -0
  212. package/site/vite.config.ts +40 -0
  213. package/site/worker/access.ts +57 -0
  214. package/site/worker/analytics.ts +100 -0
  215. package/site/worker/auth-routes.ts +78 -0
  216. package/site/worker/auth.ts +78 -0
  217. package/site/worker/content-runtime.ts +226 -0
  218. package/site/worker/framing.ts +4 -0
  219. package/site/worker/gate.ts +147 -0
  220. package/site/worker/index.ts +9 -0
  221. package/site/worker/login.ts +62 -0
  222. package/site/worker/publication.ts +44 -0
  223. package/site/worker/runtime.ts +104 -0
  224. package/site/worker/tsconfig.json +13 -0
  225. package/site/wrangler.jsonc +37 -0
@@ -0,0 +1,607 @@
1
+ /* ---------------------------------------------------------------------------
2
+ Prose (markdown) styling
3
+ --------------------------------------------------------------------------- */
4
+ .prose {
5
+ line-height: 1.6;
6
+ overflow-wrap: anywhere;
7
+ --tw-prose-body: var(--color-text);
8
+ --tw-prose-headings: var(--color-text);
9
+ --tw-prose-links: var(--color-accent);
10
+ --tw-prose-bold: var(--color-text);
11
+ --tw-prose-counters: var(--color-muted);
12
+ --tw-prose-bullets: var(--color-muted);
13
+ --tw-prose-hr: var(--color-border);
14
+ --tw-prose-quotes: var(--color-text);
15
+ --tw-prose-quote-borders: var(--color-border);
16
+ --tw-prose-captions: var(--color-muted);
17
+ --tw-prose-code: var(--color-text);
18
+ --tw-prose-pre-code: var(--color-text);
19
+ --tw-prose-pre-bg: var(--color-surface);
20
+ --tw-prose-th-borders: var(--color-border);
21
+ --tw-prose-td-borders: var(--color-border);
22
+ }
23
+
24
+ /* Compact reading rhythm; controls and metadata do not inherit paragraph gaps. */
25
+ .prose :where(p, ul, ol) {
26
+ margin-block: 0.875rem;
27
+ }
28
+ .prose :where(li) {
29
+ margin-block: 0.25rem;
30
+ }
31
+ .prose :where(li > p) {
32
+ margin-block: 0.375rem;
33
+ }
34
+ .prose :where(h1) {
35
+ margin-block: 0 1rem;
36
+ line-height: 1.15;
37
+ }
38
+ .prose :where(h2) {
39
+ margin-block: 2rem 0.75rem;
40
+ }
41
+ .prose :where(h3, h4, h5, h6) {
42
+ margin-block: 1.5rem 0.5rem;
43
+ }
44
+ .prose .doc-meta {
45
+ margin: -0.375rem 0 1.25rem;
46
+ }
47
+ .prose .doc-meta p {
48
+ margin: 0;
49
+ line-height: 1.5;
50
+ }
51
+ .prose .callout-content-inner > :last-child {
52
+ margin-bottom: 0.75rem;
53
+ }
54
+ @media (width < 640px) {
55
+ .prose :where(h1) {
56
+ font-size: 2rem;
57
+ }
58
+ }
59
+
60
+ /* Match twango.dev's heading weight: semibold + tight tracking (Tailwind
61
+ Typography defaults to 700–800, which reads too heavy with Overused Grotesk). */
62
+ .prose :where(h1, h2, h3, h4, h5, h6) {
63
+ font-weight: 600;
64
+ letter-spacing: -0.025em;
65
+ }
66
+
67
+ .prose :where(h2, h3, h4) {
68
+ scroll-margin-top: 5rem;
69
+ }
70
+
71
+ .prose .heading-anchor {
72
+ position: absolute;
73
+ display: inline-flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ width: 1.1em;
77
+ height: 1.1em;
78
+ margin-left: 0.35em;
79
+ vertical-align: -0.08em;
80
+ color: var(--color-muted);
81
+ opacity: 0;
82
+ transition:
83
+ opacity 150ms ease,
84
+ color 150ms ease;
85
+ }
86
+ .prose :where(h1, h2, h3, h4, h5, h6) {
87
+ position: relative;
88
+ }
89
+ .prose :where(h1, h2, h3, h4, h5, h6):hover > .heading-anchor,
90
+ .prose .heading-anchor:focus-visible {
91
+ opacity: 1;
92
+ }
93
+ .prose .heading-anchor:hover {
94
+ color: var(--color-accent);
95
+ }
96
+ .prose .heading-anchor:focus-visible {
97
+ border-radius: 0.2em;
98
+ outline: 2px solid var(--color-accent);
99
+ outline-offset: 2px;
100
+ }
101
+ .prose .heading-anchor svg {
102
+ width: 0.8em;
103
+ height: 0.8em;
104
+ fill: none;
105
+ stroke: currentColor;
106
+ stroke-width: 2;
107
+ stroke-linecap: round;
108
+ stroke-linejoin: round;
109
+ }
110
+
111
+ @media (hover: none) {
112
+ .prose .heading-anchor {
113
+ opacity: 0.65;
114
+ }
115
+ }
116
+
117
+ .prose :where(code):not(:where(pre code)) {
118
+ font-family: var(--font-mono);
119
+ font-size: 0.875em;
120
+ padding: 0.15em 0.4em;
121
+ border-radius: 0.25rem;
122
+ background-color: var(--color-surface);
123
+ }
124
+
125
+ /* tailwind-typography wraps inline code in literal backticks; Quartz never
126
+ showed them and this corpus has thousands of inline code chips — drop them. */
127
+ .prose :where(code)::before,
128
+ .prose :where(code)::after {
129
+ content: none;
130
+ }
131
+
132
+ /* ---------------------------------------------------------------------------
133
+ Shiki code blocks + copy button
134
+ --------------------------------------------------------------------------- */
135
+ .prose .code-block {
136
+ position: relative;
137
+ }
138
+
139
+ .prose pre.shiki {
140
+ margin: 1.25rem 0;
141
+ border: 1px solid var(--color-border);
142
+ border-radius: 0.5rem;
143
+ background-color: var(--color-surface) !important;
144
+ padding: 0.9rem 1.1rem;
145
+ overflow-x: auto;
146
+ font-family: var(--font-mono);
147
+ font-size: 0.8125rem;
148
+ line-height: 1.6;
149
+ }
150
+
151
+ .prose pre.shiki code {
152
+ background: none;
153
+ }
154
+
155
+ /* Dark theme: swap Shiki's CSS variables. */
156
+ :root.dark .prose pre.shiki,
157
+ :root.dark .prose pre.shiki span {
158
+ color: var(--shiki-dark) !important;
159
+ }
160
+
161
+ .prose .copy-button {
162
+ position: absolute;
163
+ top: 0.5rem;
164
+ right: 0.5rem;
165
+ display: inline-flex;
166
+ align-items: center;
167
+ justify-content: center;
168
+ width: 1.75rem;
169
+ height: 1.75rem;
170
+ border: 1px solid var(--color-border);
171
+ border-radius: 0.375rem;
172
+ background-color: var(--color-bg);
173
+ color: var(--color-muted);
174
+ cursor: pointer;
175
+ opacity: 0;
176
+ transition:
177
+ opacity 150ms ease,
178
+ color 150ms ease;
179
+ }
180
+
181
+ .prose .code-block:hover .copy-button,
182
+ .prose .copy-button:focus-visible,
183
+ .prose .copy-button.copied {
184
+ opacity: 1;
185
+ }
186
+
187
+ .prose .copy-button:hover {
188
+ color: var(--color-text);
189
+ }
190
+
191
+ @media (hover: none) {
192
+ .prose .copy-button {
193
+ opacity: 1;
194
+ }
195
+ }
196
+
197
+ /* ---------------------------------------------------------------------------
198
+ Callouts — the Quartz fork's DOM structure (blockquote.callout >
199
+ .callout-title + .callout-content > .callout-content-inner) restyled to the
200
+ flat cca admonition aesthetic: 1px border-border, 4px left accent,
201
+ rounded-lg, surface bg. Icons + per-type palette ported from
202
+ quartz/styles/callouts.scss; collapse is the fork's grid-template-rows
203
+ animation, driven purely by the .is-collapsed class (tiny hydration in
204
+ enhancements.ts toggles it).
205
+ --------------------------------------------------------------------------- */
206
+ .prose blockquote.callout {
207
+ margin: 1.25rem 0;
208
+ border: 1px solid var(--color-border);
209
+ border-left: 4px solid var(--callout-color, var(--color-accent));
210
+ border-radius: 0.5rem;
211
+ background-color: var(--color-surface);
212
+ padding: 0 1rem;
213
+ overflow-y: hidden;
214
+ /* undo tailwind-typography blockquote styling */
215
+ font-style: normal;
216
+ font-weight: inherit;
217
+ quotes: none;
218
+ color: inherit;
219
+ }
220
+ .prose blockquote.callout p:first-of-type::before,
221
+ .prose blockquote.callout p:last-of-type::after {
222
+ content: none;
223
+ }
224
+
225
+ .prose .callout-title {
226
+ display: flex;
227
+ align-items: flex-start;
228
+ gap: 0.4rem;
229
+ padding: 0.75rem 0;
230
+ color: var(--callout-color, var(--color-accent));
231
+ --icon-size: 18px;
232
+ }
233
+ .prose .callout-title-inner {
234
+ font-weight: 600;
235
+ }
236
+ .prose .callout-title-inner > p {
237
+ margin: 0;
238
+ color: var(--callout-color, var(--color-accent));
239
+ }
240
+
241
+ .prose .callout-icon,
242
+ .prose .fold-callout-icon {
243
+ width: var(--icon-size);
244
+ height: var(--icon-size);
245
+ flex: 0 0 var(--icon-size);
246
+ background-color: var(--callout-color, var(--color-accent));
247
+ mask-image: var(--callout-icon);
248
+ mask-size: var(--icon-size) var(--icon-size);
249
+ mask-position: center;
250
+ mask-repeat: no-repeat;
251
+ margin-top: 0.2rem;
252
+ }
253
+ .prose .fold-callout-icon {
254
+ transition: transform 0.15s ease;
255
+ opacity: 0.8;
256
+ cursor: pointer;
257
+ --callout-icon: var(--callout-icon-fold);
258
+ margin-left: auto;
259
+ }
260
+ .prose blockquote.callout.is-collapsed > .callout-title > .fold-callout-icon {
261
+ transform: rotateZ(-90deg);
262
+ }
263
+ .prose blockquote.callout.is-collapsible > .callout-title {
264
+ cursor: pointer;
265
+ }
266
+
267
+ /* grid-collapse animation (fork's callout-content / callout-content-inner) */
268
+ .prose blockquote.callout > .callout-content {
269
+ display: grid;
270
+ grid-template-rows: 1fr;
271
+ transition: grid-template-rows 0.3s ease;
272
+ }
273
+ .prose blockquote.callout.is-collapsed > .callout-content {
274
+ grid-template-rows: 0fr;
275
+ }
276
+ .prose .callout-content-inner {
277
+ overflow: hidden;
278
+ }
279
+ .prose .callout-content-inner > :first-child {
280
+ margin-top: 0;
281
+ }
282
+
283
+ /* Per-type icon set + palette (ported from quartz/styles/callouts.scss). */
284
+ .prose blockquote.callout {
285
+ --callout-icon-note: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="2" x2="22" y2="6"></line><path d="M7.5 20.5 19 9l-4-4L3.5 16.5 2 22z"></path></svg>');
286
+ --callout-icon-abstract: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><path d="M12 11h4"></path><path d="M12 16h4"></path><path d="M8 11h.01"></path><path d="M8 16h.01"></path></svg>');
287
+ --callout-icon-info: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>');
288
+ --callout-icon-todo: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"></path><path d="m9 12 2 2 4-4"></path></svg>');
289
+ --callout-icon-tip: url('data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path></svg>');
290
+ --callout-icon-success: url('data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
291
+ --callout-icon-question: url('data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>');
292
+ --callout-icon-warning: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>');
293
+ --callout-icon-failure: url('data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');
294
+ --callout-icon-danger: url('data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>');
295
+ --callout-icon-bug: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="14" x="8" y="6" rx="4"></rect><path d="m19 7-3 2"></path><path d="m5 7 3 2"></path><path d="m19 19-3-2"></path><path d="m5 19 3-2"></path><path d="M20 13h-4"></path><path d="M4 13h4"></path><path d="m10 4 1 2"></path><path d="m14 4-1 2"></path></svg>');
296
+ --callout-icon-example: url('data:image/svg+xml; utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>');
297
+ --callout-icon-quote: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"></path><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"></path></svg>');
298
+ --callout-icon-fold: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
299
+
300
+ --callout-color: #448aff;
301
+ --callout-icon: var(--callout-icon-note);
302
+ }
303
+ .prose blockquote.callout[data-callout='abstract'] {
304
+ --callout-color: #00b0ff;
305
+ --callout-icon: var(--callout-icon-abstract);
306
+ }
307
+ .prose blockquote.callout[data-callout='info'] {
308
+ --callout-color: #00b8d4;
309
+ --callout-icon: var(--callout-icon-info);
310
+ }
311
+ .prose blockquote.callout[data-callout='todo'] {
312
+ --callout-color: #00b8d4;
313
+ --callout-icon: var(--callout-icon-todo);
314
+ }
315
+ .prose blockquote.callout[data-callout='tip'] {
316
+ --callout-color: #00bfa5;
317
+ --callout-icon: var(--callout-icon-tip);
318
+ }
319
+ .prose blockquote.callout[data-callout='success'] {
320
+ --callout-color: #09ad7a;
321
+ --callout-icon: var(--callout-icon-success);
322
+ }
323
+ .prose blockquote.callout[data-callout='question'] {
324
+ --callout-color: #dba642;
325
+ --callout-icon: var(--callout-icon-question);
326
+ }
327
+ .prose blockquote.callout[data-callout='warning'] {
328
+ --callout-color: #db8942;
329
+ --callout-icon: var(--callout-icon-warning);
330
+ }
331
+ .prose blockquote.callout[data-callout='failure'],
332
+ .prose blockquote.callout[data-callout='danger'],
333
+ .prose blockquote.callout[data-callout='bug'] {
334
+ --callout-color: #db4242;
335
+ --callout-icon: var(--callout-icon-failure);
336
+ }
337
+ .prose blockquote.callout[data-callout='bug'] {
338
+ --callout-icon: var(--callout-icon-bug);
339
+ }
340
+ .prose blockquote.callout[data-callout='danger'] {
341
+ --callout-icon: var(--callout-icon-danger);
342
+ }
343
+ .prose blockquote.callout[data-callout='example'] {
344
+ --callout-color: #7a43b5;
345
+ --callout-icon: var(--callout-icon-example);
346
+ }
347
+ .prose blockquote.callout[data-callout='quote'] {
348
+ --callout-color: var(--color-muted);
349
+ --callout-icon: var(--callout-icon-quote);
350
+ }
351
+
352
+ /* ---------------------------------------------------------------------------
353
+ Transclusions (![[note]] -> blockquote.transclude, inlined at build time)
354
+ --------------------------------------------------------------------------- */
355
+ .prose blockquote.transclude {
356
+ font-style: normal;
357
+ font-weight: inherit;
358
+ quotes: none;
359
+ }
360
+ .prose blockquote.transclude p:first-of-type::before,
361
+ .prose blockquote.transclude p:last-of-type::after {
362
+ content: none;
363
+ }
364
+ .prose a.transclude-src {
365
+ display: block;
366
+ margin-top: 0.5rem;
367
+ font-size: 0.8125rem;
368
+ color: var(--color-muted);
369
+ }
370
+ .prose a.transclude-src:hover {
371
+ color: var(--color-accent);
372
+ }
373
+
374
+ /* ---------------------------------------------------------------------------
375
+ Internal, external, and tag links
376
+ --------------------------------------------------------------------------- */
377
+ .prose a.internal.broken {
378
+ opacity: 0.5;
379
+ transition: opacity 0.2s ease;
380
+ }
381
+ .prose a.internal.broken:hover {
382
+ opacity: 0.8;
383
+ }
384
+ .prose a.tag-link::before {
385
+ content: '#';
386
+ }
387
+ .prose a.external .external-icon {
388
+ display: inline-block;
389
+ height: 0.8em;
390
+ width: 0.8em;
391
+ margin: 0 0.15em;
392
+ }
393
+ .prose a.external .external-icon > path {
394
+ fill: currentColor;
395
+ }
396
+
397
+ /* ---------------------------------------------------------------------------
398
+ OFM odds and ends: ==highlights==, embeds, KaTeX, checkboxes, mermaid
399
+ --------------------------------------------------------------------------- */
400
+ .prose .text-highlight {
401
+ background-color: color-mix(in srgb, var(--color-accent) 25%, transparent);
402
+ padding: 0 0.1rem;
403
+ border-radius: 0.25rem;
404
+ }
405
+
406
+ .prose iframe.pdf,
407
+ .prose iframe.external-embed.youtube {
408
+ aspect-ratio: 16 / 9;
409
+ width: 100%;
410
+ height: 100%;
411
+ border: 1px solid var(--color-border);
412
+ border-radius: 0.5rem;
413
+ background-color: var(--color-surface);
414
+ }
415
+
416
+ .prose .katex-display {
417
+ overflow-x: auto;
418
+ overflow-y: hidden;
419
+ padding: 0.25rem 0;
420
+ }
421
+
422
+ .prose input[type='checkbox'] {
423
+ accent-color: var(--color-accent);
424
+ cursor: pointer;
425
+ }
426
+ .prose input[type='checkbox'][disabled] {
427
+ cursor: default;
428
+ }
429
+ .prose li:has(> input[type='checkbox']:first-child) {
430
+ list-style: none;
431
+ }
432
+ .prose li > input[type='checkbox']:first-child {
433
+ margin-right: 0.4em;
434
+ margin-left: -1.4em;
435
+ }
436
+
437
+ /* Mermaid fences: styled raw-source fallback until the Islands phase hydrates
438
+ them into rendered diagrams. */
439
+ .prose pre:has(> code.mermaid) {
440
+ margin: 1.25rem 0;
441
+ border: 1px dashed var(--color-border);
442
+ border-radius: 0.5rem;
443
+ background-color: var(--color-surface);
444
+ padding: 0.9rem 1.1rem;
445
+ overflow-x: auto;
446
+ font-family: var(--font-mono);
447
+ font-size: 0.8125rem;
448
+ line-height: 1.6;
449
+ }
450
+ .prose pre > code.mermaid {
451
+ background: none;
452
+ }
453
+
454
+ /* Hydrated mermaid island (embeds/mermaid.ts): rendered SVG container that
455
+ replaces the raw-source <pre> once the diagram draws; the <pre> dims while
456
+ the lazy import is in flight and stays visible on render failure. */
457
+ .prose pre:has(> code.mermaid)[data-state='loading'] {
458
+ opacity: 0.6;
459
+ }
460
+ .prose .mermaid-diagram {
461
+ margin: 1.25rem 0;
462
+ position: relative;
463
+ overflow-x: auto;
464
+ }
465
+ .prose .mermaid-inline-content {
466
+ display: flex;
467
+ justify-content: center;
468
+ min-width: max-content;
469
+ }
470
+ .prose .mermaid-inline-content > svg {
471
+ max-width: 100%;
472
+ height: auto;
473
+ }
474
+ .prose .mermaid-inline-content > .mermaid-error {
475
+ margin: 0;
476
+ width: 100%;
477
+ border: 1px solid var(--color-border);
478
+ border-radius: 0.5rem;
479
+ padding: 0.5rem 0.75rem;
480
+ font-size: 0.8125rem;
481
+ color: var(--color-muted);
482
+ }
483
+
484
+ .mermaid-toolbar {
485
+ position: sticky;
486
+ right: 0.5rem;
487
+ bottom: 0.5rem;
488
+ display: flex;
489
+ float: right;
490
+ gap: 0.35rem;
491
+ width: max-content;
492
+ margin-top: -2.35rem;
493
+ opacity: 0;
494
+ transition: opacity 150ms ease;
495
+ }
496
+ .mermaid-diagram:hover .mermaid-toolbar,
497
+ .mermaid-toolbar:focus-within {
498
+ opacity: 1;
499
+ }
500
+ .mermaid-control-button {
501
+ display: inline-flex;
502
+ align-items: center;
503
+ justify-content: center;
504
+ min-width: 2rem;
505
+ height: 2rem;
506
+ padding: 0 0.5rem;
507
+ border: 1px solid var(--color-border);
508
+ border-radius: 0.375rem;
509
+ background: var(--color-bg);
510
+ color: var(--color-muted);
511
+ font: 500 0.75rem/1 var(--font-sans);
512
+ cursor: pointer;
513
+ box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
514
+ }
515
+ .mermaid-control-button:hover,
516
+ .mermaid-control-button:focus-visible,
517
+ .mermaid-control-button.copied {
518
+ color: var(--color-text);
519
+ border-color: var(--color-accent);
520
+ outline: none;
521
+ }
522
+ .mermaid-control-button:focus-visible {
523
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 35%, transparent);
524
+ }
525
+ .mermaid-control-button:disabled {
526
+ opacity: 0.45;
527
+ cursor: not-allowed;
528
+ }
529
+ .mermaid-control-button svg {
530
+ width: 0.9rem;
531
+ height: 0.9rem;
532
+ fill: none;
533
+ stroke: currentColor;
534
+ stroke-width: 2;
535
+ stroke-linecap: round;
536
+ stroke-linejoin: round;
537
+ }
538
+
539
+ body.mermaid-modal-open {
540
+ overflow: hidden;
541
+ }
542
+ .mermaid-modal {
543
+ position: fixed;
544
+ inset: 0;
545
+ z-index: 80;
546
+ display: grid;
547
+ place-items: center;
548
+ padding: 3vh 3vw;
549
+ background: rgb(0 0 0 / 60%);
550
+ backdrop-filter: blur(4px);
551
+ }
552
+ .mermaid-modal-panel {
553
+ display: grid;
554
+ grid-template-rows: auto minmax(0, 1fr);
555
+ width: min(90vw, 90rem);
556
+ height: 88vh;
557
+ overflow: hidden;
558
+ border: 1px solid var(--color-border);
559
+ border-radius: 0.75rem;
560
+ background: var(--color-bg);
561
+ box-shadow: 0 24px 64px rgb(0 0 0 / 35%);
562
+ }
563
+ .mermaid-modal-controls {
564
+ display: flex;
565
+ justify-content: flex-end;
566
+ gap: 0.4rem;
567
+ padding: 0.65rem;
568
+ border-bottom: 1px solid var(--color-border);
569
+ }
570
+ .mermaid-modal-viewport {
571
+ display: grid;
572
+ place-items: center;
573
+ min-height: 0;
574
+ overflow: hidden;
575
+ cursor: grab;
576
+ touch-action: none;
577
+ user-select: none;
578
+ }
579
+ .mermaid-modal-viewport.is-dragging {
580
+ cursor: grabbing;
581
+ }
582
+ .mermaid-modal-content {
583
+ transform-origin: center;
584
+ will-change: transform;
585
+ }
586
+ .mermaid-modal-content > svg {
587
+ display: block;
588
+ max-width: 82vw;
589
+ max-height: 76vh;
590
+ height: auto;
591
+ }
592
+
593
+ @media (hover: none) {
594
+ .mermaid-toolbar {
595
+ opacity: 1;
596
+ }
597
+ }
598
+
599
+ @media (max-width: 640px) {
600
+ .mermaid-modal {
601
+ padding: 2vw;
602
+ }
603
+ .mermaid-modal-panel {
604
+ width: 96vw;
605
+ height: 92vh;
606
+ }
607
+ }