mystmd 1.3.20__py3-none-any.whl → 1.3.21__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.3.20.dist-info → mystmd-1.3.21.dist-info}/METADATA +1 -1
- mystmd-1.3.21.dist-info/RECORD +9 -0
- mystmd_py/myst.cjs +512 -226
- mystmd-1.3.20.dist-info/RECORD +0 -9
- {mystmd-1.3.20.dist-info → mystmd-1.3.21.dist-info}/WHEEL +0 -0
- {mystmd-1.3.20.dist-info → mystmd-1.3.21.dist-info}/entry_points.txt +0 -0
- {mystmd-1.3.20.dist-info → mystmd-1.3.21.dist-info}/licenses/LICENSE +0 -0
mystmd_py/myst.cjs
CHANGED
@@ -9403,7 +9403,7 @@ var require_es_regexp_constructor = __commonJS({
|
|
9403
9403
|
var length = string2.length;
|
9404
9404
|
var index5 = 0;
|
9405
9405
|
var result = "";
|
9406
|
-
var
|
9406
|
+
var brackets = false;
|
9407
9407
|
var chr;
|
9408
9408
|
for (; index5 <= length; index5++) {
|
9409
9409
|
chr = charAt(string2, index5);
|
@@ -9411,13 +9411,13 @@ var require_es_regexp_constructor = __commonJS({
|
|
9411
9411
|
result += chr + charAt(string2, ++index5);
|
9412
9412
|
continue;
|
9413
9413
|
}
|
9414
|
-
if (!
|
9414
|
+
if (!brackets && chr === ".") {
|
9415
9415
|
result += "[\\s\\S]";
|
9416
9416
|
} else {
|
9417
9417
|
if (chr === "[") {
|
9418
|
-
|
9418
|
+
brackets = true;
|
9419
9419
|
} else if (chr === "]") {
|
9420
|
-
|
9420
|
+
brackets = false;
|
9421
9421
|
}
|
9422
9422
|
result += chr;
|
9423
9423
|
}
|
@@ -9430,7 +9430,7 @@ var require_es_regexp_constructor = __commonJS({
|
|
9430
9430
|
var result = "";
|
9431
9431
|
var named = [];
|
9432
9432
|
var names = {};
|
9433
|
-
var
|
9433
|
+
var brackets = false;
|
9434
9434
|
var ncg = false;
|
9435
9435
|
var groupid = 0;
|
9436
9436
|
var groupname = "";
|
@@ -9440,11 +9440,11 @@ var require_es_regexp_constructor = __commonJS({
|
|
9440
9440
|
if (chr === "\\") {
|
9441
9441
|
chr = chr + charAt(string2, ++index5);
|
9442
9442
|
} else if (chr === "]") {
|
9443
|
-
|
9444
|
-
} else if (!
|
9443
|
+
brackets = false;
|
9444
|
+
} else if (!brackets)
|
9445
9445
|
switch (true) {
|
9446
9446
|
case chr === "[":
|
9447
|
-
|
9447
|
+
brackets = true;
|
9448
9448
|
break;
|
9449
9449
|
case chr === "(":
|
9450
9450
|
if (exec3(IS_NCG, stringSlice(string2, index5 + 1))) {
|
@@ -49636,18 +49636,18 @@ var require_parser3 = __commonJS({
|
|
49636
49636
|
let last = false;
|
49637
49637
|
let open2 = false;
|
49638
49638
|
let params = [];
|
49639
|
-
let
|
49639
|
+
let brackets = [];
|
49640
49640
|
while (!this.tokenizer.endOfFile()) {
|
49641
49641
|
token = this.tokenizer.nextToken();
|
49642
49642
|
type2 = token[0];
|
49643
49643
|
if (type2 === "(" || type2 === "[") {
|
49644
|
-
|
49645
|
-
} else if (type2 === "{" &&
|
49646
|
-
|
49647
|
-
} else if (type2 ===
|
49648
|
-
|
49644
|
+
brackets.push(type2 === "(" ? ")" : "]");
|
49645
|
+
} else if (type2 === "{" && brackets.length > 0) {
|
49646
|
+
brackets.push("}");
|
49647
|
+
} else if (type2 === brackets[brackets.length - 1]) {
|
49648
|
+
brackets.pop();
|
49649
49649
|
}
|
49650
|
-
if (
|
49650
|
+
if (brackets.length === 0) {
|
49651
49651
|
if (type2 === ";") {
|
49652
49652
|
node3.source.end = this.getPosition(token[2]);
|
49653
49653
|
node3.source.end.offset++;
|
@@ -49721,18 +49721,18 @@ var require_parser3 = __commonJS({
|
|
49721
49721
|
);
|
49722
49722
|
}
|
49723
49723
|
colon(tokens) {
|
49724
|
-
let
|
49724
|
+
let brackets = 0;
|
49725
49725
|
let prev, token, type2;
|
49726
49726
|
for (let [i2, element5] of tokens.entries()) {
|
49727
49727
|
token = element5;
|
49728
49728
|
type2 = token[0];
|
49729
49729
|
if (type2 === "(") {
|
49730
|
-
|
49730
|
+
brackets += 1;
|
49731
49731
|
}
|
49732
49732
|
if (type2 === ")") {
|
49733
|
-
|
49733
|
+
brackets -= 1;
|
49734
49734
|
}
|
49735
|
-
if (
|
49735
|
+
if (brackets === 0 && type2 === ":") {
|
49736
49736
|
if (!prev) {
|
49737
49737
|
this.doubleColon(token);
|
49738
49738
|
} else if (prev[0] === "word" && prev[1] === "progid") {
|
@@ -49930,7 +49930,7 @@ var require_parser3 = __commonJS({
|
|
49930
49930
|
let type2 = null;
|
49931
49931
|
let colon = false;
|
49932
49932
|
let bracket = null;
|
49933
|
-
let
|
49933
|
+
let brackets = [];
|
49934
49934
|
let customProperty = start[1].startsWith("--");
|
49935
49935
|
let tokens = [];
|
49936
49936
|
let token = start;
|
@@ -49940,12 +49940,12 @@ var require_parser3 = __commonJS({
|
|
49940
49940
|
if (type2 === "(" || type2 === "[") {
|
49941
49941
|
if (!bracket)
|
49942
49942
|
bracket = token;
|
49943
|
-
|
49943
|
+
brackets.push(type2 === "(" ? ")" : "]");
|
49944
49944
|
} else if (customProperty && colon && type2 === "{") {
|
49945
49945
|
if (!bracket)
|
49946
49946
|
bracket = token;
|
49947
|
-
|
49948
|
-
} else if (
|
49947
|
+
brackets.push("}");
|
49948
|
+
} else if (brackets.length === 0) {
|
49949
49949
|
if (type2 === ";") {
|
49950
49950
|
if (colon) {
|
49951
49951
|
this.decl(tokens, customProperty);
|
@@ -49963,16 +49963,16 @@ var require_parser3 = __commonJS({
|
|
49963
49963
|
} else if (type2 === ":") {
|
49964
49964
|
colon = true;
|
49965
49965
|
}
|
49966
|
-
} else if (type2 ===
|
49967
|
-
|
49968
|
-
if (
|
49966
|
+
} else if (type2 === brackets[brackets.length - 1]) {
|
49967
|
+
brackets.pop();
|
49968
|
+
if (brackets.length === 0)
|
49969
49969
|
bracket = null;
|
49970
49970
|
}
|
49971
49971
|
token = this.tokenizer.nextToken();
|
49972
49972
|
}
|
49973
49973
|
if (this.tokenizer.endOfFile())
|
49974
49974
|
end = true;
|
49975
|
-
if (
|
49975
|
+
if (brackets.length > 0)
|
49976
49976
|
this.unclosedBracket(bracket);
|
49977
49977
|
if (end && colon) {
|
49978
49978
|
if (!customProperty) {
|
@@ -91757,7 +91757,7 @@ var require_lib15 = __commonJS({
|
|
91757
91757
|
const prefix2 = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
91758
91758
|
return prefix2 + join20(pathPart, cmd);
|
91759
91759
|
};
|
91760
|
-
var
|
91760
|
+
var which8 = async (cmd, opt = {}) => {
|
91761
91761
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
91762
91762
|
const found2 = [];
|
91763
91763
|
for (const envPart of pathEnv) {
|
@@ -91805,8 +91805,8 @@ var require_lib15 = __commonJS({
|
|
91805
91805
|
}
|
91806
91806
|
throw getNotFoundError(cmd);
|
91807
91807
|
};
|
91808
|
-
module2.exports =
|
91809
|
-
|
91808
|
+
module2.exports = which8;
|
91809
|
+
which8.sync = whichSync;
|
91810
91810
|
}
|
91811
91811
|
});
|
91812
91812
|
|
@@ -99095,7 +99095,7 @@ var require_p_limit = __commonJS({
|
|
99095
99095
|
"../myst-cli/node_modules/p-limit/index.js"(exports2, module2) {
|
99096
99096
|
"use strict";
|
99097
99097
|
var Queue = require_yocto_queue();
|
99098
|
-
var
|
99098
|
+
var pLimit4 = (concurrency) => {
|
99099
99099
|
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
99100
99100
|
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
99101
99101
|
}
|
@@ -99144,7 +99144,7 @@ var require_p_limit = __commonJS({
|
|
99144
99144
|
});
|
99145
99145
|
return generator;
|
99146
99146
|
};
|
99147
|
-
module2.exports =
|
99147
|
+
module2.exports = pLimit4;
|
99148
99148
|
}
|
99149
99149
|
});
|
99150
99150
|
|
@@ -99351,7 +99351,7 @@ var require_lib16 = __commonJS({
|
|
99351
99351
|
const prefix2 = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
|
99352
99352
|
return prefix2 + join20(pathPart, cmd);
|
99353
99353
|
};
|
99354
|
-
var
|
99354
|
+
var which8 = async (cmd, opt = {}) => {
|
99355
99355
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
99356
99356
|
const found2 = [];
|
99357
99357
|
for (const envPart of pathEnv) {
|
@@ -99399,8 +99399,8 @@ var require_lib16 = __commonJS({
|
|
99399
99399
|
}
|
99400
99400
|
throw getNotFoundError(cmd);
|
99401
99401
|
};
|
99402
|
-
module2.exports =
|
99403
|
-
|
99402
|
+
module2.exports = which8;
|
99403
|
+
which8.sync = whichSync;
|
99404
99404
|
}
|
99405
99405
|
});
|
99406
99406
|
|
@@ -102293,7 +102293,7 @@ var require_parse5 = __commonJS({
|
|
102293
102293
|
const stack = [ast];
|
102294
102294
|
let block5 = ast;
|
102295
102295
|
let prev = ast;
|
102296
|
-
let
|
102296
|
+
let brackets = 0;
|
102297
102297
|
const length = input3.length;
|
102298
102298
|
let index4 = 0;
|
102299
102299
|
let depth = 0;
|
@@ -102329,12 +102329,12 @@ var require_parse5 = __commonJS({
|
|
102329
102329
|
continue;
|
102330
102330
|
}
|
102331
102331
|
if (value === CHAR_LEFT_SQUARE_BRACKET2) {
|
102332
|
-
|
102332
|
+
brackets++;
|
102333
102333
|
let next;
|
102334
102334
|
while (index4 < length && (next = advance())) {
|
102335
102335
|
value += next;
|
102336
102336
|
if (next === CHAR_LEFT_SQUARE_BRACKET2) {
|
102337
|
-
|
102337
|
+
brackets++;
|
102338
102338
|
continue;
|
102339
102339
|
}
|
102340
102340
|
if (next === CHAR_BACKSLASH) {
|
@@ -102342,8 +102342,8 @@ var require_parse5 = __commonJS({
|
|
102342
102342
|
continue;
|
102343
102343
|
}
|
102344
102344
|
if (next === CHAR_RIGHT_SQUARE_BRACKET2) {
|
102345
|
-
|
102346
|
-
if (
|
102345
|
+
brackets--;
|
102346
|
+
if (brackets === 0) {
|
102347
102347
|
break;
|
102348
102348
|
}
|
102349
102349
|
}
|
@@ -132021,7 +132021,7 @@ var require_stringify4 = __commonJS({
|
|
132021
132021
|
var formats = require_formats();
|
132022
132022
|
var has3 = Object.prototype.hasOwnProperty;
|
132023
132023
|
var arrayPrefixGenerators = {
|
132024
|
-
brackets: function
|
132024
|
+
brackets: function brackets(prefix2) {
|
132025
132025
|
return prefix2 + "[]";
|
132026
132026
|
},
|
132027
132027
|
comma: "comma",
|
@@ -132421,9 +132421,9 @@ var require_parse6 = __commonJS({
|
|
132421
132421
|
return;
|
132422
132422
|
}
|
132423
132423
|
var key2 = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
|
132424
|
-
var
|
132424
|
+
var brackets = /(\[[^[\]]*])/;
|
132425
132425
|
var child = /(\[[^[\]]*])/g;
|
132426
|
-
var segment = options.depth > 0 &&
|
132426
|
+
var segment = options.depth > 0 && brackets.exec(key2);
|
132427
132427
|
var parent2 = segment ? key2.slice(0, segment.index) : key2;
|
132428
132428
|
var keys2 = [];
|
132429
132429
|
if (parent2) {
|
@@ -193891,7 +193891,7 @@ var {
|
|
193891
193891
|
} = import_index.default;
|
193892
193892
|
|
193893
193893
|
// src/version.ts
|
193894
|
-
var version = "1.3.
|
193894
|
+
var version = "1.3.21";
|
193895
193895
|
var version_default = version;
|
193896
193896
|
|
193897
193897
|
// ../myst-cli/dist/build/build.js
|
@@ -194751,7 +194751,7 @@ function validateAndStashObject(input3, stash, kind, validateFn, opts) {
|
|
194751
194751
|
}
|
194752
194752
|
|
194753
194753
|
// ../../node_modules/doi-utils/dist/validatePart.js
|
194754
|
-
var DOI_VALIDATION_PATTERN = /^10
|
194754
|
+
var DOI_VALIDATION_PATTERN = /^10\.\d{4,9}\/[-._;()/:A-Z0-9]+$/i;
|
194755
194755
|
function validatePart(possibleDOI) {
|
194756
194756
|
if (!possibleDOI)
|
194757
194757
|
return false;
|
@@ -195576,6 +195576,7 @@ var PROJECT_AND_PAGE_FRONTMATTER_KEYS = [
|
|
195576
195576
|
"downloads",
|
195577
195577
|
"settings",
|
195578
195578
|
// We maybe want to move this into site frontmatter in the future
|
195579
|
+
"edit_url",
|
195579
195580
|
...KNOWN_EXTERNAL_IDENTIFIERS,
|
195580
195581
|
// Do not add any project specific keys here!
|
195581
195582
|
...SITE_FRONTMATTER_KEYS
|
@@ -195599,8 +195600,9 @@ var PAGE_FRONTMATTER_KEYS = [
|
|
195599
195600
|
"kernelspec",
|
195600
195601
|
"jupytext",
|
195601
195602
|
"tags",
|
195602
|
-
"
|
195603
|
-
"
|
195603
|
+
"site",
|
195604
|
+
"enumerator",
|
195605
|
+
"content_includes_title"
|
195604
195606
|
];
|
195605
195607
|
|
195606
195608
|
// ../myst-frontmatter/dist/exports/types.js
|
@@ -198710,7 +198712,7 @@ function simplifyLicenses(licenses2) {
|
|
198710
198712
|
}
|
198711
198713
|
|
198712
198714
|
// ../myst-frontmatter/dist/numbering/validators.js
|
198713
|
-
var NUMBERING_OPTIONS = ["enumerator", "all", "headings"];
|
198715
|
+
var NUMBERING_OPTIONS = ["enumerator", "all", "headings", "title"];
|
198714
198716
|
var HEADING_KEYS = ["heading_1", "heading_2", "heading_3", "heading_4", "heading_5", "heading_6"];
|
198715
198717
|
var NUMBERING_KEYS = [
|
198716
198718
|
"figure",
|
@@ -198721,7 +198723,8 @@ var NUMBERING_KEYS = [
|
|
198721
198723
|
"code",
|
198722
198724
|
...HEADING_KEYS
|
198723
198725
|
];
|
198724
|
-
var NUMBERING_ITEM_KEYS = ["enabled", "start", "template"];
|
198726
|
+
var NUMBERING_ITEM_KEYS = ["enabled", "start", "enumerator", "template", "continue"];
|
198727
|
+
var CONTINUE_STRINGS = ["continue", "next"];
|
198725
198728
|
var NUMBERING_ALIAS = {
|
198726
198729
|
sections: "headings",
|
198727
198730
|
h1: "heading_1",
|
@@ -198735,7 +198738,13 @@ var NUMBERING_ALIAS = {
|
|
198735
198738
|
heading3: "heading_3",
|
198736
198739
|
heading4: "heading_4",
|
198737
198740
|
heading5: "heading_5",
|
198738
|
-
heading6: "heading_6"
|
198741
|
+
heading6: "heading_6",
|
198742
|
+
figures: "figure",
|
198743
|
+
subfigures: "subfigure",
|
198744
|
+
equations: "equation",
|
198745
|
+
subequations: "subequation",
|
198746
|
+
tables: "table",
|
198747
|
+
titles: "title"
|
198739
198748
|
};
|
198740
198749
|
function isBoolean(input3) {
|
198741
198750
|
if (typeof input3 === "string") {
|
@@ -198744,11 +198753,13 @@ function isBoolean(input3) {
|
|
198744
198753
|
return typeof input3 === "boolean";
|
198745
198754
|
}
|
198746
198755
|
function validateNumberingItem(input3, opts) {
|
198747
|
-
var _a6, _b;
|
198756
|
+
var _a6, _b, _c, _d2, _e;
|
198748
198757
|
if (isBoolean(input3)) {
|
198749
198758
|
input3 = { enabled: input3 };
|
198750
198759
|
} else if (typeof input3 === "number") {
|
198751
198760
|
input3 = { start: input3 };
|
198761
|
+
} else if (CONTINUE_STRINGS.includes(input3)) {
|
198762
|
+
input3 = { continue: true };
|
198752
198763
|
} else if (typeof input3 === "string") {
|
198753
198764
|
input3 = { template: input3 };
|
198754
198765
|
}
|
@@ -198762,20 +198773,78 @@ function validateNumberingItem(input3, opts) {
|
|
198762
198773
|
output2.enabled = enabled;
|
198763
198774
|
}
|
198764
198775
|
if (defined(value.start)) {
|
198765
|
-
|
198766
|
-
|
198767
|
-
integer: true,
|
198768
|
-
min: 1
|
198769
|
-
});
|
198770
|
-
if (start) {
|
198771
|
-
output2.start = start;
|
198776
|
+
if (CONTINUE_STRINGS.includes(value.start) && !defined(value.continue)) {
|
198777
|
+
output2.continue = true;
|
198772
198778
|
output2.enabled = (_a6 = output2.enabled) !== null && _a6 !== void 0 ? _a6 : true;
|
198779
|
+
} else {
|
198780
|
+
const start = validateNumber(value.start, {
|
198781
|
+
...incrementOptions("start", opts),
|
198782
|
+
integer: true,
|
198783
|
+
min: 1
|
198784
|
+
});
|
198785
|
+
if (start) {
|
198786
|
+
output2.start = start;
|
198787
|
+
output2.enabled = (_b = output2.enabled) !== null && _b !== void 0 ? _b : true;
|
198788
|
+
}
|
198773
198789
|
}
|
198774
198790
|
}
|
198775
198791
|
if (defined(value.template)) {
|
198776
198792
|
const template = validateString(value.template, incrementOptions("template", opts));
|
198777
198793
|
if (defined(template)) {
|
198778
198794
|
output2.template = template;
|
198795
|
+
output2.enabled = (_c = output2.enabled) !== null && _c !== void 0 ? _c : true;
|
198796
|
+
}
|
198797
|
+
}
|
198798
|
+
if (defined(value.enumerator)) {
|
198799
|
+
const enumerator = validateString(value.enumerator, incrementOptions("enumerator", opts));
|
198800
|
+
if (defined(enumerator)) {
|
198801
|
+
output2.enumerator = enumerator;
|
198802
|
+
output2.enabled = (_d2 = output2.enabled) !== null && _d2 !== void 0 ? _d2 : true;
|
198803
|
+
}
|
198804
|
+
}
|
198805
|
+
if (defined(value.continue)) {
|
198806
|
+
const cont = validateBoolean(value.continue, incrementOptions("continue", opts));
|
198807
|
+
if (defined(cont)) {
|
198808
|
+
output2.continue = cont;
|
198809
|
+
output2.enabled = (_e = output2.enabled) !== null && _e !== void 0 ? _e : true;
|
198810
|
+
}
|
198811
|
+
}
|
198812
|
+
if (Object.keys(output2).length === 0)
|
198813
|
+
return void 0;
|
198814
|
+
return output2;
|
198815
|
+
}
|
198816
|
+
function validateTitleItem(input3, opts) {
|
198817
|
+
var _a6, _b;
|
198818
|
+
if (isBoolean(input3)) {
|
198819
|
+
input3 = { enabled: input3 };
|
198820
|
+
} else if (typeof input3 === "number") {
|
198821
|
+
input3 = { offset: input3 };
|
198822
|
+
}
|
198823
|
+
const value = validateObjectKeys(input3, { optional: ["enabled", "offset", "enumerator"] }, opts);
|
198824
|
+
if (value === void 0)
|
198825
|
+
return void 0;
|
198826
|
+
const output2 = {};
|
198827
|
+
if (defined(value.enabled)) {
|
198828
|
+
const enabled = validateBoolean(value.enabled, incrementOptions("enabled", opts));
|
198829
|
+
if (defined(enabled))
|
198830
|
+
output2.enabled = enabled;
|
198831
|
+
}
|
198832
|
+
if (defined(value.offset)) {
|
198833
|
+
const offset = validateNumber(value.offset, {
|
198834
|
+
integer: true,
|
198835
|
+
min: 0,
|
198836
|
+
max: 5,
|
198837
|
+
...incrementOptions("offset", opts)
|
198838
|
+
});
|
198839
|
+
if (defined(offset)) {
|
198840
|
+
output2.offset = offset;
|
198841
|
+
output2.enabled = (_a6 = output2.enabled) !== null && _a6 !== void 0 ? _a6 : true;
|
198842
|
+
}
|
198843
|
+
}
|
198844
|
+
if (defined(value.enumerator)) {
|
198845
|
+
const enumerator = validateString(value.enumerator, incrementOptions("enumerator", opts));
|
198846
|
+
if (defined(enumerator)) {
|
198847
|
+
output2.enumerator = enumerator;
|
198779
198848
|
output2.enabled = (_b = output2.enabled) !== null && _b !== void 0 ? _b : true;
|
198780
198849
|
}
|
198781
198850
|
}
|
@@ -198784,7 +198853,7 @@ function validateNumberingItem(input3, opts) {
|
|
198784
198853
|
return output2;
|
198785
198854
|
}
|
198786
198855
|
function validateNumbering(input3, opts) {
|
198787
|
-
var _a6, _b, _c, _d2;
|
198856
|
+
var _a6, _b, _c, _d2, _e;
|
198788
198857
|
if (isBoolean(input3)) {
|
198789
198858
|
input3 = { all: input3 };
|
198790
198859
|
}
|
@@ -198795,6 +198864,9 @@ function validateNumbering(input3, opts) {
|
|
198795
198864
|
let headings;
|
198796
198865
|
if (defined(value.enumerator)) {
|
198797
198866
|
const enumeratorOpts = incrementOptions("enumerator", opts);
|
198867
|
+
if (typeof value.enumerator === "string") {
|
198868
|
+
value.enumerator = { enumerator: value.enumerator };
|
198869
|
+
}
|
198798
198870
|
output2.enumerator = validateNumberingItem(value.enumerator, enumeratorOpts);
|
198799
198871
|
if (((_a6 = output2.enumerator) === null || _a6 === void 0 ? void 0 : _a6.enabled) != null) {
|
198800
198872
|
if (output2.enumerator.enabled !== true) {
|
@@ -198806,18 +198878,31 @@ function validateNumbering(input3, opts) {
|
|
198806
198878
|
validationWarning("value for 'start' is ignored", enumeratorOpts);
|
198807
198879
|
delete output2.enumerator.start;
|
198808
198880
|
}
|
198881
|
+
if (((_c = output2.enumerator) === null || _c === void 0 ? void 0 : _c.continue) != null) {
|
198882
|
+
validationWarning("value for 'continue' is ignored", enumeratorOpts);
|
198883
|
+
delete output2.enumerator.continue;
|
198884
|
+
}
|
198885
|
+
if (!output2.enumerator || Object.keys(output2.enumerator).length === 0) {
|
198886
|
+
delete output2.enumerator;
|
198887
|
+
}
|
198809
198888
|
}
|
198810
198889
|
if (defined(value.all)) {
|
198811
198890
|
const allOpts = incrementOptions("all", opts);
|
198812
198891
|
output2.all = validateNumberingItem(value.all, allOpts);
|
198813
|
-
if (((
|
198892
|
+
if (((_d2 = output2.all) === null || _d2 === void 0 ? void 0 : _d2.template) != null) {
|
198814
198893
|
validationWarning("value for 'template' is ignored", allOpts);
|
198815
198894
|
delete output2.all.template;
|
198816
198895
|
}
|
198817
|
-
if (((
|
198896
|
+
if (((_e = output2.all) === null || _e === void 0 ? void 0 : _e.start) != null) {
|
198818
198897
|
validationWarning("value for 'start' is ignored", allOpts);
|
198819
198898
|
delete output2.all.start;
|
198820
198899
|
}
|
198900
|
+
if (!output2.all || Object.keys(output2.all).length === 0) {
|
198901
|
+
delete output2.all;
|
198902
|
+
}
|
198903
|
+
}
|
198904
|
+
if (defined(value.title)) {
|
198905
|
+
output2.title = validateTitleItem(value.title, incrementOptions("title", opts));
|
198821
198906
|
}
|
198822
198907
|
if (defined(value.headings)) {
|
198823
198908
|
headings = validateNumberingItem(value.headings, incrementOptions("headings", opts));
|
@@ -198846,11 +198931,15 @@ function validateNumbering(input3, opts) {
|
|
198846
198931
|
function fillNumbering(base5, filler) {
|
198847
198932
|
const output2 = { ...filler, ...base5 };
|
198848
198933
|
Object.entries(filler !== null && filler !== void 0 ? filler : {}).filter(([key2]) => !NUMBERING_OPTIONS.includes(key2)).forEach(([key2, val]) => {
|
198849
|
-
var _a6, _b, _c;
|
198934
|
+
var _a6, _b, _c, _d2, _e;
|
198850
198935
|
output2[key2] = fillMissingKeys(
|
198851
198936
|
(_a6 = base5 === null || base5 === void 0 ? void 0 : base5[key2]) !== null && _a6 !== void 0 ? _a6 : {},
|
198852
198937
|
// Enabling/disabling all in base overrides filler
|
198853
|
-
{
|
198938
|
+
{
|
198939
|
+
...val,
|
198940
|
+
enabled: (_c = (_b = base5 === null || base5 === void 0 ? void 0 : base5.all) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : val.enabled,
|
198941
|
+
continue: (_e = (_d2 = base5 === null || base5 === void 0 ? void 0 : base5.all) === null || _d2 === void 0 ? void 0 : _d2.continue) !== null && _e !== void 0 ? _e : val.continue
|
198942
|
+
},
|
198854
198943
|
NUMBERING_ITEM_KEYS
|
198855
198944
|
);
|
198856
198945
|
});
|
@@ -199521,6 +199610,11 @@ function validateProjectAndPageFrontmatterKeys(value, opts) {
|
|
199521
199610
|
if (settings)
|
199522
199611
|
output2.settings = settings;
|
199523
199612
|
}
|
199613
|
+
if (value.edit_url === null) {
|
199614
|
+
output2.edit_url = null;
|
199615
|
+
} else if (defined(value.edit_url)) {
|
199616
|
+
output2.edit_url = validateUrl(value.edit_url, incrementOptions("edit_url", opts));
|
199617
|
+
}
|
199524
199618
|
return output2;
|
199525
199619
|
}
|
199526
199620
|
function validateProjectFrontmatterKeys(value, opts) {
|
@@ -199597,6 +199691,9 @@ function validatePageFrontmatterKeys(value, opts) {
|
|
199597
199691
|
if (defined(value.jupytext)) {
|
199598
199692
|
output2.jupytext = validateJupytext(value.jupytext, incrementOptions("jupytext", opts));
|
199599
199693
|
}
|
199694
|
+
if (defined(value.enumerator)) {
|
199695
|
+
output2.enumerator = validateString(value.enumerator, incrementOptions("enumerator", opts));
|
199696
|
+
}
|
199600
199697
|
if (defined(value.content_includes_title)) {
|
199601
199698
|
output2.content_includes_title = validateBoolean(value.content_includes_title, incrementOptions("content_includes_title", opts));
|
199602
199699
|
}
|
@@ -204555,7 +204652,14 @@ var visit = (
|
|
204555
204652
|
|
204556
204653
|
// ../myst-common/dist/selectNodes.js
|
204557
204654
|
function isTargetIdentifierNode(node3) {
|
204558
|
-
const nonTargetTypes = [
|
204655
|
+
const nonTargetTypes = [
|
204656
|
+
"crossReference",
|
204657
|
+
"cite",
|
204658
|
+
"footnoteDefinition",
|
204659
|
+
"footnoteReference",
|
204660
|
+
"captionNumber",
|
204661
|
+
"link"
|
204662
|
+
];
|
204559
204663
|
return !nonTargetTypes.includes(node3.type);
|
204560
204664
|
}
|
204561
204665
|
var hiddenNodes = /* @__PURE__ */ new Set(["comment", "mystComment"]);
|
@@ -238821,12 +238925,12 @@ var DEFAULT_NUMBERING = {
|
|
238821
238925
|
subfigure: { enabled: true, template: "Figure\xA0%s" },
|
238822
238926
|
table: { enabled: true, template: "Table\xA0%s" },
|
238823
238927
|
code: { enabled: true, template: "Program\xA0%s" },
|
238824
|
-
heading_1: {
|
238825
|
-
heading_2: {
|
238826
|
-
heading_3: {
|
238827
|
-
heading_4: {
|
238828
|
-
heading_5: {
|
238829
|
-
heading_6: {
|
238928
|
+
heading_1: { template: "Section\xA0%s" },
|
238929
|
+
heading_2: { template: "Section\xA0%s" },
|
238930
|
+
heading_3: { template: "Section\xA0%s" },
|
238931
|
+
heading_4: { template: "Section\xA0%s" },
|
238932
|
+
heading_5: { template: "Section\xA0%s" },
|
238933
|
+
heading_6: { template: "Section\xA0%s" }
|
238830
238934
|
};
|
238831
238935
|
function getDefaultNumberedReferenceTemplate(kind) {
|
238832
238936
|
if (kind === "code")
|
@@ -238847,17 +238951,17 @@ function getDefaultNamedReferenceTemplate(kind = "unknown", hasTitle) {
|
|
238847
238951
|
return name3;
|
238848
238952
|
}
|
238849
238953
|
}
|
238850
|
-
function getReferenceTemplate(target, numbering, numbered2, hasTitle) {
|
238851
|
-
var _a6, _b, _c;
|
238954
|
+
function getReferenceTemplate(target, numbering, numbered2, hasTitle, offset) {
|
238955
|
+
var _a6, _b, _c, _d2;
|
238852
238956
|
const { kind, node: node3 } = target;
|
238853
238957
|
let template;
|
238854
238958
|
if (numbered2) {
|
238855
238959
|
if (kind === TargetKind.heading && node3.type === "heading") {
|
238856
|
-
template = (
|
238960
|
+
template = (_b = numbering[`heading_${node3.depth - (((_a6 = numbering === null || numbering === void 0 ? void 0 : numbering.title) === null || _a6 === void 0 ? void 0 : _a6.enabled) ? 0 : 1) + (offset !== null && offset !== void 0 ? offset : 0)}`]) === null || _b === void 0 ? void 0 : _b.template;
|
238857
238961
|
} else if (node3.subcontainer) {
|
238858
|
-
template = (
|
238962
|
+
template = (_c = numbering.subfigure) === null || _c === void 0 ? void 0 : _c.template;
|
238859
238963
|
} else {
|
238860
|
-
template = (
|
238964
|
+
template = (_d2 = numbering[kind]) === null || _d2 === void 0 ? void 0 : _d2.template;
|
238861
238965
|
}
|
238862
238966
|
return template !== null && template !== void 0 ? template : getDefaultNumberedReferenceTemplate(kind);
|
238863
238967
|
}
|
@@ -238926,17 +239030,17 @@ function kindFromNode2(node3) {
|
|
238926
239030
|
return `${node3.type}:${node3.kind}`;
|
238927
239031
|
return node3.type;
|
238928
239032
|
}
|
238929
|
-
function
|
238930
|
-
var _a6, _b, _c, _d2, _e, _f, _g, _h;
|
239033
|
+
function shouldEnumerateNode(node3, kind, numbering, offset) {
|
239034
|
+
var _a6, _b, _c, _d2, _e, _f, _g, _h, _j;
|
238931
239035
|
if (node3.enumerated != null)
|
238932
239036
|
return node3.enumerated;
|
238933
239037
|
const enabledDefault = (_b = (_a6 = numbering.all) === null || _a6 === void 0 ? void 0 : _a6.enabled) !== null && _b !== void 0 ? _b : false;
|
238934
239038
|
if (kind === "heading" && node3.type === "heading") {
|
238935
|
-
return (
|
239039
|
+
return (_e = (_d2 = numbering[`heading_${node3.depth - (((_c = numbering === null || numbering === void 0 ? void 0 : numbering.title) === null || _c === void 0 ? void 0 : _c.enabled) ? 0 : 1) + (offset !== null && offset !== void 0 ? offset : 0)}`]) === null || _d2 === void 0 ? void 0 : _d2.enabled) !== null && _e !== void 0 ? _e : enabledDefault;
|
238936
239040
|
}
|
238937
239041
|
if (node3.subcontainer)
|
238938
|
-
return (
|
238939
|
-
return (
|
239042
|
+
return (_g = (_f = numbering.subfigure) === null || _f === void 0 ? void 0 : _f.enabled) !== null && _g !== void 0 ? _g : enabledDefault;
|
239043
|
+
return (_j = (_h = numbering[kind]) === null || _h === void 0 ? void 0 : _h.enabled) !== null && _j !== void 0 ? _j : enabledDefault;
|
238940
239044
|
}
|
238941
239045
|
function incrementHeadingCounts2(depth, counts) {
|
238942
239046
|
const incrementIndex = depth - 1;
|
@@ -238957,19 +239061,28 @@ function formatHeadingEnumerator2(counts, prefix2) {
|
|
238957
239061
|
const out = prefix2 ? prefix2.replace(/%s/g, String(enumerator)) : String(enumerator);
|
238958
239062
|
return out;
|
238959
239063
|
}
|
238960
|
-
function initializeTargetCounts(numbering,
|
238961
|
-
|
238962
|
-
|
238963
|
-
|
238964
|
-
|
238965
|
-
const
|
238966
|
-
|
238967
|
-
|
238968
|
-
|
238969
|
-
|
238970
|
-
|
239064
|
+
function initializeTargetCounts(numbering, previousCounts, offset) {
|
239065
|
+
const heading6 = [1, 2, 3, 4, 5, 6].map((depth, ind) => {
|
239066
|
+
var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l;
|
239067
|
+
const cont = (_d2 = (_b = (_a6 = numbering[`heading_${depth}`]) === null || _a6 === void 0 ? void 0 : _a6.continue) !== null && _b !== void 0 ? _b : (_c = numbering.all) === null || _c === void 0 ? void 0 : _c.continue) !== null && _d2 !== void 0 ? _d2 : false;
|
239068
|
+
const enabled = (_h = (_f = (_e = numbering[`heading_${depth}`]) === null || _e === void 0 ? void 0 : _e.enabled) !== null && _f !== void 0 ? _f : (_g = numbering.all) === null || _g === void 0 ? void 0 : _g.enabled) !== null && _h !== void 0 ? _h : true;
|
239069
|
+
const prevCount = (_j = previousCounts === null || previousCounts === void 0 ? void 0 : previousCounts.heading) === null || _j === void 0 ? void 0 : _j[ind];
|
239070
|
+
if (cont && enabled && prevCount !== void 0) {
|
239071
|
+
return prevCount;
|
239072
|
+
}
|
239073
|
+
if (((_k = numbering.title) === null || _k === void 0 ? void 0 : _k.enabled) && depth - 1 <= (offset !== null && offset !== void 0 ? offset : 0) && prevCount != null) {
|
239074
|
+
return prevCount;
|
239075
|
+
}
|
239076
|
+
if (!((_l = numbering.title) === null || _l === void 0 ? void 0 : _l.enabled) && depth <= (offset !== null && offset !== void 0 ? offset : 0)) {
|
239077
|
+
return null;
|
239078
|
+
}
|
239079
|
+
return 0;
|
239080
|
+
});
|
238971
239081
|
const targetCounts = { heading: heading6 };
|
238972
|
-
Object.entries(
|
239082
|
+
Object.entries(previousCounts !== null && previousCounts !== void 0 ? previousCounts : {}).filter(([key2]) => key2 !== "heading").filter(([key2]) => {
|
239083
|
+
var _a6, _b;
|
239084
|
+
return !numbering[key2] || ((_a6 = numbering[key2]) === null || _a6 === void 0 ? void 0 : _a6.continue) || ((_b = numbering.all) === null || _b === void 0 ? void 0 : _b.continue);
|
239085
|
+
}).forEach(([key2, val]) => {
|
238973
239086
|
targetCounts[key2] = { ...val };
|
238974
239087
|
});
|
238975
239088
|
Object.entries(numbering).forEach(([key2, val]) => {
|
@@ -238988,24 +239101,28 @@ function initializeTargetCounts(numbering, initialCounts, tree) {
|
|
238988
239101
|
}
|
238989
239102
|
var ReferenceState = class {
|
238990
239103
|
constructor(filePath, opts) {
|
238991
|
-
var _a6, _b;
|
238992
|
-
this.numbering = fillNumbering(opts === null || opts === void 0 ? void 0 : opts.numbering, DEFAULT_NUMBERING);
|
238993
|
-
this.
|
238994
|
-
this.targetCounts = initializeTargetCounts(this.numbering, this.
|
238995
|
-
this.
|
239104
|
+
var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
239105
|
+
this.numbering = fillNumbering((_a6 = opts === null || opts === void 0 ? void 0 : opts.frontmatter) === null || _a6 === void 0 ? void 0 : _a6.numbering, DEFAULT_NUMBERING);
|
239106
|
+
this.offset = (_d2 = (_c = (_b = this.numbering) === null || _b === void 0 ? void 0 : _b.title) === null || _c === void 0 ? void 0 : _c.offset) !== null && _d2 !== void 0 ? _d2 : 0;
|
239107
|
+
this.targetCounts = initializeTargetCounts(this.numbering, opts === null || opts === void 0 ? void 0 : opts.previousCounts, this.offset);
|
239108
|
+
if ((((_e = this.numbering.title) === null || _e === void 0 ? void 0 : _e.enabled) || ((_f = this.numbering.all) === null || _f === void 0 ? void 0 : _f.enabled)) && !((_g = opts === null || opts === void 0 ? void 0 : opts.frontmatter) === null || _g === void 0 ? void 0 : _g.content_includes_title) && ((_h = this.numbering[`heading_${this.offset + 1}`]) === null || _h === void 0 ? void 0 : _h.enabled) !== false) {
|
239109
|
+
this.targetCounts.heading = incrementHeadingCounts2(this.offset + 1, this.targetCounts.heading);
|
239110
|
+
this.enumerator = formatHeadingEnumerator2(this.targetCounts.heading, (_k = (_j = this.numbering.title) === null || _j === void 0 ? void 0 : _j.enumerator) !== null && _k !== void 0 ? _k : (_l = this.numbering.enumerator) === null || _l === void 0 ? void 0 : _l.enumerator);
|
239111
|
+
}
|
239112
|
+
this.identifiers = (_m = opts === null || opts === void 0 ? void 0 : opts.identifiers) !== null && _m !== void 0 ? _m : [];
|
238996
239113
|
this.targets = {};
|
238997
|
-
this.vfile = (
|
239114
|
+
this.vfile = (_o = opts === null || opts === void 0 ? void 0 : opts.vfile) !== null && _o !== void 0 ? _o : new VFile();
|
238998
239115
|
this.filePath = filePath;
|
238999
239116
|
this.url = opts === null || opts === void 0 ? void 0 : opts.url;
|
239000
239117
|
this.dataUrl = opts === null || opts === void 0 ? void 0 : opts.dataUrl;
|
239001
|
-
this.title = opts === null || opts === void 0 ? void 0 : opts.title;
|
239118
|
+
this.title = (_p = opts === null || opts === void 0 ? void 0 : opts.frontmatter) === null || _p === void 0 ? void 0 : _p.title;
|
239002
239119
|
}
|
239003
239120
|
addTarget(node3) {
|
239004
239121
|
if (!isTargetIdentifierNode(node3))
|
239005
239122
|
return;
|
239006
239123
|
const kind = kindFromNode2(node3);
|
239007
|
-
const numberNode =
|
239008
|
-
if (numberNode
|
239124
|
+
const numberNode = shouldEnumerateNode(node3, kind, this.numbering, this.offset);
|
239125
|
+
if (numberNode) {
|
239009
239126
|
this.incrementCount(node3, kind);
|
239010
239127
|
}
|
239011
239128
|
if (!node3.html_id) {
|
@@ -239030,8 +239147,10 @@ var ReferenceState = class {
|
|
239030
239147
|
kind
|
239031
239148
|
};
|
239032
239149
|
}
|
239033
|
-
|
239034
|
-
|
239150
|
+
resolveEnumerator(val, enumerator) {
|
239151
|
+
var _a6;
|
239152
|
+
const prefix2 = enumerator !== null && enumerator !== void 0 ? enumerator : (_a6 = this.numbering.enumerator) === null || _a6 === void 0 ? void 0 : _a6.enumerator;
|
239153
|
+
return prefix2 ? prefix2.replace(/%s/g, String(val)) : String(val);
|
239035
239154
|
}
|
239036
239155
|
/**
|
239037
239156
|
* Increment target count state for container/equation nodes
|
@@ -239041,38 +239160,33 @@ var ReferenceState = class {
|
|
239041
239160
|
* If node is subcontainer/subequation, a sub-count is incremented
|
239042
239161
|
*/
|
239043
239162
|
incrementCount(node3, kind) {
|
239044
|
-
var _a6, _b;
|
239045
|
-
var
|
239163
|
+
var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l;
|
239164
|
+
var _m;
|
239046
239165
|
if (node3.enumerator) {
|
239047
239166
|
return node3.enumerator;
|
239048
239167
|
}
|
239049
239168
|
let enumerator;
|
239050
239169
|
if (kind === TargetKind.heading && node3.type === "heading") {
|
239051
|
-
this.targetCounts.heading = incrementHeadingCounts2(node3.depth, this.targetCounts.heading);
|
239052
|
-
enumerator = formatHeadingEnumerator2(this.targetCounts.heading, (
|
239170
|
+
this.targetCounts.heading = incrementHeadingCounts2(node3.depth - (((_b = (_a6 = this.numbering) === null || _a6 === void 0 ? void 0 : _a6.title) === null || _b === void 0 ? void 0 : _b.enabled) ? 0 : 1) + this.offset, this.targetCounts.heading);
|
239171
|
+
enumerator = formatHeadingEnumerator2(this.targetCounts.heading, (_f = (_e = this.numbering[`heading_${node3.depth - (((_d2 = (_c = this.numbering) === null || _c === void 0 ? void 0 : _c.title) === null || _d2 === void 0 ? void 0 : _d2.enabled) ? 0 : 1) + this.offset}`]) === null || _e === void 0 ? void 0 : _e.enumerator) !== null && _f !== void 0 ? _f : (_g = this.numbering.enumerator) === null || _g === void 0 ? void 0 : _g.enumerator);
|
239053
239172
|
node3.enumerator = enumerator;
|
239054
239173
|
return enumerator;
|
239055
239174
|
}
|
239056
|
-
const resolveEnumerator = (val) => {
|
239057
|
-
var _a7;
|
239058
|
-
const prefix2 = (_a7 = this.numbering.enumerator) === null || _a7 === void 0 ? void 0 : _a7.template;
|
239059
|
-
return prefix2 ? prefix2.replace(/%s/g, String(val)) : String(val);
|
239060
|
-
};
|
239061
239175
|
const countKind = kind === TargetKind.subequation ? TargetKind.equation : kind;
|
239062
|
-
(
|
239176
|
+
(_h = (_m = this.targetCounts)[countKind]) !== null && _h !== void 0 ? _h : _m[countKind] = { main: 0, sub: 0 };
|
239063
239177
|
if (node3.subcontainer || kind === TargetKind.subequation) {
|
239064
239178
|
this.targetCounts[countKind].sub += 1;
|
239065
239179
|
const letter = String.fromCharCode((this.targetCounts[countKind].sub - 1) % 26 + "a".charCodeAt(0));
|
239066
239180
|
if (node3.subcontainer) {
|
239067
|
-
node3.parentEnumerator = resolveEnumerator(this.targetCounts[countKind].main);
|
239181
|
+
node3.parentEnumerator = this.resolveEnumerator(this.targetCounts[countKind].main, (_j = this.numbering[countKind]) === null || _j === void 0 ? void 0 : _j.enumerator);
|
239068
239182
|
enumerator = letter;
|
239069
239183
|
} else {
|
239070
|
-
enumerator = resolveEnumerator(this.targetCounts[countKind].main + letter);
|
239184
|
+
enumerator = this.resolveEnumerator(this.targetCounts[countKind].main + letter, (_k = this.numbering[countKind]) === null || _k === void 0 ? void 0 : _k.enumerator);
|
239071
239185
|
}
|
239072
239186
|
} else {
|
239073
239187
|
this.targetCounts[kind].main += 1;
|
239074
239188
|
this.targetCounts[kind].sub = 0;
|
239075
|
-
enumerator = resolveEnumerator(this.targetCounts[kind].main);
|
239189
|
+
enumerator = this.resolveEnumerator(this.targetCounts[kind].main, (_l = this.numbering[kind]) === null || _l === void 0 ? void 0 : _l.enumerator);
|
239076
239190
|
}
|
239077
239191
|
node3.enumerator = enumerator;
|
239078
239192
|
return enumerator;
|
@@ -239121,17 +239235,17 @@ var ReferenceState = class {
|
|
239121
239235
|
return;
|
239122
239236
|
}
|
239123
239237
|
node3.kind = target.kind;
|
239124
|
-
addChildrenFromTargetNode(node3, target.node, this.numbering, this.vfile);
|
239238
|
+
addChildrenFromTargetNode(node3, target.node, this.numbering, this.vfile, this.offset);
|
239125
239239
|
}
|
239126
239240
|
};
|
239127
|
-
function addChildrenFromTargetNode(node3, targetNode, numbering, vfile2) {
|
239241
|
+
function addChildrenFromTargetNode(node3, targetNode, numbering, vfile2, offset) {
|
239128
239242
|
var _a6, _b, _c, _d2, _e;
|
239129
239243
|
numbering = fillNumbering(numbering, DEFAULT_NUMBERING);
|
239130
239244
|
const kind = kindFromNode2(targetNode);
|
239131
239245
|
const noNodeChildren = !((_a6 = node3.children) === null || _a6 === void 0 ? void 0 : _a6.length);
|
239132
239246
|
if (kind === TargetKind.heading) {
|
239133
|
-
const numberHeading =
|
239134
|
-
const template = getReferenceTemplate({ node: targetNode, kind }, numbering, numberHeading, true);
|
239247
|
+
const numberHeading = shouldEnumerateNode(targetNode, TargetKind.heading, numbering);
|
239248
|
+
const template = getReferenceTemplate({ node: targetNode, kind }, numbering, numberHeading, true, offset);
|
239135
239249
|
fillReferenceEnumerators2(vfile2, node3, template, targetNode, copyNode(targetNode).children);
|
239136
239250
|
} else {
|
239137
239251
|
const caption3 = select("caption", targetNode) || select("admonitionTitle", targetNode) || select("definitionTerm", targetNode);
|
@@ -239140,7 +239254,7 @@ function addChildrenFromTargetNode(node3, targetNode, numbering, vfile2) {
|
|
239140
239254
|
if (title && node3.kind === ReferenceKind2.ref && noNodeChildren) {
|
239141
239255
|
node3.children = title;
|
239142
239256
|
}
|
239143
|
-
const template = getReferenceTemplate({ node: targetNode, kind }, numbering, !!targetNode.enumerator, !!title);
|
239257
|
+
const template = getReferenceTemplate({ node: targetNode, kind }, numbering, !!targetNode.enumerator, !!title, offset);
|
239144
239258
|
fillReferenceEnumerators2(vfile2, node3, template, targetNode, title);
|
239145
239259
|
}
|
239146
239260
|
node3.resolved = true;
|
@@ -239202,8 +239316,9 @@ var MultiPageReferenceResolver = class {
|
|
239202
239316
|
}
|
239203
239317
|
};
|
239204
239318
|
var enumerateTargetsTransform = (tree, opts) => {
|
239205
|
-
opts.state.initializeNumberedTargetCounts(tree);
|
239206
239319
|
visit(tree, (node3) => {
|
239320
|
+
if (!isTargetIdentifierNode(node3))
|
239321
|
+
return;
|
239207
239322
|
if (node3.identifier || node3.enumerated || ["container", "mathGroup", "math", "heading", "proof"].includes(node3.type)) {
|
239208
239323
|
opts.state.addTarget(node3);
|
239209
239324
|
}
|
@@ -239223,9 +239338,6 @@ var enumerateTargetsTransform = (tree, opts) => {
|
|
239223
239338
|
});
|
239224
239339
|
return tree;
|
239225
239340
|
};
|
239226
|
-
var enumerateTargetsPlugin = (opts) => (tree) => {
|
239227
|
-
enumerateTargetsTransform(tree, opts);
|
239228
|
-
};
|
239229
239341
|
function getCaptionLabel(kind, subcontainer) {
|
239230
239342
|
if (subcontainer && (kind === "equation" || kind === "subequation"))
|
239231
239343
|
return `(%s)`;
|
@@ -239248,7 +239360,10 @@ function addContainerCaptionNumbersTransform(tree, file, opts) {
|
|
239248
239360
|
para = { type: "paragraph", children: [] };
|
239249
239361
|
container4.children.push({ type: "caption", children: [para] });
|
239250
239362
|
}
|
239251
|
-
if (para && ((_b = para.children[0]) === null || _b === void 0 ? void 0 : _b.type)
|
239363
|
+
if (para && ((_b = para.children[0]) === null || _b === void 0 ? void 0 : _b.type) === "captionNumber") {
|
239364
|
+
para.children = para.children.slice(1);
|
239365
|
+
}
|
239366
|
+
if (para) {
|
239252
239367
|
const captionNumber3 = {
|
239253
239368
|
type: "captionNumber",
|
239254
239369
|
kind: container4.kind,
|
@@ -242019,8 +242134,6 @@ function castSession(session) {
|
|
242019
242134
|
cache.$citationRenderers = {};
|
242020
242135
|
if (!cache.$doiRenderers)
|
242021
242136
|
cache.$doiRenderers = {};
|
242022
|
-
if (!cache.$internalReferences)
|
242023
|
-
cache.$internalReferences = {};
|
242024
242137
|
if (!cache.$externalReferences)
|
242025
242138
|
cache.$externalReferences = {};
|
242026
242139
|
if (!cache.$mdast)
|
@@ -289406,7 +289519,7 @@ var import_node_path16 = __toESM(require("path"), 1);
|
|
289406
289519
|
var import_nbtx = __toESM(require_cjs2(), 1);
|
289407
289520
|
|
289408
289521
|
// ../myst-cli/dist/version.js
|
289409
|
-
var version2 = "1.3.
|
289522
|
+
var version2 = "1.3.21";
|
289410
289523
|
var version_default2 = version2;
|
289411
289524
|
|
289412
289525
|
// ../myst-cli/dist/utils/headers.js
|
@@ -289725,6 +289838,26 @@ function isWhiteLabelled() {
|
|
289725
289838
|
return ["MYSTMD_READABLE_NAME", "MYSTMD_BINARY_NAME"].some((name3) => name3 in process.env);
|
289726
289839
|
}
|
289727
289840
|
|
289841
|
+
// ../myst-cli/dist/utils/fetchWithRetry.js
|
289842
|
+
async function fetchWithRetry(session, url, options, maxRetries = 3, attempt = 1, backoff = 250) {
|
289843
|
+
try {
|
289844
|
+
const resp = await session.fetch(url, options);
|
289845
|
+
if (resp.ok) {
|
289846
|
+
return resp;
|
289847
|
+
} else {
|
289848
|
+
session.log.warn(`Fetch of ${url} failed with HTTP status ${resp.status} for URL: ${url} (Attempt #${attempt})`);
|
289849
|
+
}
|
289850
|
+
} catch (error) {
|
289851
|
+
session.log.warn(`Fetch of ${url} threw an error (Attempt #${attempt})`, error);
|
289852
|
+
}
|
289853
|
+
if (attempt < maxRetries) {
|
289854
|
+
session.log.debug(`Waiting ${backoff}ms before retry #${attempt + 1}...`);
|
289855
|
+
await new Promise((resolve9) => setTimeout(resolve9, backoff));
|
289856
|
+
return fetchWithRetry(session, url, options, maxRetries, attempt + 1, backoff * 2);
|
289857
|
+
}
|
289858
|
+
throw new Error(`Failed to fetch ${url} after ${maxRetries} attempts.`);
|
289859
|
+
}
|
289860
|
+
|
289728
289861
|
// ../myst-cli/dist/utils/ffmpeg.js
|
289729
289862
|
var ffmpeg_exports = {};
|
289730
289863
|
__export(ffmpeg_exports, {
|
@@ -292513,10 +292646,10 @@ var Minimatch = class {
|
|
292513
292646
|
let ai = 0;
|
292514
292647
|
let bi = 0;
|
292515
292648
|
let result = [];
|
292516
|
-
let
|
292649
|
+
let which8 = "";
|
292517
292650
|
while (ai < a2.length && bi < b.length) {
|
292518
292651
|
if (a2[ai] === b[bi]) {
|
292519
|
-
result.push(
|
292652
|
+
result.push(which8 === "b" ? b[bi] : a2[ai]);
|
292520
292653
|
ai++;
|
292521
292654
|
bi++;
|
292522
292655
|
} else if (emptyGSMatch && a2[ai] === "**" && b[bi] === a2[ai + 1]) {
|
@@ -292526,16 +292659,16 @@ var Minimatch = class {
|
|
292526
292659
|
result.push(b[bi]);
|
292527
292660
|
bi++;
|
292528
292661
|
} else if (a2[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
292529
|
-
if (
|
292662
|
+
if (which8 === "b")
|
292530
292663
|
return false;
|
292531
|
-
|
292664
|
+
which8 = "a";
|
292532
292665
|
result.push(a2[ai]);
|
292533
292666
|
ai++;
|
292534
292667
|
bi++;
|
292535
292668
|
} else if (b[bi] === "*" && a2[ai] && (this.options.dot || !a2[ai].startsWith(".")) && a2[ai] !== "**") {
|
292536
|
-
if (
|
292669
|
+
if (which8 === "a")
|
292537
292670
|
return false;
|
292538
|
-
|
292671
|
+
which8 = "b";
|
292539
292672
|
result.push(b[bi]);
|
292540
292673
|
ai++;
|
292541
292674
|
bi++;
|
@@ -301308,6 +301441,7 @@ async function resolvePageDownloads(session, file, projectPath) {
|
|
301308
301441
|
return resolvedDownloads;
|
301309
301442
|
}
|
301310
301443
|
async function localToManifestProject(session, projectPath, projectSlug) {
|
301444
|
+
var _a6, _b;
|
301311
301445
|
if (!projectPath)
|
301312
301446
|
return null;
|
301313
301447
|
const state = session.store.getState();
|
@@ -301315,23 +301449,25 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301315
301449
|
const proj = selectors_exports.selectLocalProject(state, projectPath);
|
301316
301450
|
if (!proj)
|
301317
301451
|
return null;
|
301318
|
-
const { index: index4 } = proj;
|
301452
|
+
const { index: index4, file: indexFile } = proj;
|
301319
301453
|
const projectFileInfo = selectors_exports.selectFileInfo(state, proj.file);
|
301320
301454
|
const projectTitle = (projConfig === null || projConfig === void 0 ? void 0 : projConfig.title) || projectFileInfo.title || proj.index;
|
301455
|
+
const cache = castSession(session);
|
301321
301456
|
const pages = await Promise.all(proj.pages.map(async (page) => {
|
301322
|
-
var
|
301457
|
+
var _a7, _b2, _c, _d2, _e, _f, _g, _h, _j, _k;
|
301323
301458
|
if ("file" in page) {
|
301324
301459
|
const fileInfo3 = selectors_exports.selectFileInfo(state, page.file);
|
301325
301460
|
const title = fileInfo3.title || fileTitle(page.file);
|
301326
|
-
const short_title = (
|
301327
|
-
const description = (
|
301461
|
+
const short_title = (_a7 = fileInfo3.short_title) !== null && _a7 !== void 0 ? _a7 : void 0;
|
301462
|
+
const description = (_b2 = fileInfo3.description) !== null && _b2 !== void 0 ? _b2 : "";
|
301328
301463
|
const thumbnail2 = (_c = fileInfo3.thumbnail) !== null && _c !== void 0 ? _c : "";
|
301329
301464
|
const thumbnailOptimized = (_d2 = fileInfo3.thumbnailOptimized) !== null && _d2 !== void 0 ? _d2 : "";
|
301330
301465
|
const banner2 = (_e = fileInfo3.banner) !== null && _e !== void 0 ? _e : "";
|
301331
301466
|
const bannerOptimized = (_f = fileInfo3.bannerOptimized) !== null && _f !== void 0 ? _f : "";
|
301332
301467
|
const date = (_g = fileInfo3.date) !== null && _g !== void 0 ? _g : "";
|
301333
301468
|
const tags = (_h = fileInfo3.tags) !== null && _h !== void 0 ? _h : [];
|
301334
|
-
const { slug, level } = page;
|
301469
|
+
const { slug, level, file } = page;
|
301470
|
+
const { frontmatter: frontmatter2 } = (_k = (_j = cache.$getMdast(file)) === null || _j === void 0 ? void 0 : _j.post) !== null && _k !== void 0 ? _k : {};
|
301335
301471
|
const projectPage = {
|
301336
301472
|
slug,
|
301337
301473
|
title,
|
@@ -301343,7 +301479,8 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301343
301479
|
banner: banner2,
|
301344
301480
|
bannerOptimized,
|
301345
301481
|
tags,
|
301346
|
-
level
|
301482
|
+
level,
|
301483
|
+
enumerator: frontmatter2 === null || frontmatter2 === void 0 ? void 0 : frontmatter2.enumerator
|
301347
301484
|
};
|
301348
301485
|
return projectPage;
|
301349
301486
|
}
|
@@ -301356,6 +301493,7 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301356
301493
|
const parts = resolveFrontmatterParts(session, projFrontmatter);
|
301357
301494
|
const banner = await transformBanner(session, import_node_path29.default.join(projectPath, "myst.yml"), projFrontmatter, session.publicPath(), { altOutputFolder: "/", webp: true });
|
301358
301495
|
const thumbnail = await transformThumbnail(session, null, import_node_path29.default.join(projectPath, "myst.yml"), projFrontmatter, session.publicPath(), { altOutputFolder: "/", webp: true });
|
301496
|
+
const { frontmatter } = (_b = (_a6 = cache.$getMdast(indexFile)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
|
301359
301497
|
return {
|
301360
301498
|
...projFrontmatter,
|
301361
301499
|
// TODO: a null in the project frontmatter should not fall back to index page
|
@@ -301371,6 +301509,7 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301371
301509
|
title: projectTitle || "Untitled",
|
301372
301510
|
slug: projectSlug,
|
301373
301511
|
index: index4,
|
301512
|
+
enumerator: frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.enumerator,
|
301374
301513
|
pages
|
301375
301514
|
};
|
301376
301515
|
}
|
@@ -301733,7 +301872,7 @@ async function transformMystXRefs(session, vfile2, mdast2, frontmatter) {
|
|
301733
301872
|
let number2 = 0;
|
301734
301873
|
await Promise.all([
|
301735
301874
|
...nodes.map(async (node3) => {
|
301736
|
-
var _a6, _b, _c;
|
301875
|
+
var _a6, _b, _c, _d2, _e;
|
301737
301876
|
if (!node3.identifier) {
|
301738
301877
|
const data = await fetchMystLinkData(session, node3, vfile2);
|
301739
301878
|
if (!data)
|
@@ -301748,7 +301887,7 @@ async function transformMystXRefs(session, vfile2, mdast2, frontmatter) {
|
|
301748
301887
|
maxNodes: 1
|
301749
301888
|
});
|
301750
301889
|
if (targets === null || targets === void 0 ? void 0 : targets.length) {
|
301751
|
-
addChildrenFromTargetNode(node3, targets[0], frontmatter.numbering, vfile2);
|
301890
|
+
addChildrenFromTargetNode(node3, targets[0], frontmatter.numbering, vfile2, (_e = (_d2 = frontmatter.numbering) === null || _d2 === void 0 ? void 0 : _d2.title) === null || _e === void 0 ? void 0 : _e.offset);
|
301752
301891
|
}
|
301753
301892
|
}
|
301754
301893
|
number2 += 1;
|
@@ -304008,6 +304147,33 @@ async function rawDirectiveTransform(tree, vfile2) {
|
|
304008
304147
|
});
|
304009
304148
|
}
|
304010
304149
|
|
304150
|
+
// ../myst-cli/dist/utils/addEditUrl.js
|
304151
|
+
var import_which5 = __toESM(require_lib15(), 1);
|
304152
|
+
function gitCommandAvailable() {
|
304153
|
+
return !!import_which5.default.sync("git", { nothrow: true });
|
304154
|
+
}
|
304155
|
+
async function addEditUrl(session, frontmatter, file) {
|
304156
|
+
if (!frontmatter.github)
|
304157
|
+
return;
|
304158
|
+
if (frontmatter.edit_url || frontmatter.edit_url === null)
|
304159
|
+
return;
|
304160
|
+
if (!gitCommandAvailable())
|
304161
|
+
return;
|
304162
|
+
try {
|
304163
|
+
const gitLog = silentLogger();
|
304164
|
+
const getGitBranch = makeExecutable("git rev-parse --abbrev-ref HEAD", gitLog);
|
304165
|
+
const gitBranch = (await getGitBranch()).trim();
|
304166
|
+
const getGitRoot = makeExecutable("git rev-parse --show-toplevel", gitLog);
|
304167
|
+
const gitRoot = (await getGitRoot()).trim();
|
304168
|
+
if (gitBranch && gitRoot && file.startsWith(gitRoot)) {
|
304169
|
+
frontmatter.edit_url = `${frontmatter.github}/blob/${gitBranch}${file.replace(gitRoot, "")}`;
|
304170
|
+
session.log.debug(`Added edit URL ${frontmatter.edit_url} to ${file}`);
|
304171
|
+
}
|
304172
|
+
} catch {
|
304173
|
+
session.log.debug(`Unable to add edit URL to ${file}`);
|
304174
|
+
}
|
304175
|
+
}
|
304176
|
+
|
304011
304177
|
// ../myst-cli/dist/process/mdast.js
|
304012
304178
|
var LINKS_SELECTOR = "link,card,linkBlock";
|
304013
304179
|
var pluginUtils = { select, selectAll };
|
@@ -304018,17 +304184,24 @@ var htmlHandlers = {
|
|
304018
304184
|
return result;
|
304019
304185
|
}
|
304020
304186
|
};
|
304021
|
-
function referenceFileFromPartFile(session, partFile) {
|
304022
|
-
const state = session.store.getState();
|
304023
|
-
const partDeps = selectors_exports.selectDependentFiles(state, partFile);
|
304024
|
-
if (partDeps.length > 0)
|
304025
|
-
return partDeps[0];
|
304026
|
-
const file = selectors_exports.selectFileFromPart(state, partFile);
|
304027
|
-
return file !== null && file !== void 0 ? file : partFile;
|
304028
|
-
}
|
304029
304187
|
async function transformMdast(session, opts) {
|
304030
304188
|
var _a6, _b, _c, _d2;
|
304031
|
-
const {
|
304189
|
+
const {
|
304190
|
+
file,
|
304191
|
+
projectPath,
|
304192
|
+
pageSlug,
|
304193
|
+
projectSlug,
|
304194
|
+
imageExtensions,
|
304195
|
+
extraTransforms,
|
304196
|
+
watchMode = false,
|
304197
|
+
minifyMaxCharacters,
|
304198
|
+
index: index4,
|
304199
|
+
titleDepth,
|
304200
|
+
// Related to title set in markdown, rather than frontmatter
|
304201
|
+
offset,
|
304202
|
+
// Related to multi-page nesting
|
304203
|
+
execute
|
304204
|
+
} = opts;
|
304032
304205
|
const toc = tic();
|
304033
304206
|
const { store, log } = session;
|
304034
304207
|
const cache = castSession(session);
|
@@ -304052,16 +304225,18 @@ async function transformMdast(session, opts) {
|
|
304052
304225
|
fileWarn(vfile2, message, { ruleId: RuleId.validPageFrontmatter });
|
304053
304226
|
}
|
304054
304227
|
}, projectPath);
|
304228
|
+
if (offset) {
|
304229
|
+
if (!frontmatter.numbering)
|
304230
|
+
frontmatter.numbering = {};
|
304231
|
+
if (!frontmatter.numbering.title)
|
304232
|
+
frontmatter.numbering.title = {};
|
304233
|
+
if (frontmatter.numbering.title.offset == null)
|
304234
|
+
frontmatter.numbering.title.offset = offset;
|
304235
|
+
}
|
304236
|
+
await addEditUrl(session, frontmatter, file);
|
304055
304237
|
const references = {
|
304056
304238
|
cite: { order: [], data: {} }
|
304057
304239
|
};
|
304058
|
-
const refFile = kind === SourceFileKind.Part ? referenceFileFromPartFile(session, file) : file;
|
304059
|
-
const state = new ReferenceState(refFile, {
|
304060
|
-
numbering: frontmatter.numbering,
|
304061
|
-
identifiers,
|
304062
|
-
vfile: vfile2
|
304063
|
-
});
|
304064
|
-
cache.$internalReferences[file] = state;
|
304065
304240
|
importMdastFromJson(session, file, mdast2);
|
304066
304241
|
await includeFilesTransform(session, file, mdast2, frontmatter, vfile2);
|
304067
304242
|
rawDirectiveTransform(mdast2, vfile2);
|
@@ -304069,12 +304244,13 @@ async function transformMdast(session, opts) {
|
|
304069
304244
|
const pipe = unified().use(reconstructHtmlPlugin).use(htmlPlugin, { htmlHandlers }).use(basicTransformationsPlugin, {
|
304070
304245
|
parser: (content3) => parseMyst(session, content3, file),
|
304071
304246
|
firstDepth: (titleDepth !== null && titleDepth !== void 0 ? titleDepth : 1) + (frontmatter.content_includes_title ? 0 : 1)
|
304072
|
-
}).use(inlineMathSimplificationPlugin).use(mathPlugin, { macros: frontmatter.math })
|
304247
|
+
}).use(inlineMathSimplificationPlugin).use(mathPlugin, { macros: frontmatter.math });
|
304073
304248
|
(_c = session.plugins) === null || _c === void 0 ? void 0 : _c.transforms.forEach((t2) => {
|
304074
304249
|
if (t2.stage !== "document")
|
304075
304250
|
return;
|
304076
304251
|
pipe.use(t2.plugin, void 0, pluginUtils);
|
304077
304252
|
});
|
304253
|
+
pipe.use(glossaryPlugin).use(abbreviationPlugin, { abbreviations: frontmatter.abbreviations }).use(indexIdentifierPlugin);
|
304078
304254
|
await pipe.run(mdast2, vfile2);
|
304079
304255
|
propagateBlockDataToCode(session, vfile2, mdast2);
|
304080
304256
|
cache.$citationRenderers[file] = await transformLinkedDOIs(session, vfile2, mdast2, cache.$doiRenderers, file);
|
@@ -304131,6 +304307,7 @@ async function transformMdast(session, opts) {
|
|
304131
304307
|
frontmatter,
|
304132
304308
|
mdast: mdast2,
|
304133
304309
|
references,
|
304310
|
+
identifiers,
|
304134
304311
|
widgets
|
304135
304312
|
};
|
304136
304313
|
const cachedMdast = cache.$getMdast(file);
|
@@ -304156,8 +304333,7 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
|
|
304156
304333
|
const vfile2 = new VFile();
|
304157
304334
|
vfile2.path = file;
|
304158
304335
|
const { mdast: mdast2, dependencies, frontmatter } = mdastPost;
|
304159
|
-
const
|
304160
|
-
const state = pageReferenceStates ? new MultiPageReferenceResolver(pageReferenceStates, file, vfile2) : fileState;
|
304336
|
+
const state = new MultiPageReferenceResolver(pageReferenceStates, file, vfile2);
|
304161
304337
|
const externalReferences = Object.values(cache.$externalReferences);
|
304162
304338
|
const transformers = [
|
304163
304339
|
...extraLinkTransformers || [],
|
@@ -304173,12 +304349,12 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
|
|
304173
304349
|
// Links static files and internally linked files
|
304174
304350
|
];
|
304175
304351
|
resolveLinksAndCitationsTransform(mdast2, { state, transformers });
|
304176
|
-
linksTransform(mdast2,
|
304352
|
+
linksTransform(mdast2, vfile2, {
|
304177
304353
|
transformers,
|
304178
304354
|
selector: LINKS_SELECTOR
|
304179
304355
|
});
|
304180
304356
|
await transformLinkedRORs(session, vfile2, mdast2, file);
|
304181
|
-
resolveReferencesTransform(mdast2,
|
304357
|
+
resolveReferencesTransform(mdast2, vfile2, { state, transformers });
|
304182
304358
|
await transformMystXRefs(session, vfile2, mdast2, frontmatter);
|
304183
304359
|
await embedTransform(session, mdast2, file, dependencies, state);
|
304184
304360
|
const pipe = unified();
|
@@ -304190,7 +304366,6 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
|
|
304190
304366
|
await pipe.run(mdast2, vfile2);
|
304191
304367
|
keysTransform(mdast2);
|
304192
304368
|
checkLinkTextTransform(mdast2, externalReferences, vfile2);
|
304193
|
-
logMessagesFromVFile(session, fileState.vfile);
|
304194
304369
|
logMessagesFromVFile(session, vfile2);
|
304195
304370
|
log.debug(toc(`Transformed mdast cross references and links for "${file}" in %s`));
|
304196
304371
|
if (checkLinks)
|
@@ -304518,10 +304693,36 @@ function warnOnDuplicateIdentifiers(session, states) {
|
|
304518
304693
|
});
|
304519
304694
|
});
|
304520
304695
|
}
|
304696
|
+
function referenceFileFromPartFile(session, partFile) {
|
304697
|
+
const state = session.store.getState();
|
304698
|
+
const partDeps = selectors_exports.selectDependentFiles(state, partFile);
|
304699
|
+
if (partDeps.length > 0)
|
304700
|
+
return partDeps[0];
|
304701
|
+
const file = selectors_exports.selectFileFromPart(state, partFile);
|
304702
|
+
return file !== null && file !== void 0 ? file : partFile;
|
304703
|
+
}
|
304521
304704
|
function selectPageReferenceStates(session, pages, opts) {
|
304522
304705
|
const cache = castSession(session);
|
304523
|
-
|
304524
|
-
|
304706
|
+
let previousCounts;
|
304707
|
+
const pageReferenceStates = pages.map(({ file }) => {
|
304708
|
+
var _a6, _b;
|
304709
|
+
const { frontmatter, identifiers, mdast: mdast2, kind } = (_b = (_a6 = cache.$getMdast(file)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
|
304710
|
+
const vfile2 = new VFile();
|
304711
|
+
vfile2.path = file;
|
304712
|
+
const refFile = kind === SourceFileKind.Part ? referenceFileFromPartFile(session, file) : file;
|
304713
|
+
const state = new ReferenceState(refFile, {
|
304714
|
+
frontmatter,
|
304715
|
+
identifiers,
|
304716
|
+
previousCounts,
|
304717
|
+
vfile: vfile2
|
304718
|
+
});
|
304719
|
+
if (frontmatter && !frontmatter.enumerator) {
|
304720
|
+
frontmatter.enumerator = state.enumerator;
|
304721
|
+
}
|
304722
|
+
if (mdast2)
|
304723
|
+
enumerateTargetsTransform(mdast2, { state });
|
304724
|
+
previousCounts = state.targetCounts;
|
304725
|
+
logMessagesFromVFile(session, vfile2);
|
304525
304726
|
if (state) {
|
304526
304727
|
const selectedFile = selectors_exports.selectFileInfo(session.store.getState(), state.filePath);
|
304527
304728
|
if (selectedFile === null || selectedFile === void 0 ? void 0 : selectedFile.url)
|
@@ -304536,18 +304737,13 @@ function selectPageReferenceStates(session, pages, opts) {
|
|
304536
304737
|
}).filter((state) => !!state);
|
304537
304738
|
if (!(opts === null || opts === void 0 ? void 0 : opts.suppressWarnings))
|
304538
304739
|
warnOnDuplicateIdentifiers(session, pageReferenceStates);
|
304539
|
-
|
304740
|
+
pageReferenceStates.forEach((state) => {
|
304540
304741
|
var _a6, _b;
|
304541
|
-
const
|
304542
|
-
if (!state)
|
304543
|
-
return;
|
304544
|
-
const { mdast: mdast2 } = (_b = (_a6 = cache.$getMdast(page.file)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
|
304742
|
+
const { mdast: mdast2 } = (_b = (_a6 = cache.$getMdast(state.filePath)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
|
304545
304743
|
if (!mdast2)
|
304546
304744
|
return;
|
304547
|
-
|
304548
|
-
|
304549
|
-
buildIndexTransform(mdast2, vfile2, state, new MultiPageReferenceResolver(pageReferenceStates, state.filePath));
|
304550
|
-
logMessagesFromVFile(session, vfile2);
|
304745
|
+
buildIndexTransform(mdast2, state.vfile, state, new MultiPageReferenceResolver(pageReferenceStates, state.filePath));
|
304746
|
+
logMessagesFromVFile(session, state.vfile);
|
304551
304747
|
});
|
304552
304748
|
return pageReferenceStates;
|
304553
304749
|
}
|
@@ -304598,6 +304794,8 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
|
|
304598
304794
|
const fileParts = selectors_exports.selectFileParts(state, file);
|
304599
304795
|
const projectParts = selectors_exports.selectProjectParts(state, projectPath);
|
304600
304796
|
await Promise.all([file, ...fileParts].map(async (f3) => {
|
304797
|
+
var _a6;
|
304798
|
+
const level = (_a6 = pages.find((page) => page.file === file)) === null || _a6 === void 0 ? void 0 : _a6.level;
|
304601
304799
|
return transformMdast(session, {
|
304602
304800
|
file: f3,
|
304603
304801
|
imageExtensions: imageExtensions !== null && imageExtensions !== void 0 ? imageExtensions : WEB_IMAGE_EXTENSIONS,
|
@@ -304607,7 +304805,8 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
|
|
304607
304805
|
watchMode: true,
|
304608
304806
|
extraTransforms,
|
304609
304807
|
index: project.index,
|
304610
|
-
execute
|
304808
|
+
execute,
|
304809
|
+
offset: level ? level - 1 : void 0
|
304611
304810
|
});
|
304612
304811
|
}));
|
304613
304812
|
const pageReferenceStates = selectPageReferenceStates(session, [
|
@@ -304616,18 +304815,18 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
|
|
304616
304815
|
return { file: part };
|
304617
304816
|
})
|
304618
304817
|
]);
|
304619
|
-
await Promise.all([file, ...fileParts].map(async (f3) => {
|
304818
|
+
await Promise.all([...pages.map((p5) => p5.file), ...fileParts].map(async (f3) => {
|
304620
304819
|
return postProcessMdast(session, {
|
304621
304820
|
file: f3,
|
304622
304821
|
pageReferenceStates,
|
304623
304822
|
extraLinkTransformers
|
304624
304823
|
});
|
304625
304824
|
}));
|
304626
|
-
await Promise.all([file, ...fileParts].map(async (f3) => {
|
304825
|
+
await Promise.all([...pages.map((p5) => p5.file), ...fileParts].map(async (f3) => {
|
304627
304826
|
var _a6, _b;
|
304628
304827
|
const { mdast: mdast2, frontmatter } = (_b = (_a6 = castSession(session).$getMdast(f3)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
|
304629
|
-
if (mdast2) {
|
304630
|
-
await finalizeMdast(session, mdast2, frontmatter
|
304828
|
+
if (mdast2 && frontmatter) {
|
304829
|
+
await finalizeMdast(session, mdast2, frontmatter, f3, {
|
304631
304830
|
imageWriteFolder: imageWriteFolder !== null && imageWriteFolder !== void 0 ? imageWriteFolder : session.publicPath(),
|
304632
304831
|
imageAltOutputFolder: imageAltOutputFolder !== null && imageAltOutputFolder !== void 0 ? imageAltOutputFolder : "/",
|
304633
304832
|
imageExtensions: imageExtensions !== null && imageExtensions !== void 0 ? imageExtensions : WEB_IMAGE_EXTENSIONS,
|
@@ -304637,9 +304836,14 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
|
|
304637
304836
|
});
|
304638
304837
|
}
|
304639
304838
|
}));
|
304640
|
-
|
304641
|
-
|
304642
|
-
|
304839
|
+
await Promise.all(pages.map(async (page) => {
|
304840
|
+
return writeFile(session, {
|
304841
|
+
file: page.file,
|
304842
|
+
projectSlug,
|
304843
|
+
projectPath,
|
304844
|
+
pageSlug: page.slug
|
304845
|
+
});
|
304846
|
+
}));
|
304643
304847
|
session.log.info(toc(`\u{1F4D6} Built ${file} in %s.`));
|
304644
304848
|
await writeSiteManifest(session, { defaultTemplate });
|
304645
304849
|
}
|
@@ -304673,7 +304877,10 @@ async function processProject(session, siteProject, opts) {
|
|
304673
304877
|
const projectParts = selectors_exports.selectProjectParts(session.store.getState(), siteProject.path).map((part) => {
|
304674
304878
|
return { file: part };
|
304675
304879
|
});
|
304676
|
-
const pagesToTransform = [
|
304880
|
+
const pagesToTransform = [
|
304881
|
+
...pages,
|
304882
|
+
...projectParts
|
304883
|
+
];
|
304677
304884
|
const usedImageExtensions = imageExtensions !== null && imageExtensions !== void 0 ? imageExtensions : WEB_IMAGE_EXTENSIONS;
|
304678
304885
|
await Promise.all(pagesToTransform.map((page) => transformMdast(session, {
|
304679
304886
|
file: page.file,
|
@@ -304684,7 +304891,8 @@ async function processProject(session, siteProject, opts) {
|
|
304684
304891
|
watchMode,
|
304685
304892
|
execute,
|
304686
304893
|
extraTransforms,
|
304687
|
-
index: project.index
|
304894
|
+
index: project.index,
|
304895
|
+
offset: page.level ? page.level - 1 : void 0
|
304688
304896
|
})));
|
304689
304897
|
const pageReferenceStates = selectPageReferenceStates(session, pagesToTransform);
|
304690
304898
|
await Promise.all(pagesToTransform.map((page) => postProcessMdast(session, {
|
@@ -306796,7 +307004,7 @@ function hasGlossary(mdast2) {
|
|
306796
307004
|
var import_adm_zip3 = __toESM(require_adm_zip(), 1);
|
306797
307005
|
var import_node_fs36 = __toESM(require("fs"), 1);
|
306798
307006
|
var import_node_path46 = __toESM(require("path"), 1);
|
306799
|
-
var
|
307007
|
+
var import_which6 = __toESM(require_lib15(), 1);
|
306800
307008
|
|
306801
307009
|
// ../myst-to-typst/dist/container.js
|
306802
307010
|
var CaptionKind2;
|
@@ -306807,7 +307015,9 @@ var CaptionKind2;
|
|
306807
307015
|
CaptionKind3["table"] = "table";
|
306808
307016
|
})(CaptionKind2 || (CaptionKind2 = {}));
|
306809
307017
|
function renderFigureChild(node3, state) {
|
306810
|
-
|
307018
|
+
var _a6;
|
307019
|
+
const bracketNode = node3.type === "div" && ((_a6 = node3.children) === null || _a6 === void 0 ? void 0 : _a6.length) === 1 ? node3.children[0] : node3;
|
307020
|
+
const useBrackets = bracketNode.type !== "image" && bracketNode.type !== "table";
|
306811
307021
|
if (node3.type === "legend") {
|
306812
307022
|
state.useMacro('#let legendStyle = (fill: black.lighten(20%), size: 8pt, style: "italic")');
|
306813
307023
|
state.write("text(..legendStyle)");
|
@@ -307187,6 +307397,43 @@ function getLatexImageWidth2(width) {
|
|
307187
307397
|
return `${lineWidth}%`;
|
307188
307398
|
}
|
307189
307399
|
|
307400
|
+
// ../../node_modules/tex-to-typst/dist/utils.js
|
307401
|
+
var BRACKETS = {
|
307402
|
+
"[": "bracket.l",
|
307403
|
+
"]": "bracket.r",
|
307404
|
+
"{": "brace.l",
|
307405
|
+
"}": "brace.r",
|
307406
|
+
"(": "paren.l",
|
307407
|
+
")": "paren.r",
|
307408
|
+
"|": "bar.v",
|
307409
|
+
lfloor: "floor.l",
|
307410
|
+
"\u230A": "floor.l",
|
307411
|
+
rfloor: "floor.r",
|
307412
|
+
"\u230B": "floor.r",
|
307413
|
+
rceil: "ceil.r",
|
307414
|
+
"\u2309": "ceil.r",
|
307415
|
+
lceil: "ceil.l",
|
307416
|
+
"\u2308": "ceil.l"
|
307417
|
+
};
|
307418
|
+
function areBracketsBalanced(input3) {
|
307419
|
+
const stack = [];
|
307420
|
+
const bracketMap = {
|
307421
|
+
")": "(",
|
307422
|
+
"]": "[",
|
307423
|
+
"}": "{"
|
307424
|
+
};
|
307425
|
+
for (const char of input3) {
|
307426
|
+
if (char === "(" || char === "[" || char === "{") {
|
307427
|
+
stack.push(char);
|
307428
|
+
} else if (char === ")" || char === "]" || char === "}") {
|
307429
|
+
if (!stack.length || bracketMap[char] !== stack.pop()) {
|
307430
|
+
return false;
|
307431
|
+
}
|
307432
|
+
}
|
307433
|
+
}
|
307434
|
+
return stack.length === 0;
|
307435
|
+
}
|
307436
|
+
|
307190
307437
|
// ../../node_modules/tex-to-typst/dist/macros.js
|
307191
307438
|
function isEmptyNode(node3) {
|
307192
307439
|
if (!(node3 === null || node3 === void 0 ? void 0 : node3.content) || node3.content.length === 0)
|
@@ -307201,22 +307448,13 @@ var typstStrings = {
|
|
307201
307448
|
"~": "med",
|
307202
307449
|
'"': '\\"'
|
307203
307450
|
};
|
307204
|
-
var brackets = {
|
307205
|
-
"[": "bracket.l",
|
307206
|
-
"]": "bracket.r",
|
307207
|
-
"{": "brace.l",
|
307208
|
-
"}": "brace.r",
|
307209
|
-
"(": "paren.l",
|
307210
|
-
")": "paren.r",
|
307211
|
-
"|": "bar.v"
|
307212
|
-
};
|
307213
307451
|
function createBrackets(scale) {
|
307214
307452
|
return (state, node3) => {
|
307215
307453
|
var _a6;
|
307216
307454
|
const args = node3.args;
|
307217
307455
|
node3.args = [];
|
307218
307456
|
const b = ((_a6 = args === null || args === void 0 ? void 0 : args[0].content) === null || _a6 === void 0 ? void 0 : _a6[0]).content;
|
307219
|
-
const typstB =
|
307457
|
+
const typstB = BRACKETS[b];
|
307220
307458
|
if (!typstB)
|
307221
307459
|
throw new Error(`Undefined left bracket: ${b}`);
|
307222
307460
|
return `#scale(x: ${scale}, y: ${scale})[$${typstB}$]`;
|
@@ -307264,6 +307502,17 @@ var typstMacros = {
|
|
307264
307502
|
mathrm: "upright",
|
307265
307503
|
textrm: "upright",
|
307266
307504
|
rm: "upright",
|
307505
|
+
mbox: (state, node3) => {
|
307506
|
+
var _a6;
|
307507
|
+
const arg2 = (_a6 = node3.args) === null || _a6 === void 0 ? void 0 : _a6[0];
|
307508
|
+
node3.args = [];
|
307509
|
+
state.openFunction("upright");
|
307510
|
+
state.openFunction("text");
|
307511
|
+
state.writeChildren(arg2);
|
307512
|
+
state.closeFunction();
|
307513
|
+
state.closeFunction();
|
307514
|
+
return "";
|
307515
|
+
},
|
307267
307516
|
mathcal: "cal",
|
307268
307517
|
mathfrak: "frak",
|
307269
307518
|
pm: "plus.minus",
|
@@ -307276,12 +307525,18 @@ var typstMacros = {
|
|
307276
307525
|
splitStrings(node3);
|
307277
307526
|
return "^";
|
307278
307527
|
},
|
307528
|
+
big: createBrackets("120%"),
|
307279
307529
|
bigl: createBrackets("120%"),
|
307280
307530
|
bigr: createBrackets("120%"),
|
307281
|
-
|
307531
|
+
Big: createBrackets("180%"),
|
307282
307532
|
Bigl: createBrackets("180%"),
|
307283
307533
|
Bigr: createBrackets("180%"),
|
307284
|
-
|
307534
|
+
bigg: createBrackets("240%"),
|
307535
|
+
biggr: createBrackets("240%"),
|
307536
|
+
biggl: createBrackets("240%"),
|
307537
|
+
Bigg: createBrackets("300%"),
|
307538
|
+
Biggl: createBrackets("300%"),
|
307539
|
+
Biggr: createBrackets("300%"),
|
307285
307540
|
left: (state, node3) => {
|
307286
307541
|
var _a6;
|
307287
307542
|
const args = node3.args;
|
@@ -307393,9 +307648,9 @@ var typstMacros = {
|
|
307393
307648
|
prod: "product",
|
307394
307649
|
lfloor: "floor.l",
|
307395
307650
|
rfloor: "floor.r",
|
307651
|
+
langle: "angle.l",
|
307652
|
+
rangle: "angle.r",
|
307396
307653
|
implies: "arrow.r.double.long",
|
307397
|
-
biggl: "",
|
307398
|
-
biggr: "",
|
307399
307654
|
" ": '" "',
|
307400
307655
|
mathbb: (state, node3) => {
|
307401
307656
|
var _a6, _b, _c, _d2, _e;
|
@@ -307486,12 +307741,18 @@ function parseLatex2(value) {
|
|
307486
307741
|
boldsymbol: { signature: "m" },
|
307487
307742
|
left: { signature: "m" },
|
307488
307743
|
right: { signature: "m" },
|
307489
|
-
Big: { signature: "m" },
|
307490
|
-
Bigr: { signature: "m" },
|
307491
|
-
Bigl: { signature: "m" },
|
307492
307744
|
big: { signature: "m" },
|
307493
307745
|
bigr: { signature: "m" },
|
307494
307746
|
bigl: { signature: "m" },
|
307747
|
+
Big: { signature: "m" },
|
307748
|
+
Bigr: { signature: "m" },
|
307749
|
+
Bigl: { signature: "m" },
|
307750
|
+
bigg: { signature: "m" },
|
307751
|
+
biggr: { signature: "m" },
|
307752
|
+
biggl: { signature: "m" },
|
307753
|
+
Bigg: { signature: "m" },
|
307754
|
+
Biggr: { signature: "m" },
|
307755
|
+
Biggl: { signature: "m" },
|
307495
307756
|
dot: { signature: "m" },
|
307496
307757
|
ddot: { signature: "m" },
|
307497
307758
|
hat: { signature: "m" },
|
@@ -307586,12 +307847,13 @@ function walkLatex2(node3) {
|
|
307586
307847
|
return node3;
|
307587
307848
|
}
|
307588
307849
|
var State4 = class {
|
307589
|
-
constructor() {
|
307850
|
+
constructor(opts) {
|
307851
|
+
var _a6;
|
307590
307852
|
this._scriptsSimplified = false;
|
307591
307853
|
this._closeToken = [];
|
307592
307854
|
this._currentFunctions = [];
|
307593
307855
|
this._value = "";
|
307594
|
-
this.data = {};
|
307856
|
+
this.data = { writeOutBrackets: (_a6 = opts === null || opts === void 0 ? void 0 : opts.writeOutBrackets) !== null && _a6 !== void 0 ? _a6 : false };
|
307595
307857
|
}
|
307596
307858
|
get value() {
|
307597
307859
|
return this._value;
|
@@ -307615,6 +307877,11 @@ var State4 = class {
|
|
307615
307877
|
write(str2) {
|
307616
307878
|
if (!str2)
|
307617
307879
|
return;
|
307880
|
+
if (Object.keys(BRACKETS).includes(str2) && this.data.inFunction && this.data.writeOutBrackets) {
|
307881
|
+
this.addWhitespace();
|
307882
|
+
this._value += BRACKETS[str2];
|
307883
|
+
return;
|
307884
|
+
}
|
307618
307885
|
if (this._scriptsSimplified && str2 === "(") {
|
307619
307886
|
this.addWhitespace();
|
307620
307887
|
} else if (str2.match(/^([})_^.,;!])$/) || str2 === '\\"') {
|
@@ -307726,11 +307993,15 @@ function writeTypst(node3, state = new State4()) {
|
|
307726
307993
|
function postProcess(typst) {
|
307727
307994
|
return typst.replace(/^(_|\^)/, '""$1').replace(/"([^"]*)"=/g, '"$1" =').replace(/(\d+)(?:\s+)(?=\d)/g, "$1");
|
307728
307995
|
}
|
307729
|
-
function texToTypst(value) {
|
307996
|
+
function texToTypst(value, options) {
|
307730
307997
|
const tree = parseLatex2(value);
|
307731
307998
|
walkLatex2(tree);
|
307732
|
-
const state = writeTypst(tree);
|
307733
|
-
|
307999
|
+
const state = writeTypst(tree, new State4({ writeOutBrackets: options === null || options === void 0 ? void 0 : options.writeOutBrackets }));
|
308000
|
+
const typstValue = postProcess(state.value);
|
308001
|
+
if ((options === null || options === void 0 ? void 0 : options.writeOutBrackets) || areBracketsBalanced(typstValue)) {
|
308002
|
+
return { value: typstValue, macros: state.data.macros };
|
308003
|
+
}
|
308004
|
+
return texToTypst(value, { writeOutBrackets: true });
|
307734
308005
|
}
|
307735
308006
|
|
307736
308007
|
// ../myst-to-typst/dist/math.js
|
@@ -307869,7 +308140,9 @@ var tableCellHandler = (node3, state) => {
|
|
307869
308140
|
state.write(`align: ${node3.align}, `);
|
307870
308141
|
}
|
307871
308142
|
if ((_b = node3.style) === null || _b === void 0 ? void 0 : _b.backgroundColor) {
|
307872
|
-
|
308143
|
+
const fill3 = node3.style.backgroundColor;
|
308144
|
+
const rgb = fill3.startsWith("#");
|
308145
|
+
state.write(`fill: ${rgb ? `rgb("${fill3}")` : fill3}, `);
|
307873
308146
|
}
|
307874
308147
|
state.write(")");
|
307875
308148
|
}
|
@@ -308000,7 +308273,7 @@ function nextCharacterIsText(parent2, node3) {
|
|
308000
308273
|
}
|
308001
308274
|
var handlers4 = {
|
308002
308275
|
text(node3, state) {
|
308003
|
-
state.text(node3.value);
|
308276
|
+
state.text(node3.value.replaceAll("\n", " "));
|
308004
308277
|
},
|
308005
308278
|
paragraph(node3, state) {
|
308006
308279
|
const { identifier } = node3;
|
@@ -308482,7 +308755,7 @@ var TYPST_IMAGE_EXTENSIONS = [
|
|
308482
308755
|
ImageExtensions.jpeg
|
308483
308756
|
];
|
308484
308757
|
function isTypstAvailable() {
|
308485
|
-
return
|
308758
|
+
return import_which6.default.sync("typst", { nothrow: true });
|
308486
308759
|
}
|
308487
308760
|
async function runTypstExecutable(session, typstFile) {
|
308488
308761
|
if (!isTypstAvailable()) {
|
@@ -312136,12 +312409,12 @@ var import_node_path49 = __toESM(require("path"), 1);
|
|
312136
312409
|
var import_util5 = __toESM(require("util"), 1);
|
312137
312410
|
|
312138
312411
|
// ../myst-cli/dist/build/pdf/utils.js
|
312139
|
-
var
|
312412
|
+
var import_which7 = __toESM(require_lib15(), 1);
|
312140
312413
|
function isLatexmkAvailable() {
|
312141
|
-
return
|
312414
|
+
return import_which7.default.sync("latexmk", { nothrow: true });
|
312142
312415
|
}
|
312143
312416
|
function isMakeglossariesAvailable() {
|
312144
|
-
return
|
312417
|
+
return import_which7.default.sync("makeglossaries", { nothrow: true });
|
312145
312418
|
}
|
312146
312419
|
|
312147
312420
|
// ../myst-cli/dist/build/pdf/create.js
|
@@ -317199,7 +317472,7 @@ function frontmatterToCFF(frontmatter, abstract) {
|
|
317199
317472
|
let dateString;
|
317200
317473
|
if (frontmatter.date) {
|
317201
317474
|
const date = new Date(frontmatter.date);
|
317202
|
-
dateString = new Date(date.getTime()
|
317475
|
+
dateString = new Date(date.getTime()).toISOString().split("T")[0];
|
317203
317476
|
}
|
317204
317477
|
const { title, authors } = frontmatter;
|
317205
317478
|
if (!title) {
|
@@ -317858,6 +318131,8 @@ async function startServer(session, opts) {
|
|
317858
318131
|
}
|
317859
318132
|
|
317860
318133
|
// ../myst-cli/dist/build/html/index.js
|
318134
|
+
var import_p_limit2 = __toESM(require_p_limit(), 1);
|
318135
|
+
var limitConnections = (0, import_p_limit2.default)(5);
|
317861
318136
|
async function currentSiteRoutes(session, host, baseurl, opts) {
|
317862
318137
|
var _a6, _b;
|
317863
318138
|
const manifest = await getSiteManifest(session, opts);
|
@@ -317947,8 +318222,8 @@ async function buildHtml(session, opts) {
|
|
317947
318222
|
return;
|
317948
318223
|
const host = `http://localhost:${appServer.port}`;
|
317949
318224
|
const routes = await currentSiteRoutes(session, host, baseurl, opts);
|
317950
|
-
await Promise.all(routes.map(async (route) => {
|
317951
|
-
const resp = await session
|
318225
|
+
await Promise.all(routes.map(async (route) => limitConnections(async () => {
|
318226
|
+
const resp = await fetchWithRetry(session, route.url);
|
317952
318227
|
if (!resp.ok) {
|
317953
318228
|
session.log.error(`Error fetching ${route.url}`);
|
317954
318229
|
return;
|
@@ -317966,7 +318241,7 @@ async function buildHtml(session, opts) {
|
|
317966
318241
|
const content3 = await resp.text();
|
317967
318242
|
writeFileToFolder(import_node_path57.default.join(htmlDir, route.path), content3);
|
317968
318243
|
}
|
317969
|
-
}));
|
318244
|
+
})));
|
317970
318245
|
appServer.stop();
|
317971
318246
|
const templateBuildDir = import_node_path57.default.join(template.templatePath, "public");
|
317972
318247
|
import_fs_extra.default.copySync(templateBuildDir, htmlDir);
|
@@ -320742,6 +321017,7 @@ async function checkAtGitRoot() {
|
|
320742
321017
|
// ../myst-cli/dist/init/gh-actions/index.js
|
320743
321018
|
function createGithubPagesAction({ defaultBranch = "main", username = "username", isGithubIO }) {
|
320744
321019
|
return `# This file was created automatically with \`myst init --gh-pages\` \u{1FA84} \u{1F49A}
|
321020
|
+
# Ensure your GitHub Pages settings for this repository are set to deploy with **GitHub Actions**.
|
320745
321021
|
|
320746
321022
|
name: MyST GitHub Pages Deploy
|
320747
321023
|
on:
|
@@ -332472,7 +332748,7 @@ function boxen(text7, options) {
|
|
332472
332748
|
|
332473
332749
|
// ../myst-cli/dist/session/session.js
|
332474
332750
|
var import_https_proxy_agent = __toESM(require_dist5(), 1);
|
332475
|
-
var
|
332751
|
+
var import_p_limit3 = __toESM(require_p_limit(), 1);
|
332476
332752
|
var import_services = __toESM(require_lib27(), 1);
|
332477
332753
|
if (!globalThis.fetch) {
|
332478
332754
|
globalThis.fetch = fetch2;
|
@@ -332485,13 +332761,23 @@ var API_URL = "https://api.mystmd.org";
|
|
332485
332761
|
var NPM_COMMAND = "npm i -g mystmd@latest";
|
332486
332762
|
var PIP_COMMAND = "pip install -U mystmd";
|
332487
332763
|
var LOCALHOSTS = ["localhost", "127.0.0.1", "::1"];
|
332488
|
-
function
|
332764
|
+
function socialLink({ twitter, bsky }) {
|
332765
|
+
if (bsky) {
|
332766
|
+
return `Follow ${source_default.yellowBright(`@${bsky}`)} for updates!
|
332767
|
+
https://bsky.app/profile/${bsky}`;
|
332768
|
+
}
|
332769
|
+
if (twitter) {
|
332770
|
+
return `Follow ${source_default.yellowBright(`@${twitter}`)} for updates!
|
332771
|
+
https://x.com/${twitter}`;
|
332772
|
+
}
|
332773
|
+
return "";
|
332774
|
+
}
|
332775
|
+
function logUpdateAvailable({ current: current2, latest: latest2, upgradeCommand, twitter, bsky }) {
|
332489
332776
|
return boxen(`Update available! ${source_default.dim(`v${current2}`)} \u226B ${source_default.green.bold(`v${latest2}`)}
|
332490
332777
|
|
332491
332778
|
Run \`${source_default.cyanBright.bold(upgradeCommand)}\` to update.
|
332492
332779
|
|
332493
|
-
|
332494
|
-
https://twitter.com/${twitter}`, {
|
332780
|
+
${socialLink({ bsky, twitter })}`, {
|
332495
332781
|
padding: 1,
|
332496
332782
|
margin: 1,
|
332497
332783
|
borderColor: "green",
|
@@ -332510,7 +332796,7 @@ var Session = class {
|
|
332510
332796
|
this.API_URL = API_URL;
|
332511
332797
|
this.configFiles = CONFIG_FILES;
|
332512
332798
|
this.$logger = (_a6 = opts.logger) !== null && _a6 !== void 0 ? _a6 : chalkLogger(LogLevel.info, process.cwd());
|
332513
|
-
this.doiLimiter = (_b = opts.doiLimiter) !== null && _b !== void 0 ? _b : (0,
|
332799
|
+
this.doiLimiter = (_b = opts.doiLimiter) !== null && _b !== void 0 ? _b : (0, import_p_limit3.default)(3);
|
332514
332800
|
const proxyUrl = process.env.HTTPS_PROXY;
|
332515
332801
|
if (proxyUrl)
|
332516
332802
|
this.proxyAgent = new import_https_proxy_agent.HttpsProxyAgent(proxyUrl);
|
@@ -332526,7 +332812,7 @@ var Session = class {
|
|
332526
332812
|
current: version_default2,
|
332527
332813
|
latest: this._latestVersion,
|
332528
332814
|
upgradeCommand: process.env.MYST_LANG === "PYTHON" ? PIP_COMMAND : NPM_COMMAND,
|
332529
|
-
|
332815
|
+
bsky: "mystmd.org"
|
332530
332816
|
}));
|
332531
332817
|
this._shownUpgrade = true;
|
332532
332818
|
}
|