datalog-theme 0.6.1 → 0.8.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +175 -0
- data/CITATION.cff +2 -2
- data/README.md +26 -19
- data/_data/cdn-integrity.yml +0 -30
- data/_includes/analytics/dashboard.html +3 -1
- data/_includes/components/api-function.html +20 -1
- data/_includes/components/author-bio.html +2 -2
- data/_includes/components/enhanced-code-block.html +1 -1
- data/_includes/components/hero.html +19 -1
- data/_includes/csp-meta.html +115 -11
- data/_includes/footer.html +19 -20
- data/_includes/head.html +61 -29
- data/_includes/header/navigation.html +12 -15
- data/_includes/header.html +29 -20
- data/_includes/layouts/default/article.html +5 -1
- data/_includes/meta/math-config.html +27 -1
- data/_includes/meta/schema.html +5 -2
- data/_includes/meta/scripts-loader.html +16 -31
- data/_includes/post/related-posts.html +4 -7
- data/_includes/scripts.html +1 -9
- data/_includes/search/index-data.json +131 -0
- data/_includes/search/page.html +136 -0
- data/_layouts/dataset.html +1 -0
- data/_layouts/default.html +16 -8
- data/_layouts/home.html +6 -0
- data/_layouts/notebook.html +1 -0
- data/_layouts/package.html +1 -0
- data/_layouts/portfolio.html +1 -0
- data/_layouts/post.html +20 -5
- data/_layouts/project.html +2 -1
- data/_plugins/analytics_dashboard.rb +9 -3
- data/_plugins/config_validator.rb +12 -7
- data/_plugins/csp_generator.rb +18 -28
- data/_plugins/datalog_bibliography.rb +9 -7
- data/_plugins/datalog_comments.rb +8 -5
- data/_plugins/datalog_slides.rb +9 -8
- data/_plugins/i18n.rb +7 -8
- data/_plugins/image_optimizer.rb +17 -6
- data/_plugins/math_preprocessor.rb +36 -3
- data/_plugins/notebook_converter.rb +23 -43
- data/_plugins/plugin_loader.rb +3 -1
- data/_plugins/publications_generator.rb +8 -2
- data/_plugins/rouge_highlight_filter.rb +42 -0
- data/_plugins/search_code_blocks.rb +30 -0
- data/_plugins/search_normalizer.rb +15 -53
- data/_plugins/search_pages.rb +72 -0
- data/_sass/_academic-dashboard.scss +262 -0
- data/_sass/_base.scss +19 -1
- data/_sass/_components.scss +77 -1144
- data/_sass/_features.scss +17 -0
- data/_sass/_font-fallbacks.scss +43 -0
- data/_sass/_header.scss +10 -0
- data/_sass/_layout.scss +18 -12
- data/_sass/_mathematical.scss +1 -1
- data/_sass/_notebooks.scss +322 -0
- data/_sass/_open-science-badges.scss +56 -0
- data/_sass/{_phase1-enhancements.scss → _post-components.scss} +46 -1
- data/_sass/_search-page.scss +530 -0
- data/_sass/_search.scss +47 -1
- data/_sass/_syntax-highlighting.scss +212 -97
- data/_sass/_theme.scss +42 -18
- data/_sass/_typography.scss +14 -0
- data/_sass/_variables.scss +7 -4
- data/assets/css/main.scss +14 -0
- data/assets/img/hero-detail-640.webp +0 -0
- data/assets/img/hero-detail.webp +0 -0
- data/assets/img/social-card.png +0 -0
- data/assets/js/dist/academic.js +1 -0
- data/assets/js/dist/analytics-dashboard.js +1 -0
- data/assets/js/dist/chunks/chunk-225H5YXE.js +1 -0
- data/assets/js/dist/core.js +1 -0
- data/assets/js/dist/loader.js +1 -0
- data/assets/js/dist/math.js +1 -0
- data/assets/js/dist/notebook.js +1 -0
- data/assets/js/dist/search.js +1 -0
- data/assets/js/dist/visualizations.js +11 -0
- data/assets/js/loader.js +3 -1
- data/datalog-theme.gemspec +43 -22
- data/lib/datalog/cli.rb +53 -15
- data/lib/datalog/plugin_system/dependency_resolver.rb +0 -2
- data/lib/datalog/theme/package.rb +57 -0
- data/lib/datalog/theme/repository_checkout.rb +90 -0
- data/lib/datalog/theme/version.rb +1 -1
- data/lib/datalog/warning_filter.rb +5 -11
- data/lib/datalog-theme.rb +21 -0
- metadata +75 -146
- data/_data/academic.yml +0 -217
- data/_data/config/author.yml +0 -121
- data/_data/config/features.yml +0 -262
- data/_data/config/site.yml +0 -42
- data/_data/config/theme.yml +0 -181
- data/_data/datasets.yml +0 -28
- data/_data/js_meta.json +0 -371
- data/_data/navigation.yml +0 -145
- data/_data/projects.yml +0 -41
- data/_data/publications.yml +0 -28
- data/_data/social.yml +0 -73
- data/_data/visualizations.yml +0 -51
- data/_includes/components/advanced-search.html +0 -682
- data/_includes/components/bookmark-system.html +0 -96
- data/_includes/components/comments.html +0 -244
- data/_includes/components/content-recommendations.html +0 -228
- data/_includes/components/email-preferences.html +0 -200
- data/_includes/components/enhanced-metadata.html +0 -228
- data/_includes/components/language-switcher.html +0 -396
- data/_includes/components/navigation-enhancements.html +0 -454
- data/_includes/components/newsletter-signup.html +0 -178
- data/_includes/components/popular-posts.html +0 -233
- data/_includes/components/reading-progress.html +0 -133
- data/_includes/components/reading-time.html +0 -121
- data/_includes/components/series-navigation.html +0 -124
- data/_includes/components/social-proof.html +0 -34
- data/_includes/components/user-preferences.html +0 -566
- data/_layouts/archive.html +0 -282
- data/_layouts/post-sidebar.html +0 -183
- data/_sass/_phase3-enhancements.scss +0 -874
- data/_sass/_phase4-enhancements.scss +0 -1214
- data/_sass/_phase5-enhancements.scss +0 -414
- data/assets/img/20220607123041_detail.001.png +0 -0
- data/assets/js/academic.js +0 -262
- data/assets/js/analytics-dashboard.js +0 -382
- data/assets/js/core/dark-mode.js +0 -79
- data/assets/js/core/github-cards.js +0 -123
- data/assets/js/core/language-filter.js +0 -69
- data/assets/js/core/navigation.js +0 -184
- data/assets/js/core/scroll-progress.js +0 -45
- data/assets/js/core/search-hotkeys.js +0 -62
- data/assets/js/core/skip-links.js +0 -62
- data/assets/js/main.js +0 -23
- data/assets/js/math.js +0 -818
- data/assets/js/notebook.js +0 -158
- data/assets/js/search/analytics.js +0 -91
- data/assets/js/search/app.js +0 -271
- data/assets/js/search/autocomplete.js +0 -120
- data/assets/js/search/engine.js +0 -260
- data/assets/js/search/filters.js +0 -38
- data/assets/js/search/render.js +0 -217
- data/assets/js/search/utils.js +0 -99
- data/assets/js/search.js +0 -354
- data/assets/js/visualizations.js +0 -816
- data/assets/publications/datalog-publications.bib +0 -8
- data/assets/publications/datalog-publications.ris +0 -9
- data/assets/publications/publications.bib +0 -30
- data/assets/templates/diogo-ribeiro-cv.md +0 -31
- data/assets/templates/diogo-ribeiro-cv.tex +0 -32
- data/lib/datalog/theme/theme.rb +0 -18
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
@use 'variables' as *;
|
|
4
4
|
|
|
5
|
-
//
|
|
5
|
+
// Syntax highlighting for Rouge, which highlights code as the site builds:
|
|
6
|
+
// kramdown's fenced code blocks, and the includes that use the rouge_highlight
|
|
7
|
+
// filter. Rouge marks tokens with short Pygments class names, such as k for a
|
|
8
|
+
// keyword, s2 for a double-quoted string and nf for a function name.
|
|
6
9
|
pre[class*='language-'],
|
|
7
|
-
code[class*='language-']
|
|
10
|
+
code[class*='language-'],
|
|
11
|
+
pre.highlight,
|
|
12
|
+
pre.highlight code {
|
|
8
13
|
color: $color-ink-900;
|
|
9
14
|
background: transparent;
|
|
10
15
|
font-family: $font-family-mono;
|
|
@@ -12,117 +17,227 @@ code[class*='language-'] {
|
|
|
12
17
|
line-height: 1.6;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
|
-
pre[class*='language-']
|
|
20
|
+
pre[class*='language-'],
|
|
21
|
+
pre.highlight {
|
|
16
22
|
position: relative;
|
|
17
23
|
padding-top: map.get($spacing, 5);
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
:not(pre) > code[class*='language-'],
|
|
21
|
-
pre[class*='language-']
|
|
27
|
+
pre[class*='language-'],
|
|
28
|
+
pre.highlight {
|
|
22
29
|
background: rgba($color-surface-900, 0.02);
|
|
23
30
|
}
|
|
24
31
|
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
.highlight {
|
|
33
|
+
.c,
|
|
34
|
+
.ch,
|
|
35
|
+
.cd,
|
|
36
|
+
.cm,
|
|
37
|
+
.cpf,
|
|
38
|
+
.c1,
|
|
39
|
+
.cs {
|
|
40
|
+
color: $color-ink-500;
|
|
41
|
+
font-style: italic;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.p {
|
|
45
|
+
color: $color-ink-500;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.nt,
|
|
49
|
+
.no,
|
|
50
|
+
.ss,
|
|
51
|
+
.gd {
|
|
52
|
+
color: $color-accent-tertiary;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.m,
|
|
56
|
+
.mb,
|
|
57
|
+
.mf,
|
|
58
|
+
.mh,
|
|
59
|
+
.mi,
|
|
60
|
+
.il,
|
|
61
|
+
.mo,
|
|
62
|
+
.mx,
|
|
63
|
+
.kc {
|
|
64
|
+
color: $color-accent-secondary-text;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.s,
|
|
68
|
+
.sa,
|
|
69
|
+
.sb,
|
|
70
|
+
.sc,
|
|
71
|
+
.dl,
|
|
72
|
+
.sd,
|
|
73
|
+
.s2,
|
|
74
|
+
.se,
|
|
75
|
+
.sh,
|
|
76
|
+
.si,
|
|
77
|
+
.sx,
|
|
78
|
+
.s1,
|
|
79
|
+
.na,
|
|
80
|
+
.nb,
|
|
81
|
+
.bp,
|
|
82
|
+
.gi {
|
|
83
|
+
color: $color-success;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.o,
|
|
87
|
+
.ni,
|
|
88
|
+
.nv,
|
|
89
|
+
.vc,
|
|
90
|
+
.vg,
|
|
91
|
+
.vi,
|
|
92
|
+
.vm {
|
|
93
|
+
color: $color-accent-primary;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.k,
|
|
97
|
+
.kd,
|
|
98
|
+
.kn,
|
|
99
|
+
.kp,
|
|
100
|
+
.kr,
|
|
101
|
+
.kt,
|
|
102
|
+
.kv,
|
|
103
|
+
.ow,
|
|
104
|
+
.cp {
|
|
105
|
+
color: $color-accent-secondary-text;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.nf,
|
|
109
|
+
.fm,
|
|
110
|
+
.nc,
|
|
111
|
+
.nd,
|
|
112
|
+
.ne {
|
|
113
|
+
color: $color-accent-primary;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.sr,
|
|
118
|
+
.gr,
|
|
119
|
+
.gt {
|
|
120
|
+
color: $color-warning;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.gh,
|
|
124
|
+
.gu,
|
|
125
|
+
.gs {
|
|
126
|
+
font-weight: 700;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ge {
|
|
130
|
+
font-style: italic;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// With line numbers on, Rouge lays a block out as a table: the numbers in the
|
|
135
|
+
// first cell, the code in the second, each in its own <pre>. The site's table,
|
|
136
|
+
// cell and <pre> styles would give it borders, padding and nested boxes.
|
|
137
|
+
.highlight .rouge-table {
|
|
138
|
+
width: auto;
|
|
139
|
+
margin: 0;
|
|
140
|
+
border: 0;
|
|
141
|
+
border-collapse: collapse;
|
|
142
|
+
font-size: inherit;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.highlight .rouge-table td {
|
|
146
|
+
padding: 0;
|
|
147
|
+
border: 0;
|
|
148
|
+
vertical-align: top;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.highlight .rouge-table pre {
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: 0;
|
|
154
|
+
border: 0;
|
|
155
|
+
border-radius: 0;
|
|
156
|
+
background: none;
|
|
157
|
+
box-shadow: none;
|
|
158
|
+
overflow: visible;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.highlight .rouge-gutter {
|
|
162
|
+
padding-right: map.get($spacing, 4);
|
|
34
163
|
color: $color-ink-500;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.token.property,
|
|
38
|
-
.token.tag,
|
|
39
|
-
.token.constant,
|
|
40
|
-
.token.symbol,
|
|
41
|
-
.token.deleted {
|
|
42
|
-
color: $color-accent-tertiary;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.token.boolean,
|
|
46
|
-
.token.number {
|
|
47
|
-
color: $color-accent-secondary;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.token.selector,
|
|
51
|
-
.token.attr-name,
|
|
52
|
-
.token.string,
|
|
53
|
-
.token.char,
|
|
54
|
-
.token.builtin,
|
|
55
|
-
.token.inserted {
|
|
56
|
-
color: $color-success;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.token.operator,
|
|
60
|
-
.token.entity,
|
|
61
|
-
.token.url,
|
|
62
|
-
.token.variable {
|
|
63
|
-
color: $color-accent-primary;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.token.atrule,
|
|
67
|
-
.token.attr-value,
|
|
68
|
-
.token.keyword {
|
|
69
|
-
color: $color-accent-secondary;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.token.function,
|
|
73
|
-
.token.class-name {
|
|
74
|
-
color: $color-accent-primary;
|
|
75
|
-
font-weight: 600;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.token.regex,
|
|
79
|
-
.token.important {
|
|
80
|
-
color: $color-warning;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.token.important,
|
|
84
|
-
.token.bold {
|
|
85
|
-
font-weight: 700;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.token.italic {
|
|
89
|
-
font-style: italic;
|
|
164
|
+
text-align: right;
|
|
165
|
+
user-select: none;
|
|
90
166
|
}
|
|
91
167
|
|
|
92
168
|
body.dark-mode pre[class*='language-'],
|
|
93
|
-
body.dark-mode code[class*='language-']
|
|
169
|
+
body.dark-mode code[class*='language-'],
|
|
170
|
+
body.dark-mode pre.highlight,
|
|
171
|
+
body.dark-mode pre.highlight code {
|
|
94
172
|
color: $dark-ink-900;
|
|
95
173
|
}
|
|
96
174
|
|
|
97
|
-
body.dark-mode pre[class*='language-']
|
|
175
|
+
body.dark-mode pre[class*='language-'],
|
|
176
|
+
body.dark-mode pre.highlight {
|
|
98
177
|
background: rgba($dark-surface-300, 0.8);
|
|
99
178
|
}
|
|
100
179
|
|
|
101
|
-
body.dark-mode .
|
|
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
|
-
|
|
180
|
+
body.dark-mode .highlight {
|
|
181
|
+
.c,
|
|
182
|
+
.ch,
|
|
183
|
+
.cd,
|
|
184
|
+
.cm,
|
|
185
|
+
.cpf,
|
|
186
|
+
.c1,
|
|
187
|
+
.cs,
|
|
188
|
+
.rouge-gutter {
|
|
189
|
+
color: $dark-ink-500;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.m,
|
|
193
|
+
.mb,
|
|
194
|
+
.mf,
|
|
195
|
+
.mh,
|
|
196
|
+
.mi,
|
|
197
|
+
.il,
|
|
198
|
+
.mo,
|
|
199
|
+
.mx,
|
|
200
|
+
.kc {
|
|
201
|
+
color: $dark-accent-secondary;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.s,
|
|
205
|
+
.sa,
|
|
206
|
+
.sb,
|
|
207
|
+
.sc,
|
|
208
|
+
.dl,
|
|
209
|
+
.sd,
|
|
210
|
+
.s2,
|
|
211
|
+
.se,
|
|
212
|
+
.sh,
|
|
213
|
+
.si,
|
|
214
|
+
.sx,
|
|
215
|
+
.s1,
|
|
216
|
+
.na,
|
|
217
|
+
.nb,
|
|
218
|
+
.bp,
|
|
219
|
+
.gi {
|
|
220
|
+
color: #5fe3aa;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.k,
|
|
224
|
+
.kd,
|
|
225
|
+
.kn,
|
|
226
|
+
.kp,
|
|
227
|
+
.kr,
|
|
228
|
+
.kt,
|
|
229
|
+
.kv,
|
|
230
|
+
.ow,
|
|
231
|
+
.cp,
|
|
232
|
+
.o {
|
|
233
|
+
color: $dark-accent-primary;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.nf,
|
|
237
|
+
.fm,
|
|
238
|
+
.nc,
|
|
239
|
+
.nd,
|
|
240
|
+
.ne {
|
|
241
|
+
color: #9fb6ff;
|
|
242
|
+
}
|
|
128
243
|
}
|
data/_sass/_theme.scss
CHANGED
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
// Primary manifest for the DataLog theme.
|
|
2
2
|
// Provides CSS custom properties and composes the Sass partials.
|
|
3
3
|
@use "sass:color";
|
|
4
|
+
@use "sass:meta";
|
|
4
5
|
// 1) Modules FIRST (no CSS before these)
|
|
5
6
|
@use 'variables' as *; // gives access to Sass tokens here
|
|
6
7
|
@use 'mixins' as *;
|
|
8
|
+
@use 'features';
|
|
7
9
|
|
|
8
10
|
// Each partial below MUST import its own tokens if it references them.
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
@use
|
|
12
|
-
|
|
13
|
-
@
|
|
14
|
-
@
|
|
15
|
-
@
|
|
16
|
-
@
|
|
17
|
-
@
|
|
18
|
-
@
|
|
19
|
-
@
|
|
20
|
-
@
|
|
21
|
-
@
|
|
22
|
-
@
|
|
23
|
-
@
|
|
24
|
-
|
|
25
|
-
@
|
|
11
|
+
// Loading it here does NOT leak variables into that file's scope.
|
|
12
|
+
// meta.load-css emits a partial's CSS at the point it is included, in this
|
|
13
|
+
// order, and unlike @use it may sit inside @if: the partials for optional
|
|
14
|
+
// features load only when their flag in _features.scss is on.
|
|
15
|
+
@include meta.load-css('font-fallbacks');
|
|
16
|
+
@include meta.load-css('base');
|
|
17
|
+
@include meta.load-css('typography');
|
|
18
|
+
@include meta.load-css('layout');
|
|
19
|
+
@include meta.load-css('header');
|
|
20
|
+
@include meta.load-css('components');
|
|
21
|
+
@include meta.load-css('utilities');
|
|
22
|
+
@include meta.load-css('syntax-highlighting');
|
|
23
|
+
@include meta.load-css('mathematical');
|
|
24
|
+
@if features.$visualizations {
|
|
25
|
+
@include meta.load-css('interactive');
|
|
26
|
+
}
|
|
27
|
+
@if features.$search {
|
|
28
|
+
@include meta.load-css('search');
|
|
29
|
+
}
|
|
30
|
+
@if features.$visualizations {
|
|
31
|
+
@include meta.load-css('visualizations');
|
|
32
|
+
}
|
|
33
|
+
@include meta.load-css('post-components');
|
|
34
|
+
@if features.$packages {
|
|
35
|
+
@include meta.load-css('package-docs');
|
|
36
|
+
}
|
|
26
37
|
|
|
27
|
-
// 2) CSS rules AFTER
|
|
38
|
+
// 2) CSS rules AFTER the partials
|
|
28
39
|
:root {
|
|
29
40
|
// Surface/background colors
|
|
30
41
|
--color-surface: #{$color-surface-50};
|
|
@@ -46,6 +57,14 @@
|
|
|
46
57
|
|
|
47
58
|
// Border colors
|
|
48
59
|
--color-border: #{$color-neutral-200};
|
|
60
|
+
// Aliases used by components written against a different token
|
|
61
|
+
// vocabulary. Without them every var() fell back to a light literal,
|
|
62
|
+
// which dark mode could not override.
|
|
63
|
+
--surface-card: #ffffff;
|
|
64
|
+
--surface-elevated: #{$color-surface-100};
|
|
65
|
+
--muted-foreground: #{$color-ink-500};
|
|
66
|
+
--accent: #{$color-accent-primary};
|
|
67
|
+
--accent-foreground: #ffffff;
|
|
49
68
|
|
|
50
69
|
// Typography
|
|
51
70
|
--max-width-reading: #{$max-width-reading};
|
|
@@ -76,4 +95,9 @@ body.dark-mode {
|
|
|
76
95
|
|
|
77
96
|
// Border colors
|
|
78
97
|
--color-border: #{$dark-surface-300};
|
|
98
|
+
--surface-card: #{$dark-surface-300};
|
|
99
|
+
--surface-elevated: #{$dark-surface-200};
|
|
100
|
+
--muted-foreground: #{$dark-ink-500};
|
|
101
|
+
--accent: #{$dark-accent-primary};
|
|
102
|
+
--accent-foreground: #{$dark-surface-100};
|
|
79
103
|
}
|
data/_sass/_typography.scss
CHANGED
|
@@ -146,3 +146,17 @@ pre code {
|
|
|
146
146
|
text-transform: uppercase;
|
|
147
147
|
letter-spacing: 0.08em;
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
// Keyboard keys, such as the shortcut hints on the search page.
|
|
151
|
+
kbd {
|
|
152
|
+
display: inline-block;
|
|
153
|
+
padding: 0.25rem 0.5rem;
|
|
154
|
+
background: var(--color-background-secondary, #f7fafc);
|
|
155
|
+
border: 1px solid var(--color-border, #cbd5e0);
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
font-family: var(--font-mono, monospace);
|
|
158
|
+
font-size: 0.8125rem;
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
color: var(--color-text-primary, #1a202c);
|
|
161
|
+
box-shadow: 0 2px 0 var(--color-border, #cbd5e0);
|
|
162
|
+
}
|
data/_sass/_variables.scss
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
// Font families
|
|
5
5
|
// IBM Plex — designed for technical and data-driven content
|
|
6
|
-
$font-family-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
|
7
|
-
$font-family-serif: 'IBM Plex Serif', Georgia, serif;
|
|
8
|
-
$font-family-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
6
|
+
$font-family-sans: 'IBM Plex Sans', 'IBM Plex Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
|
7
|
+
$font-family-serif: 'IBM Plex Serif', 'IBM Plex Serif Fallback', 'IBM Plex Serif Fallback Times', Georgia, serif;
|
|
8
|
+
$font-family-mono: 'IBM Plex Mono', 'IBM Plex Mono Fallback', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
9
9
|
$font-stack-code: $font-family-mono !default;
|
|
10
10
|
$font-stack-sans: $font-family-sans !default;
|
|
11
11
|
$font-stack-serif: $font-family-serif !default;
|
|
@@ -41,7 +41,10 @@ $color-ink-400: #a1a1aa !default;
|
|
|
41
41
|
$color-ink-600: #57534e !default;
|
|
42
42
|
$color-ink-800: #292524 !default;
|
|
43
43
|
$color-accent-primary: #2563eb; // vivid blue — links, primary actions
|
|
44
|
-
$color-accent-secondary: #0d9488; // teal —
|
|
44
|
+
$color-accent-secondary: #0d9488; // teal — fills, borders and other non-text accents
|
|
45
|
+
// #0d9488 reaches only 3.1:1 to 3.7:1 against white and against its own
|
|
46
|
+
// tinted backgrounds, so it fails WCAG AA wherever it is used as text.
|
|
47
|
+
$color-accent-secondary-text: #115e59; // teal — the same accent as readable text
|
|
45
48
|
$color-accent-tertiary: #7c3aed; // purple — charts, visual accents
|
|
46
49
|
$color-success: #16a34a;
|
|
47
50
|
$color-warning: #d97706;
|
data/assets/css/main.scss
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
# Only front matter so Jekyll processes this file
|
|
3
3
|
---
|
|
4
|
+
{%- comment -%}
|
|
5
|
+
Configures _sass/_features.scss before the theme loads it, so the stylesheet
|
|
6
|
+
carries the styles of an optional feature only when this site uses it. A site
|
|
7
|
+
that copies this file to add its own rules keeps these lines.
|
|
8
|
+
{%- endcomment -%}
|
|
9
|
+
{%- assign notebook_pages = site.pages | where: "layout", "notebook" -%}
|
|
10
|
+
@use "features" with (
|
|
11
|
+
$search: {% if site.features.search %}true{% else %}false{% endif %},
|
|
12
|
+
$visualizations: {% if site.features.visualizations %}true{% else %}false{% endif %},
|
|
13
|
+
$notebooks: {% if notebook_pages.size > 0 %}true{% else %}false{% endif %},
|
|
14
|
+
$packages: {% if site.packages.size > 0 %}true{% else %}false{% endif %},
|
|
15
|
+
$academic-dashboard: {% if site.features.academic_dashboard %}true{% else %}false{% endif %},
|
|
16
|
+
$open-science-badges: {% if site.data.academic.badges.size > 0 %}true{% else %}false{% endif %}
|
|
17
|
+
);
|
|
4
18
|
@use "theme";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/chunk-225H5YXE.js";function d(){let a=window.DatalogAcademic||{},c=window.DatalogPublications||{},t=c.metrics||(a.citations?a.citations.metrics:{})||{},o=c.yearly_totals||(a.citations?a.citations.yearly_totals:{})||{};document.querySelectorAll("[data-citation-metric]").forEach(e=>{let n=e.getAttribute("data-citation-metric");if(!n)return;let i;switch(n){case"total":i=t.total;break;case"h_index":case"h-index":i=t.h_index;break;case"i10_index":case"i10-index":i=t.i10_index;break;case"since_total":i=t.since_2019?t.since_2019.total:void 0;break;case"since_h_index":i=t.since_2019?t.since_2019.h_index:void 0;break;case"since_i10":i=t.since_2019?t.since_2019.i10_index:void 0;break;default:if(n.startsWith("year_")){let s=n.replace("year_","");i=o[s]}break}typeof i=="number"?e.textContent=i.toLocaleString():i&&(e.textContent=i)})}function u(){let a=window.DatalogAcademic||{},t=(window.DatalogPublications||{}).citation_totals||(a.citations?a.citations.per_publication:{})||{};document.querySelectorAll("[data-publication-citations]").forEach(o=>{let e=o.getAttribute("data-publication-citations");if(!e)return;let n=e.toLowerCase(),i;t[e]?i=t[e].total||t[e]:t[n]&&(i=t[n].total||t[n]),typeof i=="number"&&(o.textContent=i.toLocaleString())})}function f(){let a=window.DatalogAcademic||{},t=(window.DatalogPublications||{}).yearly_totals||(a.citations?a.citations.yearly_totals:{})||{},o=document.querySelector("[data-citation-timeline]");o&&t&&o.querySelectorAll("li[data-year]").forEach(n=>{let i=n.getAttribute("data-year");if(!i)return;let s=n.querySelector("[data-year-total]"),r=t[i];s&&typeof r!="undefined"&&(s.textContent=Number(r).toLocaleString(),n.style.setProperty("--timeline-value",Math.min(Number(r)/5,100)))})}function y(){let a=document.querySelector("[data-submission-filter]");if(a){let c=document.querySelectorAll(".submission-card"),t=()=>{let o=a.value;c.forEach(e=>{if(!o){e.hidden=!1;return}let n=e.getAttribute("data-submission-status");e.hidden=n!==o})};a.addEventListener("change",t),t()}}function p(){let a=document.querySelector("[data-calendar-filter]"),c=document.querySelector("[data-academic-calendar]");if(a&&c){let t=c.querySelectorAll("li[data-event-type]"),o=()=>{let e=a.value;t.forEach(n=>{if(!e){n.hidden=!1;return}let i=n.getAttribute("data-event-type");n.hidden=i!==e})};a.addEventListener("change",o),o()}}function b(){document.querySelectorAll(".open-science-badge").forEach(c=>{let t=c.querySelector(".open-science-badge__description"),o=c.querySelector(".open-science-badge__criteria"),e=[];t&&e.push(t.textContent.trim()),o&&e.push(o.textContent.trim()),e.length&&c.setAttribute("title",e.join(" \u2022 "))})}function l(){d(),u(),f(),y(),p(),b()}typeof window!="undefined"&&document.readyState!=="loading"?l():typeof window!="undefined"&&document.addEventListener("DOMContentLoaded",l);export{l as initAcademicFeatures,p as initCalendarFilter,b as initOpenScienceBadges,y as initSubmissionFilter,d as populateCitationMetrics,f as populateCitationTimeline,u as populatePublicationCitations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/chunk-225H5YXE.js";function m(){return window.__DATALOG_ANALYTICS__||{}}function E(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()}function f(e){return!e||!Array.isArray(e.rows)?[]:e.rows}function d(e,a){return new Intl.NumberFormat(void 0,a||{maximumFractionDigits:0}).format(e||0)}function h(e,a,n){var r;if(!e)return;let c=n||((r=e.closest("table"))==null?void 0:r.querySelectorAll("th").length)||1,i=document.createElement("tr");i.className="placeholder";let s=document.createElement("td");s.setAttribute("colspan",c),s.textContent=a,i.appendChild(s),e.replaceChildren(i)}function v(){let e=document.getElementById("analytics-top-posts"),a=f(m().top_posts);if(e){if(!a.length){h(e,e.dataset.emptyMessage||"No data available",3);return}e.replaceChildren(),a.forEach(n=>{var b,y,C;let c=n.dimensionValues||[],i=n.metricValues||[],s=((b=c[0])==null?void 0:b.value)||"",r=Number(((y=i[0])==null?void 0:y.value)||0),t=Number(((C=i[1])==null?void 0:C.value)||0),o=document.createElement("tr"),l=document.createElement("a");l.href=s.startsWith("/")?s:`/${s}`,l.textContent=s||"\u2014",l.rel="noopener",l.className="analytics-link";let u=document.createElement("td");u.appendChild(l);let p=document.createElement("td");p.textContent=d(r);let g=document.createElement("td");g.textContent=d(t,{maximumFractionDigits:0}),o.append(u,p,g),e.appendChild(o)})}}function w(){let e=document.getElementById("analytics-search-terms");if(!e)return;let a=f(m().search_terms);if(!a.length){h(e,e.dataset.emptyMessage||"No search queries recorded",2);return}e.replaceChildren(),a.forEach(n=>{var u,p;let c=n.dimensionValues||[],i=n.metricValues||[],s=((u=c[0])==null?void 0:u.value)||"(not provided)",r=Number(((p=i[0])==null?void 0:p.value)||0),t=document.createElement("tr"),o=document.createElement("td");o.textContent=s;let l=document.createElement("td");l.textContent=d(r),t.append(o,l),e.appendChild(t)})}function N(e){return!e||e.includes("-")?e:e.length===8?`${e.slice(0,4)}-${e.slice(4,6)}-${e.slice(6,8)}`:e}function _(){let e=document.getElementById("analytics-visitors-chart");if(!e||typeof Chart=="undefined")return;let a=f(m().visitor_trends);if(!a.length)return;let n=a.map(t=>{var o,l;return N((l=(o=t.dimensionValues)==null?void 0:o[0])==null?void 0:l.value)}),c=a.map(t=>{var o,l;return Number(((l=(o=t.metricValues)==null?void 0:o[0])==null?void 0:l.value)||0)}),i=a.map(t=>{var o,l;return Number(((l=(o=t.metricValues)==null?void 0:o[1])==null?void 0:l.value)||0)}),s=a.map(t=>{var o,l;return Number(((l=(o=t.metricValues)==null?void 0:o[2])==null?void 0:l.value)||0)}),r=a.map(t=>{var o,l;return Number(((l=(o=t.metricValues)==null?void 0:o[3])==null?void 0:l.value)||0)});new Chart(e,{type:"line",data:{labels:n,datasets:[{label:"Total users",data:c,borderColor:"#2563eb",backgroundColor:"rgba(37, 99, 235, 0.15)",tension:.35,fill:!0},{label:"New users",data:i,borderColor:"#10b981",backgroundColor:"rgba(16, 185, 129, 0.12)",tension:.35,fill:!1},{label:"Sessions",data:s,borderColor:"#9333ea",backgroundColor:"rgba(147, 51, 234, 0.1)",tension:.35,fill:!1},{label:"Page views",data:r,borderColor:"#f97316",backgroundColor:"rgba(249, 115, 22, 0.1)",borderDash:[6,6],tension:.35,fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},scales:{y:{beginAtZero:!0,ticks:{callback:t=>d(t)}}},plugins:{legend:{position:"top"}}}})}function A(){let e=document.getElementById("analytics-engagement-chart");if(!e||typeof Chart=="undefined")return;let a=f(m().engagement_by_page).slice(0,10);if(!a.length)return;let n=a.map(s=>{var r,t;return((t=(r=s.dimensionValues)==null?void 0:r[0])==null?void 0:t.value)||"\u2014"}),c=a.map(s=>{var r,t;return Number(((t=(r=s.metricValues)==null?void 0:r[2])==null?void 0:t.value)||0)}),i=a.map(s=>{var r,t;return Number(((t=(r=s.metricValues)==null?void 0:r[0])==null?void 0:t.value)||0)});new Chart(e,{type:"bar",data:{labels:n,datasets:[{label:"Engaged sessions",data:c,backgroundColor:"rgba(59, 130, 246, 0.7)"},{label:"Page views",data:i,backgroundColor:"rgba(14, 165, 233, 0.5)"}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:"y",scales:{x:{beginAtZero:!0,ticks:{callback:s=>d(s)}}},plugins:{legend:{position:"top"}}}})}function k(){let e=document.getElementById("analytics-key-events");if(!e)return;let a=f(m().key_events);if(!a.length){let n=document.createElement("li");n.className="placeholder",n.textContent="No tracked events in the selected window.",e.replaceChildren(n);return}e.replaceChildren(),a.forEach(n=>{var t,o,l,u;let c=((o=(t=n.dimensionValues)==null?void 0:t[0])==null?void 0:o.value)||"event",i=Number(((u=(l=n.metricValues)==null?void 0:l[0])==null?void 0:u.value)||0),s=document.createElement("li"),r=document.createElement("strong");r.textContent=d(i),s.appendChild(r),s.appendChild(document.createTextNode(` ${c.replace(/_/g," ")}`)),e.appendChild(s)})}function x(){let e=m().scholar||{},a=document.querySelector('[data-field="scholar-total"]'),n=document.querySelector('[data-field="scholar-h-index"]'),c=document.querySelector('[data-field="scholar-i10-index"]');a&&(a.textContent=e.total?d(Number(e.total)):"\u2014"),n&&(n.textContent=e.h_index?d(Number(e.h_index)):"\u2014"),c&&(c.textContent=e.i10_index?d(Number(e.i10_index)):"\u2014");let i=document.getElementById("analytics-scholar-chart");if(!i||typeof Chart=="undefined")return;let s=e.yearly_totals||{},r=Object.entries(s).map(([t,o])=>[Number(t),Number(o)]).sort((t,o)=>t[0]-o[0]);r.length&&new Chart(i,{type:"bar",data:{labels:r.map(t=>t[0]),datasets:[{label:"Citations",data:r.map(t=>t[1]),backgroundColor:"rgba(99, 102, 241, 0.8)"}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,ticks:{callback:t=>d(t)}}}}})}function V(){let e=document.getElementById("analytics-monthly-reports");if(!e)return;let a=Array.isArray(m().monthly_reports)?m().monthly_reports:[];if(!a.length){h(e,e.dataset.emptyMessage||"No monthly reports available",5);return}e.replaceChildren(),a.forEach(n=>{let c=document.createElement("tr"),i=document.createElement("td");i.textContent=n.month||"\u2014";let s=document.createElement("td");s.textContent=d(n.total_users||0);let r=document.createElement("td");r.textContent=d(n.new_users||0);let t=document.createElement("td");t.textContent=d(n.sessions||0);let o=document.createElement("td");o.textContent=d(n.page_views||0),c.append(i,s,r,t,o),e.appendChild(c)})}function I(){if(m().status!=="ok"){["analytics-top-posts","analytics-search-terms","analytics-monthly-reports"].forEach(n=>{let c=document.getElementById(n);c&&h(c,m().message||"Analytics data unavailable.")});let a=document.getElementById("analytics-key-events");if(a){let n=document.createElement("li");n.className="placeholder",n.textContent=m().message||"Analytics data unavailable.",a.replaceChildren(n)}x();return}v(),w(),_(),A(),k(),x(),V()}typeof window!="undefined"&&!window.__VITEST__&&E(I);export{h as ensurePlaceholder,N as formatDateLabel,d as formatNumber,E as onReady,f as parseRows,I as render,A as renderEngagementChart,k as renderKeyEvents,V as renderMonthlyReports,x as renderScholar,w as renderSearchTerms,v as renderTopPosts,_ as renderVisitorChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var d=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var e=(c,a,b)=>a in c?f(c,a,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[a]=b,i=(c,a)=>{for(var b in a||(a={}))g.call(a,b)&&e(c,b,a[b]);if(d)for(var b of d(a))h.call(a,b)&&e(c,b,a[b]);return c};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunks/chunk-225H5YXE.js";var _="[data-copy-citation], [data-copy-bibliography]";var p=!1;function G(t){let e=t.getAttribute("data-target"),n=e?document.getElementById(e):null;return n?"value"in n?n.value:n.textContent||"":""}async function O(t){let e=G(t);if(!(!e||!navigator.clipboard||!navigator.clipboard.writeText)){t.dataset.originalText===void 0&&(t.dataset.originalText=t.textContent);try{await navigator.clipboard.writeText(e),t.dataset.copied="true",t.textContent="Copied!",setTimeout(()=>{t.dataset.copied="false",t.textContent=t.dataset.originalText},2e3)}catch(n){t.dataset.copied="error",t.textContent="Error"}}}function g(){p||(p=!0,document.addEventListener("click",t=>{let e=t.target instanceof Element?t.target.closest(_):null;e&&O(e)}))}var y="datalog-color-mode",l="dark-mode";function b(){try{return localStorage.getItem(y)}catch(t){return null}}function $(t){try{localStorage.setItem(y,t)}catch(e){}}function q(t){let e=b();return e==="dark"?!0:e==="light"?!1:t.matches}function E(){let t=document.querySelector("[data-toggle-dark-mode]"),e=document.body,n=window.matchMedia("(prefers-color-scheme: dark)");q(n)&&e.classList.add(l);let r=()=>{let a=e.classList.contains(l)?"dark":"light";e.dataset.theme=a,document.documentElement.dataset.theme=a},o=()=>{r(),t&&t.setAttribute("aria-pressed",e.classList.contains(l))};o(),t&&t.addEventListener("click",()=>{let a=e.classList.toggle(l);t.setAttribute("aria-pressed",String(a)),$(a?"dark":"light"),r()}),n.addEventListener("change",a=>{b()||(a.matches?e.classList.add(l):e.classList.remove(l),o())})}var H="datalog-github-";var S=Symbol("recently-failed");function f(t,e){return`${H}${t}-${e}`}function K(t,e,n){try{let r=localStorage.getItem(f(t,e));if(!r)return null;let o=JSON.parse(r);if(!o||typeof o!="object")return null;let a=o.failed?6e5:n;return Date.now()-o.timestamp>a?(localStorage.removeItem(f(t,e)),null):o.failed?S:o.data}catch(r){return null}}function L(t,e,n){try{localStorage.setItem(f(t,e),JSON.stringify(h({timestamp:Date.now()},n)))}catch(r){}}async function M(t,e,n,r){let o=K(t,e,r);if(o===S)return null;if(o)return o;try{let a=await fetch(`${n}/${t}/${e}`);if(!a.ok)throw new Error(`GitHub API error: ${a.status}`);let s=await a.json();return L(t,e,{data:s}),s}catch(a){return L(t,e,{failed:!0}),null}}function B(t,e){t.querySelectorAll("[data-github-stat]").forEach(r=>{let o=r.getAttribute("data-github-stat");if(!o)return;let a=e[o];typeof a=="number"?r.textContent=a.toLocaleString():typeof a=="string"&&a.length>0&&(r.textContent=a)})}function F(t){t.dataset.githubState="error";let e=t.getAttribute("data-github-unavailable");e&&t.querySelectorAll("[data-github-stat]").forEach(n=>{n.textContent=e})}function v(){let t=document.querySelectorAll("[data-github-owner][data-github-repo]");if(!t.length)return Promise.resolve();let n=(window.DatalogIntegrations||{}).github||{};if(n.enabled===!1)return Promise.resolve();let r=n.api_base||"https://api.github.com/repos",o=Number(n.cache_ttl||43200)*1e3,a=Array.from(t).map(s=>{let u=s.getAttribute("data-github-owner"),d=s.getAttribute("data-github-repo");return!u||!d?Promise.resolve():(s.dataset.githubState="loading",M(u,d,r,o).then(i=>{if(!i){F(s);return}B(s,i),s.dataset.githubState="ready"}))});return Promise.all(a)}var z="[data-language-filter], [data-navigate-on-change]";function U(t){if(typeof t!="string")return null;let e=Array.from(t).filter(r=>{let o=r.codePointAt(0);return o>31&&o!==127}).join("").trim();if(!e)return null;let n=/^[a-z][a-z0-9+.-]*:/i.exec(e);return n&&!/^https?:$/i.test(n[0])?null:e}function A(){let t=document.querySelectorAll(z);t.length!==0&&t.forEach(e=>{e.addEventListener("change",n=>{let r=U(n.target&&n.target.value);r&&(window.location.href=r)})})}var V="(min-width: 48rem)",T="#site-nav",k=".nav-toggle",m="nav-open";function w(t){return t.replace(/index\.html$/,"").replace(/\/$/,"")}function j(t){let e=t.getAttribute("href");if(!e)return null;try{let n=new URL(e,window.location.origin);if(!n.hash)return null;let r=new URL(window.location.href);return w(n.pathname)!==w(r.pathname)?null:n.hash.replace("#","")}catch(n){return null}}function Y(t){if(!t)return!1;let e=document.getElementById(t);return e?(e.scrollIntoView({behavior:"smooth",block:"start"}),!0):!1}function x(){let t=document.querySelector(T);if(!t)return;let e=document.querySelector(k),n=document.body,r=window.matchMedia(V),o=i=>{if(i){t.dataset.open="true",n.classList.remove(m),e&&(e.setAttribute("aria-expanded","false"),e.classList.remove("is-active"));return}let c=t.dataset.open==="true";c||(t.dataset.open="false"),e&&(e.setAttribute("aria-expanded",String(c)),e.classList.toggle("is-active",c))},a=({focusToggle:i=!1}={})=>{r.matches||(t.dataset.open="false",n.classList.remove(m),e&&(e.setAttribute("aria-expanded","false"),e.classList.remove("is-active"),i&&e.focus()))},s=()=>{r.matches||(t.dataset.open="true",n.classList.add(m),e&&(e.setAttribute("aria-expanded","true"),e.classList.add("is-active")))},u=()=>{r.matches||(t.dataset.open==="true"?a():s())};r.matches||(t.dataset.open="false"),o(r.matches),r.addEventListener("change",i=>{i.matches?o(!0):(a(),t.dataset.open="false",o(!1))}),t.querySelectorAll(".nav-link").forEach(i=>{let c=j(i);i.addEventListener("click",R=>{r.matches||a(),c&&Y(c)&&R.preventDefault()})}),e&&e.addEventListener("click",()=>{u()}),document.addEventListener("keydown",i=>{i.key==="Escape"&&t.dataset.open==="true"&&a({focusToggle:!0})}),document.addEventListener("click",i=>{if(r.matches||t.dataset.open!=="true")return;let c=i.target;!c||typeof c.closest!="function"||c.closest(T)||e&&c.closest(k)||a()})}function J(t,e){let n=window.pageYOffset||document.documentElement.scrollTop,r=document.documentElement.scrollHeight-window.innerHeight,o=r>0?Math.min(n/r*100,100):0;t.tagName==="PROGRESS"?t.setAttribute("value",String(o)):t.style.setProperty("--progress",`${o}%`),e&&(e.textContent=Math.round(o))}function C(){let t=document.querySelector("[data-scroll-progress]");if(!t)return;let e=document.querySelector("[data-scroll-progress-value]"),n=()=>J(t,e);n(),window.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n)}function I(t){if(!t)return;let e=t.querySelector("input[type='search']"),n=t.getAttribute("action");e?(e.focus(),e.select()):n&&(window.location.href=n)}function X(t){if(!t)return!1;if(t.isContentEditable)return!0;let e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"}function N(){let t=document.querySelector(".site-search");t&&document.addEventListener("keydown",e=>{X(document.activeElement)||(e.key==="/"&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),I(t)),(e.key==="k"||e.key==="K")&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),I(t)))})}function Q(t){if(!t)return;t.getAttribute("tabindex")===null&&(t.setAttribute("tabindex","-1"),t.dataset.skipLinkTempTabindex="true"),t.addEventListener("blur",()=>{t.dataset.skipLinkTempTabindex&&(t.removeAttribute("tabindex"),delete t.dataset.skipLinkTempTabindex)},{once:!0}),t.focus()}function P(){let t=document.querySelectorAll(".skip-link[href^='#']");t.length&&t.forEach(e=>{e.addEventListener("click",n=>{let o=(e.getAttribute("href")||"").slice(1);if(!o)return;let a=document.getElementById(o);a&&(n.preventDefault(),Q(a))})})}var Z=[P,x,E,A,C,N,v,g];function D(t=Z){t.forEach(e=>{try{e()}catch(n){}})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>D()):D();export{D as initializeCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/chunk-225H5YXE.js";function y(){let e=document.getElementById("datalog-js-manifest");if(!e||!e.textContent)return{};try{return JSON.parse(e.textContent)}catch(n){return{}}}function l(e){return`feature${e.replace(/(^|-)([a-z])/g,(n,o,s)=>s.toUpperCase())}`}function r(e,n){let o=document.body;if(!o)return;let s=`${l(e)}State`;o.dataset[s]=n}async function u(e){return import(e)}var p=[{name:"search",test:()=>document.querySelector("[data-search-app]")},{name:"visualizations",test:()=>document.querySelector("[data-viz-type]")},{name:"math",test:()=>{var e;return((e=document.body)==null?void 0:e.dataset.featureMath)==="true"}},{name:"academic",test:()=>document.querySelector("[data-citation-metric], [data-citation-table], [data-citation-chart]")},{name:"notebook",test:()=>{var e;return((e=document.body)==null?void 0:e.dataset.featureNotebook)==="true"||document.querySelector(".notebook-output")}}];async function i(e){let n=e||y(),{core:o,features:s={}}=n;if(!o)return;try{r("core","loading"),await u(o),r("core","ready")}catch(t){r("core","error");return}let d=document.body;if(!d)return;let f=p.filter(t=>{let c=l(t.name),a=d.dataset[c];return a==="true"||a==="auto"?a==="auto"&&typeof t.test=="function"?!!t.test():!0:!1}).map(async({name:t,test:c})=>{let a=s[t];if(a){r(t,"loading");try{if(typeof c=="function"&&!c()){r(t,"skipped");return}await u(a),r(t,"ready")}catch(m){r(t,"error")}}});await Promise.all(f)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i();export{i as bootstrapFeatures};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){let u={init(e){this.MathJax=e,this.displayCounter=0,this.anchorCounter=0,this.equationMap=new Map,this.editor=null,this.editorOpen=!1,this.messageTimeout=null,this.initialized=!0,this.pendingTypeset=[],this.setupEditor(),e.startup.promise.then(()=>{if(this.decorateExisting(e.startup.document.math||[]),this.updateEquationReferences(),this.pendingTypeset.length>0){let t=[...this.pendingTypeset];this.pendingTypeset=[],t.forEach(a=>{this.renderLatex(a.target,a.latex,a.options||{})})}}).catch(t=>{}),document.addEventListener("click",t=>this.handleClick(t)),document.addEventListener("keydown",t=>this.handleKeydown(t))},onPageReady(){this.updateEquationReferences()},decorateExisting(e){!e||e.length===0||(this.displayCounter=0,this.anchorCounter=0,this.equationMap.clear(),e.forEach(t=>{try{this.decorateMathItem(t)}catch(a){}}))},decorateMathItem(e){if(!e||!e.typesetRoot)return;let t=e.typesetRoot,a=e.math||"",i=t.closest("[data-math-alt]")||t,n=this.resolveAltText(i,a);t.dataset.mathLatex=a,t.setAttribute("tabindex","0"),t.setAttribute("role","math"),this.syncAltAttributes(i,t,n),e.display?this.decorateDisplay(t,a):this.decorateInline(t,a)},decorateInline(e,t){e&&(e.classList.contains("math-expression__inline")||e.classList.add("math-expression__inline"),e.dataset.mathLatexClean=this.cleanLatex(t))},decorateDisplay(e,t){if(!e)return;let i=e.parentElement&&e.parentElement.classList.contains("math-expression")?e.parentElement:null;i||(i=document.createElement("figure"),i.className="math-expression math-expression--display",e.parentNode.insertBefore(i,e),i.appendChild(e));let n=this.extractEquationInfo(t);this.anchorCounter+=1;let r=`eq:auto-${this.anchorCounter}`,s=n.tag||"";n.skipNumber||(this.displayCounter+=1,s||(s=String(this.displayCounter)));let o=s?`(${s})`:"",l=this.buildAnchorId(n.label,r);if(i.dataset.mathLatex=t,i.dataset.mathLatexClean=this.cleanLatex(t),e.dataset.mathAlt&&!i.dataset.mathAlt&&(i.dataset.mathAlt=e.dataset.mathAlt),o?i.dataset.equationNumber=o:i.removeAttribute("data-equation-number"),i.dataset.equationLabel=n.label||"",l){i.id=l;let c=o||n.label||l;if((o||n.label)&&(this.setEquationReference(l,c),n.label&&n.label!==l&&this.setEquationReference(n.label,c,l),n.label&&n.label.startsWith("eq:"))){let h=n.label.replace(/^eq:/,"");this.setEquationReference(h,c,l)}}this.attachNumberBadge(i,o),this.attachToolbar(i)},extractEquationInfo(e){let t=(e||"").trim(),a=t.match(/\\tag\*?\{([^}]*)\}/),i=t.match(/\\label\{([^}]*)\}/),n=/\\notag|\\nonumber/.test(t);return{tag:a?a[1].trim():"",label:i?i[1].trim():"",skipNumber:n}},buildAnchorId(e,t){return e?e.startsWith("eq:")?e:`eq:${e}`:t||""},setEquationReference(e,t,a){if(!e)return;let i=a||e,n=t||e;this.equationMap.set(e,{anchor:i,label:e,number:n}),e.startsWith("eq:")||this.equationMap.set(`eq:${e}`,{anchor:i,label:e,number:n})},attachNumberBadge(e,t){let a=e.querySelector(".math-expression__number"),i=e.querySelector(".math-expression__sr");if(!t){a&&a.remove(),i&&i.remove();return}a||(a=document.createElement("span"),a.className="math-expression__number",a.setAttribute("aria-hidden","true"),e.appendChild(a)),a.textContent=t,i||(i=document.createElement("span"),i.className="visually-hidden math-expression__sr",e.appendChild(i)),i.textContent=`Equation ${t.replace(/[()]/g,"")}`},attachToolbar(e){let t=e.querySelector(".math-expression__toolbar");if(!t){t=document.createElement("div"),t.className="math-expression__toolbar";let a=document.createElement("button");a.type="button",a.className="math-expression__button",a.setAttribute("data-math-copy","true"),a.setAttribute("aria-label","Copy LaTeX code");let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.textContent="\u29C9";let n=document.createElement("span");n.className="visually-hidden",n.textContent="Copy equation",a.appendChild(i),a.appendChild(n);let r=document.createElement("button");r.type="button",r.className="math-expression__button",r.setAttribute("data-math-edit","true"),r.setAttribute("aria-label","Open equation editor");let s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.textContent="\u270E";let o=document.createElement("span");o.className="visually-hidden",o.textContent="Edit equation",r.appendChild(s),r.appendChild(o);let l=document.createElement("span");l.className="math-expression__message",l.setAttribute("aria-live","polite"),l.hidden=!0,t.appendChild(a),t.appendChild(r),t.appendChild(l),e.appendChild(t)}},handleClick(e){let t=e.target.closest("[data-math-copy]");if(t){e.preventDefault();let s=t.closest(".math-expression"),o=s?s.dataset.mathLatexClean||s.dataset.mathLatex:null;this.copyLatex(o,s);return}let a=e.target.closest("[data-math-edit]");if(a){e.preventDefault();let s=a.closest(".math-expression"),o=s&&s.dataset.mathLatex||"";this.openEditor(o);return}if(e.target.closest("[data-math-editor-close]")){e.preventDefault(),this.closeEditor();return}if(e.target.closest("[data-math-editor-copy]")){e.preventDefault(),this.editor&&this.editor.textarea&&this.copyLatex(this.editor.textarea.value,null,this.editor.status);return}let r=e.target.closest("[data-symbol-insert]");if(r){e.preventDefault();let s=r.getAttribute("data-symbol-insert");this.insertSymbol(s||"")}},handleKeydown(e){let t=document.activeElement,a=t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable);if((e.ctrlKey||e.metaKey)&&e.altKey&&(e.key==="e"||e.key==="E")){e.preventDefault();let i=a&&t&&t.value||"";this.openEditor(i);return}e.key==="Escape"&&this.editorOpen&&(e.preventDefault(),this.closeEditor())},copyLatex(e,t,a){if(!e)return;let i=r=>{if(a)a.hidden=!1,a.textContent=r,clearTimeout(this.messageTimeout),this.messageTimeout=window.setTimeout(()=>{a.hidden=!0,a.textContent=""},2e3);else if(t){let s=t.querySelector(".math-expression__message");s&&(s.hidden=!1,s.textContent=r,clearTimeout(this.messageTimeout),this.messageTimeout=window.setTimeout(()=>{s.hidden=!0,s.textContent=""},2e3))}},n=()=>{let r=document.createElement("textarea");r.value=e,r.setAttribute("aria-hidden","true"),r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();try{document.execCommand("copy"),i("Copied equation")}catch(s){i("Unable to copy")}document.body.removeChild(r)};navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(()=>i("Copied equation")).catch(()=>n()):n()},setupEditor(){if(this.editor)return;let e=document.createElement("div");e.id="math-tooling-panel",e.hidden=!0;let t=document.createElement("div");t.className="math-tooling",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-labelledby","math-tooling-title");let a=document.createElement("h2");a.id="math-tooling-title",a.className="math-tooling__title",a.textContent="Equation editor";let i=document.createElement("p");i.className="math-tooling__description",i.innerHTML="Craft LaTeX expressions with live preview, quick statistical symbols, and chemistry support.";let n=document.createElement("textarea");n.className="math-tooling__input",n.setAttribute("data-math-editor-input","true"),n.setAttribute("spellcheck","false"),n.rows=10;let r=document.createElement("div");r.className="math-tooling__actions";let s=document.createElement("div");s.className="math-tooling__preview",s.setAttribute("data-math-editor-preview","true"),s.setAttribute("aria-live","polite");let o=document.createElement("span");o.className="math-tooling__status",o.hidden=!0;let l=document.createElement("div");l.className="math-tooling__library";let c=document.createElement("h3");c.className="math-tooling__library-title",c.textContent="Quick insert";let h=document.createElement("div");h.className="math-tooling__symbols",[{label:"Mean \u03BC",value:"\\mu"},{label:"Variance \u03C3\xB2",value:"\\sigma^2"},{label:"Std. dev \u03C3",value:"\\sigma"},{label:"Probability",value:"\\mathbb{P}(A)"},{label:"Expectation",value:"\\mathbb{E}[X]"},{label:"Covariance",value:"\\mathrm{Cov}(X, Y)"},{label:"Vector",value:"\\mathbf{x}"},{label:"Norm",value:"\\lVert x \\rVert_2"},{label:"Inner product",value:"\\langle x, y \\rangle"},{label:"Derivative",value:"\\frac{\\mathrm{d}}{\\mathrm{d}t}"},{label:"Integral",value:"\\int_0^1 f(x) \\, \\mathrm{d}x"},{label:"Bayes",value:"\\mathbb{P}(A \\mid B)"},{label:"Chemical H\u2082O",value:"\\ce{H2O}"},{label:"Chemical CO\u2082",value:"\\ce{CO2}"}].forEach(g=>{let p=document.createElement("button");p.type="button",p.className="math-tooling__symbol",p.setAttribute("data-symbol-insert",g.value),p.textContent=g.label,h.appendChild(p)});let d=document.createElement("button");d.type="button",d.className="math-tooling__close",d.setAttribute("data-math-editor-close","true");let b=document.createElement("span");b.setAttribute("aria-hidden","true"),b.textContent="\u2715";let f=document.createElement("span");f.className="visually-hidden",f.textContent="Close equation editor",d.appendChild(b),d.appendChild(f);let m=document.createElement("button");m.type="button",m.className="math-tooling__copy",m.setAttribute("data-math-editor-copy","true"),m.textContent="Copy LaTeX",r.appendChild(m),r.appendChild(d),r.appendChild(o),l.appendChild(c),l.appendChild(h),t.appendChild(a),t.appendChild(i),t.appendChild(n),t.appendChild(s),t.appendChild(r),t.appendChild(l),e.appendChild(t),document.body.appendChild(e),n.addEventListener("input",()=>this.updateEditorPreview()),this.editor={overlay:e,dialog:t,textarea:n,preview:s,status:o}},openEditor(e){if(!this.editor)return;let t=(e||"").trim();this.editor.overlay.hidden=!1,document.body.classList.add("math-tooling-open"),this.editor.textarea.value=t,this.editor.textarea.focus(),this.editor.textarea.setSelectionRange(t.length,t.length),this.editorOpen=!0,this.updateEditorPreview()},closeEditor(){this.editor&&(this.editor.overlay.hidden=!0,document.body.classList.remove("math-tooling-open"),this.editorOpen=!1)},updateEditorPreview(){if(!this.editor||!this.MathJax)return;let e=this.editor.textarea.value.trim();if(!e){this.editor.preview.replaceChildren();let t=document.createElement("p");t.className="math-tooling__placeholder",t.textContent="Preview will appear here.",this.editor.preview.appendChild(t);return}this.renderLatex(this.editor.preview,e,{display:!0,enhance:!1})},insertSymbol(e){if(!this.editor||!this.editor.textarea)return;let t=this.editor.textarea,a=t.selectionStart||0,i=t.selectionEnd||0,n=t.value,r=`${n.slice(0,a)}${e}${n.slice(i)}`;t.value=r;let s=a+e.length;t.focus(),t.setSelectionRange(s,s),this.updateEditorPreview()},updateEquationReferences(){if(!this.equationMap||this.equationMap.size===0)return;document.querySelectorAll("[data-equation-ref]").forEach(a=>{let i=a.getAttribute("data-equation-ref");if(!i)return;let n=this.lookupEquation(i.replace(/^#/,""));if(!n)return;a.setAttribute("href",`#${n.anchor}`);let r=a.textContent.trim();(!r||r===i||r===n.anchor||r===`(${i})`)&&(a.textContent=n.number||n.anchor),a.classList.add("math-reference"),a.setAttribute("aria-label",`Jump to equation ${n.number||n.anchor}`)}),document.querySelectorAll('a[href^="#eq:"]').forEach(a=>{let i=a.getAttribute("href");if(!i)return;let n=i.replace(/^#/,""),r=this.lookupEquation(n);if(!r)return;a.setAttribute("href",`#${r.anchor}`);let s=a.textContent.trim();(!s||s===i||s===n)&&(a.textContent=r.number||r.anchor),a.dataset.equationRef=r.anchor,a.classList.add("math-reference")})},lookupEquation(e){if(!e)return null;if(this.equationMap.has(e))return this.equationMap.get(e);let t=e.startsWith("eq:")?e:`eq:${e}`;return this.equationMap.get(t)||null},renderLatex(e,t,a={}){if(!e)return Promise.resolve();let i=a.display!==!1;if(!this.MathJax)return e.textContent=t,this.pendingTypeset||(this.pendingTypeset=[]),this.pendingTypeset.push({target:e,latex:t,options:a}),Promise.resolve();let n=i?`\\[${t}\\]`:`\\(${t}\\)`;return e.innerHTML=n,this.MathJax.typesetPromise([e]).catch(r=>{})},cleanLatex(e){return(e||"").replace(/%\s*alt:.*$/gm,"").replace(/\\label\{[^}]*\}/g,"").replace(/\\tag\*?\{[^}]*\}/g,"").trim()},resolveAltText(e,t){let a=e||null,i=this.findDatasetAlt(a);if(i)return i;let n=this.extractAltComment(t);if(n)return n;let s=(a&&a.getAttribute?a.getAttribute("data-math-source"):null)||t;return this.generateAltFromLatex(s)},findDatasetAlt(e){let t=e;for(;t;){if(t.dataset&&t.dataset.mathAlt){let a=t.dataset.mathAlt.trim();if(a)return a}t=t.parentElement}return""},extractAltComment(e){if(!e)return"";let t=String(e).split(/\r?\n/);for(let a=0;a<t.length;a+=1){let i=t[a];if(!i)continue;let n=i.match(/%\s*alt:\s*(.+)$/i);if(n)return n[1].trim()}return""},generateAltFromLatex(e){if(!e)return"";let t=String(e).replace(/%.*$/gm,"");return t=t.replace(/\\frac\s*\{([^{}]+)\}\s*\{([^{}]+)\}/g,(a,i,n)=>{let r=this.sanitizeSegment(i),s=this.sanitizeSegment(n);return`${r} over ${s}`.trim()}),t=t.replace(/\\int(?:_\{([^}]*)\}|_([^\s^{}]+))?(?:\^\{([^}]*)\}|\^([^\s_{}]+))?/g,(a,i,n,r,s)=>{let o=this.sanitizeSegment(i||n),l=this.sanitizeSegment(r||s),c="integral";return o&&(c+=` from ${o}`),l&&(c+=` to ${l}`),c}),t=t.replace(/\\sum(?:_\{([^}]*)\}|_([^\s^{}]+))?(?:\^\{([^}]*)\}|\^([^\s_{}]+))?/g,(a,i,n,r,s)=>{let o=this.sanitizeSegment(i||n),l=this.sanitizeSegment(r||s),c="summation";return o&&(c+=` from ${o}`),l&&(c+=` to ${l}`),c}),t=t.replace(/\\sqrt\s*\{([^{}]+)\}/g,(a,i)=>`square root of ${this.sanitizeSegment(i)}`),t=t.replace(/\\mathrm\s*\{([^{}]+)\}/g,(a,i)=>this.sanitizeSegment(i)),t=t.replace(/\\operatorname\*?\s*\{([^{}]+)\}/g,(a,i)=>this.sanitizeSegment(i)),t=t.replace(/\\[a-zA-Z]+/g," "),t=t.replace(/[{}]/g," "),t=t.replace(/\s+/g," ").trim(),t||"Mathematical expression"},sanitizeSegment(e){return e?String(e).replace(/\\[a-zA-Z]+/g," ").replace(/[{}]/g," ").replace(/\s+/g," ").trim():""},syncAltAttributes(e,t,a){a&&(e&&e.setAttribute&&(e.setAttribute("aria-label",a),e.dataset&&(e.dataset.mathAlt=a)),t&&t.setAttribute&&(t.setAttribute("aria-label",a),t.dataset&&(t.dataset.mathAlt=a)))}};typeof globalThis!="undefined"&&(globalThis.__DATALOG_MATH_INTERNALS__=u),window.DatalogMath={init(e){u.init(e)},onPageReady(){u.initialized&&u.onPageReady()},renderLatex(e,t,a){return u.renderLatex(e,t,a)}}})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/chunk-225H5YXE.js";var a=t=>new Promise((r,o)=>{if(document.querySelector(`script[src="${t}"]`)){r();return}let e=document.createElement("script");e.src=t,e.async=!0,e.onload=()=>r(),e.onerror=n=>o(n),document.head.appendChild(e)}),i=()=>{let t=document.querySelectorAll(".notebook-output-plotly");return t.length?(typeof window.Plotly!="undefined"?Promise.resolve(window.Plotly):a("https://cdn.jsdelivr.net/npm/plotly.js-dist-min@2.27.0/plotly.min.js").then(()=>window.Plotly)).then(o=>{t.forEach(e=>{try{let n=JSON.parse(e.dataset.plotly||"{}"),l=n.layout||{},s=Array.isArray(n.data)?n.data:Array.isArray(n)?n:[];o.newPlot(e,s,l,{responsive:!0})}catch(n){e.replaceChildren(),e.insertAdjacentHTML("afterbegin",'<p class="notebook-output__warning">Plotly figure could not be rendered. Open in Binder or Colab to interact.</p>')}})}):Promise.resolve()},d=()=>{let t=document.querySelectorAll(".notebook-output-vega");return t.length?a("https://cdn.jsdelivr.net/npm/vega@5").then(()=>a("https://cdn.jsdelivr.net/npm/vega-lite@5")).then(()=>a("https://cdn.jsdelivr.net/npm/vega-embed@6")).then(()=>{t.forEach(o=>{try{let e=JSON.parse(o.dataset.vega||"{}");window.vegaEmbed(o,e,{actions:!1})}catch(e){o.replaceChildren(),o.insertAdjacentHTML("afterbegin",'<p class="notebook-output__warning">Vega specification could not be parsed. Open in Binder for the interactive version.</p>')}})}):Promise.resolve()},p=()=>{document.querySelectorAll(".notebook-segment").forEach((r,o)=>{let e=r.id||`cell-${o+1}`;r.id=e,r.setAttribute("data-cell-anchor",e)})},u=()=>{let t={root:null,rootMargin:"0px 0px -65%",threshold:0},r=document.querySelectorAll(".notebook-segment"),o=document.querySelectorAll("[data-cell-anchor-link]");if(!r.length||!o.length)return;let e=new IntersectionObserver(n=>{n.forEach(l=>{l.isIntersecting&&o.forEach(s=>{s.classList.toggle("is-active",s.hash===`#${l.target.id}`)})})},t);r.forEach(n=>e.observe(n))},c=()=>{p(),i().catch(()=>{document.querySelectorAll(".notebook-output-plotly").forEach(t=>{t.replaceChildren(),t.insertAdjacentHTML("afterbegin",'<p class="notebook-output__warning">Plotly assets failed to load. Launch Binder/Colab to view the interactive chart.</p>')})}),d().catch(()=>{document.querySelectorAll(".notebook-output-vega").forEach(t=>{t.replaceChildren(),t.insertAdjacentHTML("afterbegin",'<p class="notebook-output__warning">Vega assets failed to load. Launch Binder/Colab to view the interactive chart.</p>')})}),u()};typeof window!="undefined"&&document.readyState==="loading"?document.addEventListener("DOMContentLoaded",c):typeof window!="undefined"&&c();export{p as annotateCells,u as handleScrollSpy,c as initNotebookFeatures,i as initPlotly,d as initVega,a as loadScript};
|