mystmd 1.1.56__py3-none-any.whl → 1.2.0__py3-none-any.whl
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.
- {mystmd-1.1.56.dist-info → mystmd-1.2.0.dist-info}/METADATA +1 -1
- mystmd-1.2.0.dist-info/RECORD +8 -0
- mystmd_py/main.py +3 -3
- mystmd_py/myst.cjs +213 -77
- mystmd-1.1.56.dist-info/RECORD +0 -8
- {mystmd-1.1.56.dist-info → mystmd-1.2.0.dist-info}/WHEEL +0 -0
- {mystmd-1.1.56.dist-info → mystmd-1.2.0.dist-info}/entry_points.txt +0 -0
- {mystmd-1.1.56.dist-info → mystmd-1.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
mystmd_py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
mystmd_py/main.py,sha256=AAcX3rJdJgYboCxwjHoCi1TdHSfBjNstbr562tjey44,1470
|
3
|
+
mystmd_py/myst.cjs,sha256=ceAHu1BOZFwIxJKLhpe_B-tVajtbrZSQaeozjADlQfg,12832298
|
4
|
+
mystmd-1.2.0.dist-info/METADATA,sha256=2ig9xX1IAEUUrOH8tgzf_tglNWdZoYJGSgDxDYbmHzg,2968
|
5
|
+
mystmd-1.2.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
6
|
+
mystmd-1.2.0.dist-info/entry_points.txt,sha256=eC2ol2gqS2q5E-ktkMrBSvV0tckGUcNGS-c4hEQ-_V4,45
|
7
|
+
mystmd-1.2.0.dist-info/licenses/LICENSE,sha256=vgXlcTOVbxYpGiMuE9NqgguIBXAH0hJAktlaxiyZ2wg,1088
|
8
|
+
mystmd-1.2.0.dist-info/RECORD,,
|
mystmd_py/main.py
CHANGED
@@ -14,7 +14,7 @@ def main():
|
|
14
14
|
|
15
15
|
if not NODE_LOCATION:
|
16
16
|
raise SystemExit(
|
17
|
-
"You must install node >=
|
17
|
+
"You must install node >=18 to run MyST\n\n"
|
18
18
|
"We recommend installing the latest LTS release, using your preferred package manager\n"
|
19
19
|
"or following instructions here: https://nodejs.org/en/download"
|
20
20
|
)
|
@@ -27,9 +27,9 @@ def main():
|
|
27
27
|
raise SystemExit(f"MyST could not determine the version of Node.js: {_version}")
|
28
28
|
|
29
29
|
major_version = int(major_version_match[1])
|
30
|
-
if not (major_version in {
|
30
|
+
if not (major_version in {18, 20, 22} or major_version > 22):
|
31
31
|
raise SystemExit(
|
32
|
-
f"MyST requires node
|
32
|
+
f"MyST requires node 18, 20, or 22+; you are running node {version[1:3]}.\n\n"
|
33
33
|
"Please update to the latest LTS release, using your preferred package manager\n"
|
34
34
|
"or following instructions here: https://nodejs.org/en/download"
|
35
35
|
)
|
mystmd_py/myst.cjs
CHANGED
@@ -193279,7 +193279,7 @@ var {
|
|
193279
193279
|
} = import_index.default;
|
193280
193280
|
|
193281
193281
|
// src/version.ts
|
193282
|
-
var version = "1.
|
193282
|
+
var version = "1.2.0";
|
193283
193283
|
var version_default = version;
|
193284
193284
|
|
193285
193285
|
// ../myst-cli/dist/build/build.js
|
@@ -194274,6 +194274,7 @@ var AFFILIATION_KEYS = [
|
|
194274
194274
|
];
|
194275
194275
|
var AFFILIATION_ALIASES = {
|
194276
194276
|
ref: "id",
|
194277
|
+
// Used in QMD to reference an affiliation
|
194277
194278
|
region: "state",
|
194278
194279
|
province: "state",
|
194279
194280
|
zipcode: "postal_code",
|
@@ -194619,6 +194620,7 @@ var PERSON_KEYS = [
|
|
194619
194620
|
];
|
194620
194621
|
var PERSON_ALIASES = {
|
194621
194622
|
ref: "id",
|
194623
|
+
// Used in QMD to reference a contributor
|
194622
194624
|
role: "roles",
|
194623
194625
|
"equal-contributor": "equal_contributor",
|
194624
194626
|
affiliation: "affiliations",
|
@@ -194898,6 +194900,7 @@ var PROJECT_AND_PAGE_FRONTMATTER_KEYS = [
|
|
194898
194900
|
"exports",
|
194899
194901
|
"downloads",
|
194900
194902
|
"settings",
|
194903
|
+
// We maybe want to move this into site frontmatter in the future
|
194901
194904
|
// Do not add any project specific keys here!
|
194902
194905
|
...SITE_FRONTMATTER_KEYS
|
194903
194906
|
];
|
@@ -205878,6 +205881,7 @@ var admonitionTitle = (h4, node3) => h4(node3, "p", { class: "admonition-title"
|
|
205878
205881
|
var admonition = (h4, node3) => h4(node3, "aside", {
|
205879
205882
|
class: (0, import_classnames.default)({
|
205880
205883
|
[node3.class]: node3.class,
|
205884
|
+
// The custom class is first!!
|
205881
205885
|
admonition: true,
|
205882
205886
|
[node3.kind]: node3.kind && node3.kind !== "admonition"
|
205883
205887
|
})
|
@@ -220573,6 +220577,13 @@ var defaultHtmlToMdastOptions = {
|
|
220573
220577
|
cite(h4, node3) {
|
220574
220578
|
const attrs = addClassAndIdentifier(node3);
|
220575
220579
|
return attrs.label ? h4(node3, "cite", attrs, all5(h4, node3)) : all5(h4, node3);
|
220580
|
+
},
|
220581
|
+
details(h4, node3) {
|
220582
|
+
const attrs = addClassAndIdentifier(node3);
|
220583
|
+
return h4(node3, "details", attrs, all5(h4, node3));
|
220584
|
+
},
|
220585
|
+
summary(h4, node3) {
|
220586
|
+
return h4(node3, "summary", all5(h4, node3));
|
220576
220587
|
}
|
220577
220588
|
}
|
220578
220589
|
};
|
@@ -236336,7 +236347,18 @@ var abbreviationPlugin = (opts) => (tree) => {
|
|
236336
236347
|
};
|
236337
236348
|
|
236338
236349
|
// ../myst-transforms/dist/include.js
|
236339
|
-
|
236350
|
+
function updateFrontmatterFromInclude(frontmatter, includeFrontmatter) {
|
236351
|
+
if (frontmatter.math || (includeFrontmatter === null || includeFrontmatter === void 0 ? void 0 : includeFrontmatter.math)) {
|
236352
|
+
frontmatter.math = { ...frontmatter.math, ...includeFrontmatter === null || includeFrontmatter === void 0 ? void 0 : includeFrontmatter.math };
|
236353
|
+
}
|
236354
|
+
if (frontmatter.abbreviations || (includeFrontmatter === null || includeFrontmatter === void 0 ? void 0 : includeFrontmatter.abbreviations)) {
|
236355
|
+
frontmatter.abbreviations = {
|
236356
|
+
...frontmatter.abbreviations,
|
236357
|
+
...includeFrontmatter === null || includeFrontmatter === void 0 ? void 0 : includeFrontmatter.abbreviations
|
236358
|
+
};
|
236359
|
+
}
|
236360
|
+
}
|
236361
|
+
async function includeDirectiveTransform(tree, frontmatter, vfile2, opts) {
|
236340
236362
|
const includeNodes = selectAll("include", tree);
|
236341
236363
|
if (includeNodes.length === 0)
|
236342
236364
|
return;
|
@@ -236408,12 +236430,14 @@ async function includeDirectiveTransform(tree, vfile2, opts) {
|
|
236408
236430
|
children = [container4];
|
236409
236431
|
}
|
236410
236432
|
} else {
|
236411
|
-
|
236433
|
+
const parsed = await opts.parseContent(fullFile, content3);
|
236434
|
+
children = parsed.mdast.children;
|
236435
|
+
updateFrontmatterFromInclude(frontmatter, parsed.frontmatter);
|
236412
236436
|
}
|
236413
236437
|
node3.children = children;
|
236414
236438
|
if (!((_b = node3.children) === null || _b === void 0 ? void 0 : _b.length))
|
236415
236439
|
return;
|
236416
|
-
await includeDirectiveTransform(node3, vfile2, {
|
236440
|
+
await includeDirectiveTransform(node3, frontmatter, vfile2, {
|
236417
236441
|
...opts,
|
236418
236442
|
stack: [...(_c = opts.stack) !== null && _c !== void 0 ? _c : [], fullFile],
|
236419
236443
|
sourceFile: fullFile
|
@@ -237298,7 +237322,7 @@ function getFrontmatter(file, tree, opts = { propagateTargets: true }) {
|
|
237298
237322
|
const nextNodeIsH1 = (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type) === "heading" && nextNode.depth === 1;
|
237299
237323
|
if (nextNodeIsH1 && !titleNull) {
|
237300
237324
|
const title = toText(nextNode.children);
|
237301
|
-
if (frontmatter.title && frontmatter.title === title) {
|
237325
|
+
if (frontmatter.title && frontmatter.title === title && !opts.keepTitleNode) {
|
237302
237326
|
nextNode.type = "__delete__";
|
237303
237327
|
frontmatter.content_includes_title = false;
|
237304
237328
|
if (nextNode.label) {
|
@@ -239775,10 +239799,11 @@ function frontmatterValidationOpts(vfile2, opts) {
|
|
239775
239799
|
}
|
239776
239800
|
};
|
239777
239801
|
}
|
239778
|
-
function getPageFrontmatter(session, tree, vfile2, preFrontmatter) {
|
239802
|
+
function getPageFrontmatter(session, tree, vfile2, preFrontmatter, keepTitleNode) {
|
239779
239803
|
const { frontmatter: rawPageFrontmatter, identifiers } = getFrontmatter(vfile2, tree, {
|
239780
239804
|
propagateTargets: true,
|
239781
|
-
preFrontmatter
|
239805
|
+
preFrontmatter,
|
239806
|
+
keepTitleNode
|
239782
239807
|
});
|
239783
239808
|
unnestKernelSpec(rawPageFrontmatter);
|
239784
239809
|
const pageFrontmatter = validatePageFrontmatter(rawPageFrontmatter, frontmatterValidationOpts(vfile2));
|
@@ -240498,7 +240523,9 @@ var LatexSpecialSymbols = {
|
|
240498
240523
|
textdegree: "\xBA",
|
240499
240524
|
textasciitilde: "~",
|
240500
240525
|
textvisiblespace: " ",
|
240526
|
+
// Not sure this will work, but close enough
|
240501
240527
|
" ": " ",
|
240528
|
+
// this is a single backslash followed by a space
|
240502
240529
|
",": THIN_SPACE
|
240503
240530
|
// this is a thin space (https://en.wikipedia.org/wiki/Thin_space) `\,` in latex
|
240504
240531
|
};
|
@@ -240541,6 +240568,7 @@ var textOnlyReplacements = {
|
|
240541
240568
|
"'": "\u2019",
|
240542
240569
|
"`": "\u2018",
|
240543
240570
|
"---": "\u2014",
|
240571
|
+
// must be above the next one
|
240544
240572
|
"--": "\u2013",
|
240545
240573
|
"~": "\u202F"
|
240546
240574
|
};
|
@@ -276221,6 +276249,7 @@ function parseArgument(node3, next) {
|
|
276221
276249
|
type: "argument",
|
276222
276250
|
content: [],
|
276223
276251
|
openMark: next.content,
|
276252
|
+
// will `closeMark` in next pass
|
276224
276253
|
position: { start: (_a6 = next.position) === null || _a6 === void 0 ? void 0 : _a6.start }
|
276225
276254
|
});
|
276226
276255
|
return true;
|
@@ -276439,24 +276468,43 @@ var SECTION_HANDLERS = {
|
|
276439
276468
|
var colors = {
|
276440
276469
|
// Standard html colors:
|
276441
276470
|
black: "black",
|
276471
|
+
// #000000
|
276442
276472
|
blue: "blue",
|
276473
|
+
// #0000FF
|
276443
276474
|
brown: "brown",
|
276475
|
+
// #A52A2A
|
276444
276476
|
cyan: "cyan",
|
276477
|
+
// #00FFFF
|
276445
276478
|
darkgray: "darkgray",
|
276479
|
+
// #A9A9A9
|
276446
276480
|
gray: "gray",
|
276481
|
+
// #808080
|
276447
276482
|
green: "green",
|
276483
|
+
// #008000
|
276448
276484
|
lightgray: "lightgray",
|
276485
|
+
// #D3D3D3
|
276449
276486
|
lime: "lime",
|
276487
|
+
// #00FF00
|
276450
276488
|
magenta: "magenta",
|
276489
|
+
// #FF00FF
|
276451
276490
|
olive: "olive",
|
276491
|
+
// #808000
|
276452
276492
|
orange: "orange",
|
276493
|
+
// #FFA500
|
276453
276494
|
pink: "pink",
|
276495
|
+
// #FFC0CB
|
276454
276496
|
purple: "purple",
|
276497
|
+
// #800080
|
276455
276498
|
red: "red",
|
276499
|
+
// #FF0000
|
276456
276500
|
teal: "teal",
|
276501
|
+
// #008080
|
276457
276502
|
violet: "violet",
|
276503
|
+
// #EE82EE
|
276458
276504
|
white: "white",
|
276505
|
+
// #FFFFFF
|
276459
276506
|
yellow: "yellow",
|
276507
|
+
// #FFFF00
|
276460
276508
|
// Other named latex colors
|
276461
276509
|
Apricot: "#FBB982",
|
276462
276510
|
Aquamarine: "#00B5BE",
|
@@ -277758,36 +277806,62 @@ var UNITS = {
|
|
277758
277806
|
litre: "L",
|
277759
277807
|
liter: "L",
|
277760
277808
|
arcminute: "\u2032",
|
277809
|
+
// minute (plane angle) U+2032
|
277761
277810
|
minute: "min",
|
277811
|
+
// minute (time)
|
277762
277812
|
arcsecond: "\u2033",
|
277813
|
+
// second (plane angle) U+2033
|
277763
277814
|
neper: "Np",
|
277764
277815
|
tonne: "t",
|
277765
277816
|
celsius: "\u2103"
|
277766
277817
|
};
|
277767
277818
|
var PREFIXES = {
|
277768
277819
|
quecto: "q",
|
277820
|
+
// -30
|
277769
277821
|
ronto: "r",
|
277822
|
+
// -27
|
277770
277823
|
yocto: "y",
|
277824
|
+
// -24
|
277771
277825
|
zepto: "z",
|
277826
|
+
// -21
|
277772
277827
|
atto: "a",
|
277828
|
+
// -18
|
277773
277829
|
femto: "f",
|
277830
|
+
// -15
|
277774
277831
|
pico: "p",
|
277832
|
+
// -12
|
277775
277833
|
nano: "n",
|
277834
|
+
// -9
|
277776
277835
|
micro: "\xB5",
|
277836
|
+
// -6
|
277777
277837
|
milli: "m",
|
277838
|
+
// -3
|
277778
277839
|
centi: "c",
|
277840
|
+
// -2
|
277779
277841
|
deci: "d",
|
277842
|
+
// -1
|
277780
277843
|
deca: "da",
|
277844
|
+
// 1
|
277781
277845
|
hecto: "h",
|
277846
|
+
// 2
|
277782
277847
|
kilo: "k",
|
277848
|
+
// 3
|
277783
277849
|
mega: "M",
|
277850
|
+
// 6
|
277784
277851
|
giga: "G",
|
277852
|
+
// 9
|
277785
277853
|
tera: "T",
|
277854
|
+
// 12
|
277786
277855
|
peta: "P",
|
277856
|
+
// 15
|
277787
277857
|
exa: "E",
|
277858
|
+
// 18
|
277788
277859
|
zetta: "Z",
|
277860
|
+
// 21
|
277789
277861
|
yotta: "Y",
|
277862
|
+
// 24
|
277790
277863
|
ronna: "R",
|
277864
|
+
// 27
|
277791
277865
|
quetta: "Q"
|
277792
277866
|
// 30
|
277793
277867
|
};
|
@@ -277851,7 +277925,9 @@ var ABBREVIATIONS = {
|
|
277851
277925
|
GPa: "giga pascal",
|
277852
277926
|
mohm: "milli ohm",
|
277853
277927
|
kohm: "kilo ohm",
|
277928
|
+
// kilohm
|
277854
277929
|
Mohm: "mega ohm",
|
277930
|
+
// megohm
|
277855
277931
|
pV: "pico volt",
|
277856
277932
|
nV: "nano volt",
|
277857
277933
|
uV: "micro volt",
|
@@ -283966,31 +284042,54 @@ var UNITS2 = {
|
|
283966
284042
|
litre: "L",
|
283967
284043
|
liter: "L",
|
283968
284044
|
arcminute: "\u2032",
|
284045
|
+
// minute (plane angle) U+2032
|
283969
284046
|
minute: "min",
|
284047
|
+
// minute (time)
|
283970
284048
|
arcsecond: "\u2033",
|
284049
|
+
// second (plane angle) U+2033
|
283971
284050
|
neper: "Np",
|
283972
284051
|
tonne: "t",
|
283973
284052
|
// SI prefixes
|
283974
284053
|
yocto: "y",
|
284054
|
+
// -24
|
283975
284055
|
zepto: "z",
|
284056
|
+
// -21
|
283976
284057
|
atto: "a",
|
284058
|
+
// -18
|
283977
284059
|
femto: "f",
|
284060
|
+
// -15
|
283978
284061
|
pico: "p",
|
284062
|
+
// -12
|
283979
284063
|
nano: "n",
|
284064
|
+
// -9
|
283980
284065
|
micro: "\xB5",
|
284066
|
+
// -6
|
283981
284067
|
milli: "m",
|
284068
|
+
// -3
|
283982
284069
|
centi: "c",
|
284070
|
+
// -2
|
283983
284071
|
deci: "d",
|
284072
|
+
// -1
|
283984
284073
|
deca: "da",
|
284074
|
+
// 1
|
283985
284075
|
hecto: "h",
|
284076
|
+
// 2
|
283986
284077
|
kilo: "k",
|
284078
|
+
// 3
|
283987
284079
|
mega: "M",
|
284080
|
+
// 6
|
283988
284081
|
giga: "G",
|
284082
|
+
// 9
|
283989
284083
|
tera: "T",
|
284084
|
+
// 12
|
283990
284085
|
peta: "P",
|
284086
|
+
// 15
|
283991
284087
|
exa: "E",
|
284088
|
+
// 18
|
283992
284089
|
zetta: "Z",
|
284090
|
+
// 21
|
283993
284091
|
yotta: "Y",
|
284092
|
+
// 24
|
283994
284093
|
// Special
|
283995
284094
|
angstrom: "\xC5"
|
283996
284095
|
};
|
@@ -285270,10 +285369,15 @@ var tlds = [
|
|
285270
285369
|
var MARKDOWN_IT_CONFIG = {
|
285271
285370
|
options: {
|
285272
285371
|
html: true,
|
285372
|
+
// Enable HTML tags in source
|
285273
285373
|
xhtmlOut: true,
|
285374
|
+
// Use '/' to close single tags (<br />)
|
285274
285375
|
breaks: false,
|
285376
|
+
// Convert '\n' in paragraphs into <br>
|
285275
285377
|
langPrefix: "language-",
|
285378
|
+
// CSS language prefix for fenced blocks
|
285276
285379
|
linkify: false,
|
285380
|
+
// autoconvert URL-like texts to links
|
285277
285381
|
// Enable some language-neutral replacements + quotes beautification
|
285278
285382
|
typographer: false,
|
285279
285383
|
// Double + single quotes replacement pairs, when typographer enabled,
|
@@ -285601,7 +285705,9 @@ var defaultMdast = {
|
|
285601
285705
|
...normalizeLabel(name3),
|
285602
285706
|
class: getClassName(t2),
|
285603
285707
|
showLineNumbers: showLineNumbers || void 0,
|
285708
|
+
// Only add to MDAST if true
|
285604
285709
|
startingLineNumber: showLineNumbers ? startingLineNumber : void 0,
|
285710
|
+
// Only if showing line numbers!
|
285605
285711
|
emphasizeLines,
|
285606
285712
|
value: withoutTrailingNewline(t2.content)
|
285607
285713
|
};
|
@@ -285797,6 +285903,7 @@ var defaultMdast = {
|
|
285797
285903
|
label,
|
285798
285904
|
kind: t2.meta.kind,
|
285799
285905
|
partial: t2.meta.partial,
|
285906
|
+
// author or year
|
285800
285907
|
// TODO: can use the parsed version in the future
|
285801
285908
|
prefix: (_b = t2.meta.prefix) === null || _b === void 0 ? void 0 : _b[0].content,
|
285802
285909
|
suffix: (_c = t2.meta.suffix) === null || _c === void 0 ? void 0 : _c[0].content
|
@@ -286877,6 +286984,7 @@ var tabSetDirective = {
|
|
286877
286984
|
var tabItemDirective = {
|
286878
286985
|
name: "tab-item",
|
286879
286986
|
alias: ["tabItem", "tab"],
|
286987
|
+
// TODO: A transform is necessary for stray `tab`s
|
286880
286988
|
arg: {
|
286881
286989
|
type: String
|
286882
286990
|
},
|
@@ -286942,7 +287050,7 @@ var import_node_path17 = __toESM(require("path"), 1);
|
|
286942
287050
|
var import_nbtx = __toESM(require_cjs2(), 1);
|
286943
287051
|
|
286944
287052
|
// ../myst-cli/dist/version.js
|
286945
|
-
var version2 = "1.
|
287053
|
+
var version2 = "1.2.0";
|
286946
287054
|
var version_default2 = version2;
|
286947
287055
|
|
286948
287056
|
// ../myst-cli/dist/utils/headers.js
|
@@ -287006,7 +287114,7 @@ ${source_default.bold.blue(docLinks.installNode)}
|
|
287006
287114
|
`;
|
287007
287115
|
async function getNodeVersion(session) {
|
287008
287116
|
const result = new Promise((resolve7) => {
|
287009
|
-
(0, import_check_node_version.default)({ node: ">=
|
287117
|
+
(0, import_check_node_version.default)({ node: ">= 18.0.0", npm: ">=8.6.0" }, (error, results) => {
|
287010
287118
|
if (error) {
|
287011
287119
|
session.log.error(error);
|
287012
287120
|
resolve7(null);
|
@@ -288095,6 +288203,38 @@ function checkCache(cache, content3, file) {
|
|
288095
288203
|
const useCache = (mdast2 === null || mdast2 === void 0 ? void 0 : mdast2.pre) && mdast2.sha256 === sha256;
|
288096
288204
|
return { useCache, sha256 };
|
288097
288205
|
}
|
288206
|
+
function loadMdFile(session, content3, file, opts) {
|
288207
|
+
const vfile2 = new VFile();
|
288208
|
+
vfile2.path = file;
|
288209
|
+
const mdast2 = parseMyst(session, content3, file);
|
288210
|
+
const { frontmatter, identifiers } = getPageFrontmatter(session, mdast2, vfile2, opts === null || opts === void 0 ? void 0 : opts.preFrontmatter, opts === null || opts === void 0 ? void 0 : opts.keepTitleNode);
|
288211
|
+
return { kind: SourceFileKind.Article, mdast: mdast2, frontmatter, identifiers };
|
288212
|
+
}
|
288213
|
+
async function loadNotebookFile(session, content3, file, opts) {
|
288214
|
+
const vfile2 = new VFile();
|
288215
|
+
vfile2.path = file;
|
288216
|
+
const mdast2 = await processNotebook(session, file, content3);
|
288217
|
+
const { frontmatter, identifiers } = getPageFrontmatter(session, mdast2, vfile2, opts === null || opts === void 0 ? void 0 : opts.preFrontmatter, opts === null || opts === void 0 ? void 0 : opts.keepTitleNode);
|
288218
|
+
return { kind: SourceFileKind.Notebook, mdast: mdast2, frontmatter, identifiers };
|
288219
|
+
}
|
288220
|
+
function loadTexFile(session, content3, file, opts) {
|
288221
|
+
var _a6;
|
288222
|
+
const vfile2 = new VFile();
|
288223
|
+
vfile2.path = file;
|
288224
|
+
const tex = new TexParser(content3, vfile2);
|
288225
|
+
const frontmatter = validatePageFrontmatter({
|
288226
|
+
title: toText(tex.data.frontmatter.title),
|
288227
|
+
short_title: toText(tex.data.frontmatter.short_title),
|
288228
|
+
authors: tex.data.frontmatter.authors,
|
288229
|
+
// TODO: affiliations: tex.data.frontmatter.affiliations,
|
288230
|
+
keywords: tex.data.frontmatter.keywords,
|
288231
|
+
math: tex.data.macros,
|
288232
|
+
bibliography: tex.data.bibliography,
|
288233
|
+
...(_a6 = opts === null || opts === void 0 ? void 0 : opts.preFrontmatter) !== null && _a6 !== void 0 ? _a6 : {}
|
288234
|
+
}, frontmatterValidationOpts(vfile2));
|
288235
|
+
logMessagesFromVFile(session, vfile2);
|
288236
|
+
return { kind: SourceFileKind.Article, mdast: tex.ast, frontmatter };
|
288237
|
+
}
|
288098
288238
|
async function loadFile(session, file, projectPath, extension, opts) {
|
288099
288239
|
var _a6, _b;
|
288100
288240
|
await session.loadPlugins();
|
@@ -288107,35 +288247,26 @@ async function loadFile(session, file, projectPath, extension, opts) {
|
|
288107
288247
|
location4 = `/${import_node_path18.default.relative(projectPath, file)}`;
|
288108
288248
|
}
|
288109
288249
|
location4 = location4.replaceAll("\\", "/");
|
288110
|
-
const vfile2 = new VFile();
|
288111
|
-
vfile2.path = file;
|
288112
288250
|
try {
|
288251
|
+
const content3 = import_node_fs11.default.readFileSync(file).toString();
|
288252
|
+
const { sha256, useCache } = checkCache(cache, content3, file);
|
288253
|
+
if (useCache) {
|
288254
|
+
session.log.debug(toc(`loadFile: ${file} already loaded.`));
|
288255
|
+
return (_a6 = cache.$getMdast(file)) === null || _a6 === void 0 ? void 0 : _a6.pre;
|
288256
|
+
}
|
288113
288257
|
const ext2 = extension || import_node_path18.default.extname(file).toLowerCase();
|
288258
|
+
let loadResult;
|
288114
288259
|
switch (ext2) {
|
288115
288260
|
case ".md": {
|
288116
|
-
|
288117
|
-
const { sha256, useCache } = checkCache(cache, content3, file);
|
288118
|
-
if (useCache)
|
288119
|
-
break;
|
288120
|
-
const mdast2 = parseMyst(session, content3, file);
|
288121
|
-
const { frontmatter, identifiers } = getPageFrontmatter(session, mdast2, vfile2, opts === null || opts === void 0 ? void 0 : opts.preFrontmatter);
|
288122
|
-
cache.$setMdast(file, {
|
288123
|
-
sha256,
|
288124
|
-
pre: { kind: SourceFileKind.Article, file, location: location4, mdast: mdast2, frontmatter, identifiers }
|
288125
|
-
});
|
288261
|
+
loadResult = loadMdFile(session, content3, file, opts);
|
288126
288262
|
break;
|
288127
288263
|
}
|
288128
288264
|
case ".ipynb": {
|
288129
|
-
|
288130
|
-
|
288131
|
-
|
288132
|
-
|
288133
|
-
|
288134
|
-
const { frontmatter, identifiers } = getPageFrontmatter(session, mdast2, vfile2, opts === null || opts === void 0 ? void 0 : opts.preFrontmatter);
|
288135
|
-
cache.$setMdast(file, {
|
288136
|
-
sha256,
|
288137
|
-
pre: { kind: SourceFileKind.Notebook, file, location: location4, mdast: mdast2, frontmatter, identifiers }
|
288138
|
-
});
|
288265
|
+
loadResult = await loadNotebookFile(session, content3, file, opts);
|
288266
|
+
break;
|
288267
|
+
}
|
288268
|
+
case ".tex": {
|
288269
|
+
loadResult = loadTexFile(session, content3, file, opts);
|
288139
288270
|
break;
|
288140
288271
|
}
|
288141
288272
|
case ".bib": {
|
@@ -288143,35 +288274,6 @@ async function loadFile(session, file, projectPath, extension, opts) {
|
|
288143
288274
|
cache.$citationRenderers[file] = renderer;
|
288144
288275
|
break;
|
288145
288276
|
}
|
288146
|
-
case ".tex": {
|
288147
|
-
const content3 = import_node_fs11.default.readFileSync(file).toString();
|
288148
|
-
const { sha256, useCache } = checkCache(cache, content3, file);
|
288149
|
-
if (useCache)
|
288150
|
-
break;
|
288151
|
-
const tex = new TexParser(content3, vfile2);
|
288152
|
-
const frontmatter = validatePageFrontmatter({
|
288153
|
-
title: toText(tex.data.frontmatter.title),
|
288154
|
-
short_title: toText(tex.data.frontmatter.short_title),
|
288155
|
-
authors: tex.data.frontmatter.authors,
|
288156
|
-
// TODO: affiliations: tex.data.frontmatter.affiliations,
|
288157
|
-
keywords: tex.data.frontmatter.keywords,
|
288158
|
-
math: tex.data.macros,
|
288159
|
-
bibliography: tex.data.bibliography,
|
288160
|
-
...(_a6 = opts === null || opts === void 0 ? void 0 : opts.preFrontmatter) !== null && _a6 !== void 0 ? _a6 : {}
|
288161
|
-
}, frontmatterValidationOpts(vfile2));
|
288162
|
-
logMessagesFromVFile(session, vfile2);
|
288163
|
-
cache.$setMdast(file, {
|
288164
|
-
sha256,
|
288165
|
-
pre: {
|
288166
|
-
kind: SourceFileKind.Article,
|
288167
|
-
file,
|
288168
|
-
mdast: tex.ast,
|
288169
|
-
location: location4,
|
288170
|
-
frontmatter
|
288171
|
-
}
|
288172
|
-
});
|
288173
|
-
break;
|
288174
|
-
}
|
288175
288277
|
default:
|
288176
288278
|
addWarningForFile(session, file, "Unrecognized extension", "error", {
|
288177
288279
|
ruleId: RuleId.mystFileLoads
|
@@ -288179,6 +288281,12 @@ async function loadFile(session, file, projectPath, extension, opts) {
|
|
288179
288281
|
session.log.info(`"${file}": Please rerun the build with "-c" to ensure the built files are cleared.`);
|
288180
288282
|
success = false;
|
288181
288283
|
}
|
288284
|
+
if (loadResult) {
|
288285
|
+
cache.$setMdast(file, {
|
288286
|
+
sha256,
|
288287
|
+
pre: { file, location: location4, ...loadResult }
|
288288
|
+
});
|
288289
|
+
}
|
288182
288290
|
} catch (error) {
|
288183
288291
|
session.log.debug(`
|
288184
288292
|
|
@@ -298701,26 +298809,25 @@ var makeFileLoader = (session, baseFile) => (fullFile) => {
|
|
298701
298809
|
}));
|
298702
298810
|
return import_node_fs25.default.readFileSync(fullFile).toString();
|
298703
298811
|
};
|
298704
|
-
var makeContentParser = (session) => async (filename, content3
|
298705
|
-
var _a6;
|
298812
|
+
var makeContentParser = (session, file) => async (filename, content3) => {
|
298706
298813
|
if (filename.toLowerCase().endsWith(".html")) {
|
298707
|
-
|
298814
|
+
const mdast2 = { type: "root", children: [{ type: "html", value: content3 }] };
|
298815
|
+
return { mdast: mdast2, kind: SourceFileKind.Article };
|
298708
298816
|
}
|
298817
|
+
const opts = { keepTitleNode: true };
|
298709
298818
|
if (filename.toLowerCase().endsWith(".tex")) {
|
298710
|
-
|
298711
|
-
return (_a6 = subTex.ast.children) !== null && _a6 !== void 0 ? _a6 : [];
|
298819
|
+
return loadTexFile(session, content3, file, opts);
|
298712
298820
|
}
|
298713
298821
|
if (filename.toLowerCase().endsWith(".ipynb")) {
|
298714
|
-
|
298715
|
-
return mdast2.children;
|
298822
|
+
return loadNotebookFile(session, content3, file, opts);
|
298716
298823
|
}
|
298717
|
-
return
|
298824
|
+
return loadMdFile(session, content3, file, opts);
|
298718
298825
|
};
|
298719
|
-
async function includeFilesTransform(session, baseFile, tree, vfile2) {
|
298720
|
-
const parseContent = makeContentParser(session);
|
298826
|
+
async function includeFilesTransform(session, baseFile, tree, frontmatter, vfile2) {
|
298827
|
+
const parseContent = makeContentParser(session, baseFile);
|
298721
298828
|
const loadFile2 = makeFileLoader(session, baseFile);
|
298722
298829
|
const resolveFile = makeFileResolver(baseFile);
|
298723
|
-
await includeDirectiveTransform(tree, vfile2, {
|
298830
|
+
await includeDirectiveTransform(tree, frontmatter, vfile2, {
|
298724
298831
|
resolveFile,
|
298725
298832
|
loadFile: loadFile2,
|
298726
298833
|
parseContent,
|
@@ -300017,7 +300124,7 @@ async function transformMdast(session, opts) {
|
|
300017
300124
|
cache.$internalReferences[file] = state;
|
300018
300125
|
frontmatterPartsTransform(session, file, mdast2, frontmatter);
|
300019
300126
|
importMdastFromJson(session, file, mdast2);
|
300020
|
-
await includeFilesTransform(session, file, mdast2, vfile2);
|
300127
|
+
await includeFilesTransform(session, file, mdast2, frontmatter, vfile2);
|
300021
300128
|
rawDirectiveTransform(mdast2, vfile2);
|
300022
300129
|
liftCodeMetadataToBlock(session, vfile2, mdast2);
|
300023
300130
|
const pipe = unified().use(reconstructHtmlPlugin).use(htmlPlugin, { htmlHandlers }).use(basicTransformationsPlugin, {
|
@@ -300037,6 +300144,7 @@ async function transformMdast(session, opts) {
|
|
300037
300144
|
new GithubTransformer(),
|
300038
300145
|
new RRIDTransformer(),
|
300039
300146
|
new DOITransformer(),
|
300147
|
+
// This also is picked up in the next transform
|
300040
300148
|
new MystTransformer(intersphinx)
|
300041
300149
|
];
|
300042
300150
|
linksTransform(mdast2, vfile2, { transformers, selector: LINKS_SELECTOR });
|
@@ -300649,6 +300757,7 @@ function getDefaultEnv(template) {
|
|
300649
300757
|
const env7 = import_nunjucks.default.configure(template.templatePath, {
|
300650
300758
|
trimBlocks: true,
|
300651
300759
|
autoescape: false,
|
300760
|
+
// Ensures that we are not writing to HTML!
|
300652
300761
|
tags: {
|
300653
300762
|
blockStart: "[#",
|
300654
300763
|
blockEnd: "#]",
|
@@ -301024,6 +301133,7 @@ var textOnlyReplacements2 = {
|
|
301024
301133
|
"\u201C": "``",
|
301025
301134
|
// guillemots
|
301026
301135
|
"\xBB": ">>",
|
301136
|
+
// These could be improved
|
301027
301137
|
"\xAB": "<<",
|
301028
301138
|
"\u2026": "\\dots",
|
301029
301139
|
"\u2013": "--",
|
@@ -301049,9 +301159,13 @@ var arrows = {
|
|
301049
301159
|
};
|
301050
301160
|
var symbols2 = {
|
301051
301161
|
"\u2212": "-",
|
301162
|
+
// minus
|
301052
301163
|
"-": "-",
|
301164
|
+
// hyphen minus
|
301053
301165
|
"\uFE63": "-",
|
301166
|
+
// Small hyphen minus
|
301054
301167
|
"\uFF0D": "-",
|
301168
|
+
// Full-width Hyphen-minus
|
301055
301169
|
"\uFF0B": "+"
|
301056
301170
|
// Full-width Plus
|
301057
301171
|
};
|
@@ -301776,6 +301890,12 @@ var handlers3 = {
|
|
301776
301890
|
mystDirective(node3, state) {
|
301777
301891
|
state.renderChildren(node3, false);
|
301778
301892
|
},
|
301893
|
+
div(node3, state) {
|
301894
|
+
state.renderChildren(node3, false);
|
301895
|
+
},
|
301896
|
+
span(node3, state) {
|
301897
|
+
state.renderChildren(node3, true);
|
301898
|
+
},
|
301779
301899
|
comment(node3, state) {
|
301780
301900
|
var _a6, _b;
|
301781
301901
|
state.ensureNewLine();
|
@@ -302586,9 +302706,13 @@ var arrows2 = {
|
|
302586
302706
|
};
|
302587
302707
|
var symbols3 = {
|
302588
302708
|
"\u2212": "-",
|
302709
|
+
// minus
|
302589
302710
|
"-": "-",
|
302711
|
+
// hyphen minus
|
302590
302712
|
"\uFE63": "-",
|
302713
|
+
// Small hyphen minus
|
302591
302714
|
"\uFF0D": "-",
|
302715
|
+
// Full-width Hyphen-minus
|
302592
302716
|
"\uFF0B": "+"
|
302593
302717
|
// Full-width Plus
|
302594
302718
|
};
|
@@ -303468,7 +303592,7 @@ ${node3.value}
|
|
303468
303592
|
state.write(next ? `#[@${id}]` : `@${id}`);
|
303469
303593
|
},
|
303470
303594
|
citeGroup(node3, state) {
|
303471
|
-
state.renderChildren(node3, 0, " ");
|
303595
|
+
state.renderChildren(node3, 0, { delim: " " });
|
303472
303596
|
},
|
303473
303597
|
cite(node3, state) {
|
303474
303598
|
const needsLabel = !/^[a-zA-Z0-9_\-:.]+$/.test(node3.label);
|
@@ -303502,7 +303626,7 @@ ${node3.value}
|
|
303502
303626
|
state.write("]");
|
303503
303627
|
},
|
303504
303628
|
footnoteDefinition() {
|
303505
|
-
}
|
303629
|
+
},
|
303506
303630
|
// si(node, state) {
|
303507
303631
|
// // state.useMacro('siunitx');
|
303508
303632
|
// if (node.number == null) {
|
@@ -303513,6 +303637,12 @@ ${node3.value}
|
|
303513
303637
|
// );
|
303514
303638
|
// }
|
303515
303639
|
// },
|
303640
|
+
div(node3, state) {
|
303641
|
+
state.renderChildren(node3, 1);
|
303642
|
+
},
|
303643
|
+
span(node3, state) {
|
303644
|
+
state.renderChildren(node3, 0, { trimEnd: false });
|
303645
|
+
}
|
303516
303646
|
};
|
303517
303647
|
var TypstSerializer = class {
|
303518
303648
|
constructor(file, tree, opts) {
|
@@ -303554,7 +303684,7 @@ var TypstSerializer = class {
|
|
303554
303684
|
return;
|
303555
303685
|
this.addNewLine();
|
303556
303686
|
}
|
303557
|
-
renderChildren(node3, trailingNewLines = 0, delim = "") {
|
303687
|
+
renderChildren(node3, trailingNewLines = 0, { delim = "", trimEnd: trimEnd2 = true } = {}) {
|
303558
303688
|
var _a6, _b, _c;
|
303559
303689
|
const numChildren = (_b = (_a6 = node3.children) === null || _a6 === void 0 ? void 0 : _a6.length) !== null && _b !== void 0 ? _b : 0;
|
303560
303690
|
(_c = node3.children) === null || _c === void 0 ? void 0 : _c.forEach((child, index4) => {
|
@@ -303572,7 +303702,8 @@ var TypstSerializer = class {
|
|
303572
303702
|
if (delim && index4 + 1 < numChildren)
|
303573
303703
|
this.write(delim);
|
303574
303704
|
});
|
303575
|
-
|
303705
|
+
if (trimEnd2)
|
303706
|
+
this.trimEnd();
|
303576
303707
|
for (let i2 = trailingNewLines; i2--; )
|
303577
303708
|
this.addNewLine();
|
303578
303709
|
}
|
@@ -307014,6 +307145,7 @@ var JatsDocument = class {
|
|
307014
307145
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
307015
307146
|
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
307016
307147
|
"xmlns:ali": "http://www.niso.org/schemas/ali/1.0/",
|
307148
|
+
// Used for the licensing
|
307017
307149
|
"dtd-version": "1.3",
|
307018
307150
|
"xml:lang": "en"
|
307019
307151
|
};
|
@@ -312707,7 +312839,7 @@ async function currentSiteRoutes(session, host, baseurl, opts) {
|
|
312707
312839
|
};
|
312708
312840
|
}),
|
312709
312841
|
// Download other assets
|
312710
|
-
...["favicon.ico", "robots.txt"].map((asset) => ({
|
312842
|
+
...["favicon.ico", "robots.txt", "myst-theme.css"].map((asset) => ({
|
312711
312843
|
url: `${host}/${asset}`,
|
312712
312844
|
path: asset
|
312713
312845
|
}))
|
@@ -312761,6 +312893,10 @@ async function buildHtml(session, opts) {
|
|
312761
312893
|
const routes = await currentSiteRoutes(session, host, baseurl, opts);
|
312762
312894
|
await Promise.all(routes.map(async (page) => {
|
312763
312895
|
const resp = await session.fetch(page.url);
|
312896
|
+
if (!resp.ok) {
|
312897
|
+
session.log.error(`Error fetching ${page.url}`);
|
312898
|
+
return;
|
312899
|
+
}
|
312764
312900
|
const content3 = await resp.text();
|
312765
312901
|
writeFileToFolder(import_node_path56.default.join(htmlDir, page.path), content3);
|
312766
312902
|
}));
|
mystmd-1.1.56.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
mystmd_py/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
mystmd_py/main.py,sha256=9gXH26VLfflzPV0t9exVsPynO-kBxUPoJGy4VEf1hNQ,1467
|
3
|
-
mystmd_py/myst.cjs,sha256=xyfkt1Ud9cF1I7n_ZO0CVqgMvWVgInLDkYEPS4HqCkk,12828739
|
4
|
-
mystmd-1.1.56.dist-info/METADATA,sha256=j4V9fHL0BjB2gDThh6cppxMvcQZiU20RtfS_QhAOsn0,2969
|
5
|
-
mystmd-1.1.56.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
6
|
-
mystmd-1.1.56.dist-info/entry_points.txt,sha256=eC2ol2gqS2q5E-ktkMrBSvV0tckGUcNGS-c4hEQ-_V4,45
|
7
|
-
mystmd-1.1.56.dist-info/licenses/LICENSE,sha256=vgXlcTOVbxYpGiMuE9NqgguIBXAH0hJAktlaxiyZ2wg,1088
|
8
|
-
mystmd-1.1.56.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|