pandoc-markdown-jekyll-theme 0.17.0 → 0.18.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.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/_includes/block_based_side_notes.html +1 -0
- data/_includes/default.html +1 -0
- data/assets/css/theme.css +96 -16
- data/assets/js/block_based_side_notes.js +46 -0
- metadata +9 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1fb4315d91a346a9532a927c78c5f9b56263e2d97b143413ffa1657237d80d7
|
|
4
|
+
data.tar.gz: e07267942451ae7d51e4dc6db584792eceb098eb2bad4fbdd8702dfe33f99f31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ff21effbf9a3154ec070af2c774b4b046390e373c83eb9457c82cfa5191fa2c933c9f2ee6699ea3eb7b5e9906434282c2b945713576a0ae9745055f5ed38a7c
|
|
7
|
+
data.tar.gz: 81163cabead49cd6a2babeae1b6d5cd9781b16f3fbab04949236873910537b72bfc64bc927458d61a1f78d9536a1cb5ef2b7817e04d45ef13bcb65eb8ddab24d
|
data/README.md
CHANGED
|
@@ -17,7 +17,10 @@ installation is as easy as:
|
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
brew install pandoc
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
curl --remote-name --no-clobber --create-dirs \
|
|
22
|
+
--output-dir "${XDG_DATA_DIR:-$HOME/.local/share/}/pandoc/filters" \
|
|
23
|
+
-sSL "https://github.com/jez/pandoc-sidenote/raw/refs/heads/master/pandoc-sidenote.lua"
|
|
21
24
|
```
|
|
22
25
|
|
|
23
26
|
Next, add this line to your Jekyll site's Gemfile:
|
|
@@ -55,7 +58,7 @@ markdown: Pandoc
|
|
|
55
58
|
pandoc:
|
|
56
59
|
extensions:
|
|
57
60
|
- from: 'markdown+smart+tex_math_single_backslash'
|
|
58
|
-
- filter: 'pandoc-sidenote'
|
|
61
|
+
- lua-filter: 'pandoc-sidenote.lua'
|
|
59
62
|
- template: '_template'
|
|
60
63
|
- katex
|
|
61
64
|
- toc
|
|
@@ -109,9 +112,10 @@ The following variables are used by this theme.
|
|
|
109
112
|
- `page.dir`
|
|
110
113
|
- Sets the HTML dir attribute. Default: `'ltr'`
|
|
111
114
|
|
|
112
|
-
You can also define:
|
|
115
|
+
You can also define either of:
|
|
113
116
|
|
|
114
117
|
- `_includes/enable_checkboxes.html`
|
|
118
|
+
- `_includes/block_based_side_notes.html`
|
|
115
119
|
|
|
116
120
|
to be an empty file in your project to remove the only non-math JavaScript.
|
|
117
121
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<script src="{{ site.baseurl }}/assets/js/block_based_side_notes.js"></script>
|
data/_includes/default.html
CHANGED
data/assets/css/theme.css
CHANGED
|
@@ -206,22 +206,36 @@ body {
|
|
|
206
206
|
margin-top: var(--side-note-baseline-offset);
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
:is(.sidenote, .marginnote) figcaption {
|
|
210
|
+
font-size: var(--side-note-font-size);
|
|
211
|
+
line-height: var(--side-note-line-height);
|
|
212
|
+
}
|
|
213
|
+
|
|
209
214
|
.sidenote code,
|
|
210
215
|
.marginnote code {
|
|
211
216
|
color: var(--color-sidenote);
|
|
212
217
|
}
|
|
213
218
|
|
|
219
|
+
/* Make paragraph breaks within sidenotes smaller. */
|
|
220
|
+
main > .sidenote-wrapper > :is(.marginnote, .sidenote) {
|
|
221
|
+
margin-bottom: var(--side-note-line-height);
|
|
222
|
+
}
|
|
223
|
+
|
|
214
224
|
main {
|
|
215
|
-
counter-reset: sidenote-counter;
|
|
225
|
+
counter-reset: sidenote-counter-anchor sidenote-counter;
|
|
216
226
|
}
|
|
217
227
|
|
|
218
|
-
.sidenote-number {
|
|
219
|
-
counter-increment: sidenote-counter;
|
|
228
|
+
.sidenote-number:after {
|
|
229
|
+
counter-increment: sidenote-counter-anchor;
|
|
230
|
+
content: counter(sidenote-counter-anchor);
|
|
220
231
|
}
|
|
221
232
|
|
|
222
|
-
.sidenote-number:after,
|
|
223
233
|
.sidenote:before {
|
|
234
|
+
counter-increment: sidenote-counter;
|
|
224
235
|
content: counter(sidenote-counter);
|
|
236
|
+
}
|
|
237
|
+
.sidenote-number:after,
|
|
238
|
+
.sidenote:before {
|
|
225
239
|
position: relative;
|
|
226
240
|
}
|
|
227
241
|
|
|
@@ -248,10 +262,11 @@ sup {
|
|
|
248
262
|
font-weight: inherit;
|
|
249
263
|
}
|
|
250
264
|
|
|
251
|
-
/* Make the superscript hang. */
|
|
252
|
-
.sidenote:before {
|
|
253
|
-
|
|
254
|
-
|
|
265
|
+
/* Make the superscript hang in the margin. */
|
|
266
|
+
.sidenote:before {
|
|
267
|
+
position: absolute;
|
|
268
|
+
right: calc(100% + 0.5ch);
|
|
269
|
+
}
|
|
255
270
|
|
|
256
271
|
/*}}} */
|
|
257
272
|
/* --- Side note input controls --- {{{ */
|
|
@@ -345,18 +360,60 @@ h3 {
|
|
|
345
360
|
font-weight: bold;
|
|
346
361
|
}
|
|
347
362
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
363
|
+
/* No one should ever have more than 4 sidenotes immediately after a heading */
|
|
364
|
+
/* 0 */ h1:not(.title) + :is(*:not(.sidenote-wrapper), p),
|
|
365
|
+
/* 1 */ h1:not(.title) + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
366
|
+
/* 2 */ h1:not(.title) + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
367
|
+
/* 3 */ h1:not(.title) + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
368
|
+
/* 4 */ h1:not(.title) + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p) {
|
|
369
|
+
margin-top: var(--h1-margin-bottom);
|
|
370
|
+
}
|
|
371
|
+
/* 0 */ h2 + :is(*:not(.sidenote-wrapper), p),
|
|
372
|
+
/* 1 */ h2 + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
373
|
+
/* 2 */ h2 + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
374
|
+
/* 3 */ h2 + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
375
|
+
/* 4 */ h2 + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p) {
|
|
376
|
+
margin-top: var(--h2-margin-bottom);
|
|
377
|
+
}
|
|
378
|
+
/* 0 */ h3 + :is(*:not(.sidenote-wrapper), p),
|
|
379
|
+
/* 1 */ h3 + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
380
|
+
/* 2 */ h3 + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
381
|
+
/* 3 */ h3 + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p),
|
|
382
|
+
/* 4 */ h3 + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + :is(*:not(.sidenote-wrapper), p) {
|
|
383
|
+
margin-top: 0;
|
|
384
|
+
}
|
|
351
385
|
|
|
352
386
|
/* }}} */
|
|
353
387
|
/* ----- Prose --------------------------------------------------------- {{{ */
|
|
354
388
|
|
|
355
|
-
p, main > ul, main > ol, div.sourceCode, main > pre, img, table {
|
|
389
|
+
p, main > ul, main > ol, .wide, :not(.wide) > div.sourceCode, main > pre, img, table, blockquote {
|
|
356
390
|
margin-top: var(--line-height);
|
|
357
391
|
margin-bottom: var(--line-height)
|
|
358
392
|
}
|
|
359
393
|
|
|
394
|
+
:is(.marginnote, .sidenote) :is(p, main > ul, main > ol, .wide, :not(.wide) > div.sourceCode, main > pre, img, table, blockquote) {
|
|
395
|
+
margin-top: var(--side-note-font-size);
|
|
396
|
+
margin-bottom: var(--side-note-font-size);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* Block-style sidenotes will have `p` tags in them, but we need to not have extra margins. */
|
|
400
|
+
.sidenote-wrapper > :is(.marginnote, .sidenote) > :is(p, main > ul, main > ol, .wide, :not(.wide) > div.sourceCode, main > pre, img, table, blockquote):first-child {
|
|
401
|
+
margin-top: 0;
|
|
402
|
+
}
|
|
403
|
+
.sidenote-wrapper > :is(.marginnote, .sidenote) > :is(p, main > ul, main > ol, .wide, :not(.wide) > div.sourceCode, main > pre, img, table, blockquote):last-child {
|
|
404
|
+
margin-bottom: 0;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.wide > p:first-child,
|
|
408
|
+
.wide > table:first-child,
|
|
409
|
+
:is(p, figure) > img:first-child {
|
|
410
|
+
margin-top: 0;
|
|
411
|
+
}
|
|
412
|
+
.wide > p:last-child,
|
|
413
|
+
:is(p, figure) > img:last-child {
|
|
414
|
+
margin-bottom: 0;
|
|
415
|
+
}
|
|
416
|
+
|
|
360
417
|
ul:not(.task-list) {
|
|
361
418
|
margin-left: var(--ul-indent-size);
|
|
362
419
|
}
|
|
@@ -782,11 +839,19 @@ figure {
|
|
|
782
839
|
margin-bottom: var(--captioned-figure-gap);
|
|
783
840
|
}
|
|
784
841
|
|
|
785
|
-
|
|
842
|
+
/* No one should ever have more than 4 sidenotes immediately after an image */
|
|
843
|
+
/* 0 */ figure + p,
|
|
844
|
+
/* 1 */ figure + .sidenote-wrapper + p,
|
|
845
|
+
/* 2 */ figure + .sidenote-wrapper + .sidenote-wrapper + p,
|
|
846
|
+
/* 3 */ figure + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + p,
|
|
847
|
+
/* 4 */ figure + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + .sidenote-wrapper + p {
|
|
786
848
|
margin-top: var(--captioned-figure-gap);
|
|
787
849
|
}
|
|
788
850
|
|
|
789
|
-
figure > img, figure > pre, figure > div.sourceCode {
|
|
851
|
+
figure > img, figure > pre, figure > div.sourceCode, figure:not(.wide) > div.sourceCode {
|
|
852
|
+
margin-bottom: var(--figcaption-gap);
|
|
853
|
+
}
|
|
854
|
+
:is(.sidenote, .marginnote) :is(figure > img, figure > pre, figure > div.sourceCode, figure:not(.wide) > div.sourceCode) {
|
|
790
855
|
margin-bottom: var(--figcaption-gap);
|
|
791
856
|
}
|
|
792
857
|
|
|
@@ -1184,6 +1249,11 @@ nav#TOC > input:checked + ul {
|
|
|
1184
1249
|
|
|
1185
1250
|
.wide {
|
|
1186
1251
|
width: var(--main-width);
|
|
1252
|
+
}
|
|
1253
|
+
.sidenote-wrapper .wide {
|
|
1254
|
+
width: 100%;
|
|
1255
|
+
}
|
|
1256
|
+
.wide {
|
|
1187
1257
|
overflow-x: auto;
|
|
1188
1258
|
overflow-y: hidden;
|
|
1189
1259
|
}
|
|
@@ -1220,10 +1290,20 @@ nav#TOC > input:checked + ul {
|
|
|
1220
1290
|
margin-right: var(--line-height);
|
|
1221
1291
|
}
|
|
1222
1292
|
|
|
1223
|
-
.
|
|
1224
|
-
.marginnote {
|
|
1293
|
+
.margin-toggle:not(:checked) + .marginnote {
|
|
1225
1294
|
display: none;
|
|
1226
1295
|
}
|
|
1296
|
+
.margin-toggle:not(:checked) + .sidenote {
|
|
1297
|
+
/* .sidenote is special because .sidenote:before tracks the counter,
|
|
1298
|
+
* and counters don't increment for display: none;
|
|
1299
|
+
* https://stackoverflow.com/a/36600119
|
|
1300
|
+
* */
|
|
1301
|
+
position: absolute;
|
|
1302
|
+
left: -9999px;
|
|
1303
|
+
max-height: 0px;
|
|
1304
|
+
overflow: hidden;
|
|
1305
|
+
opacity: 0;
|
|
1306
|
+
}
|
|
1227
1307
|
|
|
1228
1308
|
.margin-toggle:checked + .sidenote,
|
|
1229
1309
|
.margin-toggle:checked + .marginnote {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
;(function() {
|
|
2
|
+
function hoistAbove() {
|
|
3
|
+
const toHoist = document.querySelectorAll('main > .sidenote-wrapper + :not(.sidenote-wrapper)');
|
|
4
|
+
for (let i = toHoist.length - 1; i >= 0; i--) {
|
|
5
|
+
const source = toHoist[i];
|
|
6
|
+
let target = source.previousElementSibling;
|
|
7
|
+
while (target.previousElementSibling?.classList.contains('sidenote-wrapper')) {
|
|
8
|
+
target = target.previousElementSibling;
|
|
9
|
+
}
|
|
10
|
+
source.parentNode.insertBefore(source, target);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function sinkBelow() {
|
|
15
|
+
const toHoist = document.querySelectorAll('main > :not(.sidenote-wrapper) + .sidenote-wrapper');
|
|
16
|
+
for (let i = 0; i < toHoist.length; i++) {
|
|
17
|
+
const source = toHoist[i].previousElementSibling;
|
|
18
|
+
let target = source.nextElementSibling;
|
|
19
|
+
while (target.classList.contains('sidenote-wrapper')) {
|
|
20
|
+
target = target.nextElementSibling;
|
|
21
|
+
}
|
|
22
|
+
source.parentNode.insertBefore(source, target);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (window.matchMedia('screen')) {
|
|
27
|
+
if (window.innerWidth <= 796) {
|
|
28
|
+
hoistAbove();
|
|
29
|
+
}
|
|
30
|
+
let prevSize = window.innerWidth;
|
|
31
|
+
// Needs to mirror breakpoints in :root settings in CSS variables
|
|
32
|
+
// 745px = --main-width-narrow
|
|
33
|
+
// 26px = --line-height
|
|
34
|
+
// 169px = side note min width narrow
|
|
35
|
+
const breakpoint = 26 + 550 + 26 + 169 + 26 - 1;
|
|
36
|
+
window.addEventListener('resize', function() {
|
|
37
|
+
const newSize = window.innerWidth;
|
|
38
|
+
if (prevSize >= breakpoint && newSize < breakpoint) {
|
|
39
|
+
hoistAbove();
|
|
40
|
+
} else if (prevSize < breakpoint && newSize >= breakpoint) {
|
|
41
|
+
sinkBelow();
|
|
42
|
+
}
|
|
43
|
+
prevSize = newSize;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
})();
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pandoc-markdown-jekyll-theme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jake Zimmerman
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll-pandoc
|
|
@@ -66,7 +66,7 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '10.0'
|
|
69
|
-
description:
|
|
69
|
+
description:
|
|
70
70
|
email:
|
|
71
71
|
- zimmerman.jake@gmail.com
|
|
72
72
|
executables: []
|
|
@@ -76,6 +76,7 @@ files:
|
|
|
76
76
|
- README.md
|
|
77
77
|
- _includes/after.html
|
|
78
78
|
- _includes/before.html
|
|
79
|
+
- _includes/block_based_side_notes.html
|
|
79
80
|
- _includes/default.html
|
|
80
81
|
- _includes/enable_checkboxes.html
|
|
81
82
|
- _includes/footer.html
|
|
@@ -88,6 +89,7 @@ files:
|
|
|
88
89
|
- _template.html5
|
|
89
90
|
- assets/css/skylighting-solarized-theme.css
|
|
90
91
|
- assets/css/theme.css
|
|
92
|
+
- assets/js/block_based_side_notes.js
|
|
91
93
|
- assets/js/enable_checkboxes.js
|
|
92
94
|
- assets/js/enable_katex.js
|
|
93
95
|
- assets/libs/KaTeX/0.11.1/fonts/KaTeX_AMS-Regular.ttf
|
|
@@ -156,7 +158,7 @@ homepage: https://github.com/jez/pandoc-markdown-jekyll-theme
|
|
|
156
158
|
licenses:
|
|
157
159
|
- BlueOak-1.0.0
|
|
158
160
|
metadata: {}
|
|
159
|
-
post_install_message:
|
|
161
|
+
post_install_message:
|
|
160
162
|
rdoc_options: []
|
|
161
163
|
require_paths:
|
|
162
164
|
- lib
|
|
@@ -171,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
171
173
|
- !ruby/object:Gem::Version
|
|
172
174
|
version: '0'
|
|
173
175
|
requirements: []
|
|
174
|
-
rubygems_version: 3.
|
|
175
|
-
signing_key:
|
|
176
|
+
rubygems_version: 3.1.2
|
|
177
|
+
signing_key:
|
|
176
178
|
specification_version: 4
|
|
177
179
|
summary: A Jekyll theme based on jez/pandoc-markdown-css-theme
|
|
178
180
|
test_files: []
|