@hyperbook/markdown 0.26.0 → 0.28.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.
@@ -0,0 +1,53 @@
1
+ .directive-multievent table {
2
+ width: auto;
3
+ }
4
+
5
+ .directive-multievent table td {
6
+ display: table-cell;
7
+ vertical-align: middle;
8
+ }
9
+
10
+ .directive-multievent {
11
+
12
+ .MECheckbox:not(first-child),
13
+ .MERadio:not(first-child) {
14
+ margin-left: 8px;
15
+ }
16
+
17
+ .MECheckbox,
18
+ .MERadio {
19
+ margin-right: 4px;
20
+ }
21
+
22
+ .MeChLabel~.MECheckbox,
23
+ .MeRaLabel~.MERadio {
24
+ margin-right: 8px;
25
+ }
26
+
27
+ .MeChLabel~.MECheckbox:not(first-child),
28
+ .MeRaLabel~.MERadio:not(first-child) {
29
+ margin-left: 4px;
30
+ }
31
+
32
+ table.MultiKwrTable,
33
+ table.MultiEvSuchTable {
34
+ background-color: transparent;
35
+ border: none;
36
+ }
37
+
38
+ table.MultiKwrTable *,
39
+ table.MultiEvSuchTable * {
40
+ line-height: 1;
41
+ }
42
+
43
+ .MultiKwrTable tr,
44
+ .MultiEvSuchTable tr {
45
+ background-color: transparent;
46
+ border: none;
47
+ }
48
+
49
+ .MultiKwrTable td,
50
+ .MultiEvSuchTable td {
51
+ padding: 0;
52
+ }
53
+ }
@@ -30,6 +30,7 @@ li {
30
30
 
31
31
  side-drawer {
32
32
  position: absolute;
33
+ width: 500px;
33
34
  }
34
35
 
35
36
  #nav-drawer {
@@ -208,8 +209,8 @@ a.jump.previous::before {
208
209
  right: 0;
209
210
  top: 0;
210
211
  bottom: 0;
211
- grid-template-columns: 300px 1fr;
212
- grid-template-rows: 80px 1fr;
212
+ grid-template-columns: var(--nav-width) 1fr;
213
+ grid-template-rows: var(--header-height) 1fr;
213
214
  grid-template-areas:
214
215
  "header header header"
215
216
  "nav article article";
@@ -224,10 +225,12 @@ a.jump.previous::before {
224
225
  }
225
226
 
226
227
  .sidebar {
228
+ font-size: var(--nav-font-size);
227
229
  display: flex;
228
230
  flex-direction: column;
229
231
  grid-area: nav;
230
232
  overflow-y: auto;
233
+ scrollbar-width: thin;
231
234
  border-right-style: solid;
232
235
  border-right-width: 1px;
233
236
  background: var(--color-nav);
@@ -271,8 +274,8 @@ a.jump.previous::before {
271
274
  .toggle>.bar1,
272
275
  .toggle>.bar2,
273
276
  .toggle>.bar3 {
274
- width: 35px;
275
- height: 5px;
277
+ width: 30px;
278
+ height: 4px;
276
279
  margin: 6px 0;
277
280
  transition: 0.4s;
278
281
  }
@@ -295,7 +298,6 @@ a.jump.previous::before {
295
298
  @media screen and (max-width: 1280px) {
296
299
  .main-grid {
297
300
  grid-template-columns: 1fr;
298
- grid-template-rows: 80px 1fr;
299
301
  grid-template-areas:
300
302
  "header"
301
303
  "article";
@@ -318,7 +320,7 @@ main {
318
320
  }
319
321
 
320
322
  article {
321
- max-width: 1280px;
323
+ max-width: var(--main-width);
322
324
  margin: 0 auto;
323
325
  grid-area: article;
324
326
  line-height: 1.5;
@@ -518,13 +520,13 @@ header {
518
520
 
519
521
  .branding .name {
520
522
  font-family: hyperbook-heading, sans-serif;
521
- font-size: 20px;
523
+ font-size: 1.1rem;
522
524
  font-weight: bold;
523
525
  }
524
526
 
525
527
  .jump-container {
526
528
  display: flex;
527
- max-width: 980px;
529
+ max-width: var(--main-width);
528
530
  margin: 0 auto;
529
531
  margin-top: 40px;
530
532
  }
@@ -544,7 +546,7 @@ header {
544
546
  gap: 16px;
545
547
  margin-top: 30px;
546
548
  padding-top: 30px;
547
- max-width: 980px;
549
+ max-width: var(--main-width);
548
550
  }
549
551
 
550
552
  .meta .edit-github {
@@ -582,7 +584,7 @@ nav li+li {
582
584
  }
583
585
 
584
586
  .section {
585
- margin-top: 8px;
587
+ margin-top: 4px;
586
588
  }
587
589
 
588
590
  .section>.name {
package/dist/index.js CHANGED
@@ -66310,6 +66310,11 @@ body::-webkit-scrollbar {
66310
66310
  --color-brand: ${colors?.brand || "#007864"};
66311
66311
  --color-brand-dark: ${colors?.brandDark || colors?.brand || "#b5e3d8"};
66312
66312
  --color-brand-text: ${colors?.brandText || "white"};
66313
+ --main-width: 980px;
66314
+ --header-height: 60px;
66315
+ --nav-width: minmax(300px, 0.33fr);
66316
+ --nav-font-size: 0.9rem;
66317
+ --body-font-size: 14px;
66313
66318
  }`;
66314
66319
  if (font) {
66315
66320
  rootCss += `
@@ -66359,7 +66364,7 @@ body {
66359
66364
  color: var(--color-text);
66360
66365
  font-family: hyperbook-body;
66361
66366
  font-weight: normal;
66362
- font-size: 16px;
66367
+ font-size: var(--body-font-size);
66363
66368
  margin: 0;
66364
66369
  padding: 0;
66365
66370
  }
@@ -75771,10 +75776,92 @@ var remarkDirectiveJSXGraph_default = (ctx) => () => {
75771
75776
  };
75772
75777
  };
75773
75778
 
75779
+ // src/remarkDirectiveMultievent.ts
75780
+ var remarkDirectiveMultievent_default = (ctx) => () => {
75781
+ const name = "multievent";
75782
+ return (tree, file) => {
75783
+ visit(tree, function(node3) {
75784
+ if (isDirective(node3)) {
75785
+ if (node3.name !== name) return;
75786
+ const data = node3.data || (node3.data = {});
75787
+ expectContainerDirective(node3, file, name);
75788
+ registerDirective(file, name, ["multievent.js"], ["style.css"]);
75789
+ data.hName = "div";
75790
+ data.hProperties = {
75791
+ class: "directive-multievent multievent"
75792
+ };
75793
+ }
75794
+ });
75795
+ };
75796
+ };
75797
+
75798
+ // src/remarkSubSup.ts
75799
+ function supersub() {
75800
+ return (tree) => {
75801
+ visit(tree, ["text"], (node3, i, parent) => {
75802
+ if (node3.type !== "text") {
75803
+ return;
75804
+ }
75805
+ const { value } = node3;
75806
+ const values = value.split(/\^/);
75807
+ if (values.length === 1 || values.length % 2 === 0) {
75808
+ return;
75809
+ }
75810
+ const children = values.map(
75811
+ (str, i2) => i2 % 2 === 0 ? {
75812
+ type: "text",
75813
+ value: str
75814
+ } : {
75815
+ type: "superscript",
75816
+ data: {
75817
+ hName: "sup"
75818
+ },
75819
+ children: [
75820
+ {
75821
+ type: "text",
75822
+ value: str
75823
+ }
75824
+ ]
75825
+ }
75826
+ );
75827
+ parent.children.splice(i, 1, ...children);
75828
+ });
75829
+ visit(tree, ["text"], (node3, i, parent) => {
75830
+ if (node3.type !== "text") {
75831
+ return;
75832
+ }
75833
+ const { value } = node3;
75834
+ const values = value.split(/\_/);
75835
+ if (values.length === 1 || values.length % 2 === 0) {
75836
+ return;
75837
+ }
75838
+ const children = values.map(
75839
+ (str, i2) => i2 % 2 === 0 ? {
75840
+ type: "text",
75841
+ value: str
75842
+ } : {
75843
+ type: "subscript",
75844
+ data: {
75845
+ hName: "sub"
75846
+ },
75847
+ children: [
75848
+ {
75849
+ type: "text",
75850
+ value: str
75851
+ }
75852
+ ]
75853
+ }
75854
+ );
75855
+ parent.children.splice(i, 1, ...children);
75856
+ });
75857
+ };
75858
+ }
75859
+
75774
75860
  // src/process.ts
75775
75861
  var remark = (ctx) => {
75776
75862
  i18n.init(ctx.config.language || "en");
75777
75863
  const remarkPlugins = [
75864
+ supersub,
75778
75865
  remarkRemoveComments,
75779
75866
  remarkGemoji,
75780
75867
  remarkDirective,
@@ -75811,6 +75898,7 @@ var remark = (ctx) => {
75811
75898
  remarkDirectiveWebide_default(ctx),
75812
75899
  remarkDirectiveH5P_default(ctx),
75813
75900
  remarkDirectiveJSXGraph_default(ctx),
75901
+ remarkDirectiveMultievent_default(ctx),
75814
75902
  remarkCode_default(ctx),
75815
75903
  remarkMath,
75816
75904
  /* needs to be last directive */