mystmd 1.3.23__tar.gz → 1.3.25__tar.gz
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.23 → mystmd-1.3.25}/PKG-INFO +1 -1
- {mystmd-1.3.23 → mystmd-1.3.25}/_package.json +2 -2
- {mystmd-1.3.23 → mystmd-1.3.25}/src/mystmd_py/myst.cjs +389 -120
- {mystmd-1.3.23 → mystmd-1.3.25}/.gitignore +0 -0
- {mystmd-1.3.23 → mystmd-1.3.25}/LICENSE +0 -0
- {mystmd-1.3.23 → mystmd-1.3.25}/README.md +0 -0
- {mystmd-1.3.23 → mystmd-1.3.25}/pyproject.toml +0 -0
- {mystmd-1.3.23 → mystmd-1.3.25}/src/mystmd_py/__init__.py +0 -0
- {mystmd-1.3.23 → mystmd-1.3.25}/src/mystmd_py/main.py +0 -0
- {mystmd-1.3.23 → mystmd-1.3.25}/src/mystmd_py/nodeenv.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mystmd",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.25",
|
4
4
|
"description": "Command line tools for MyST Markdown",
|
5
5
|
"author": "Rowan Cockett <rowan@curvenote.com>",
|
6
6
|
"license": "MIT",
|
@@ -45,6 +45,6 @@
|
|
45
45
|
"commander": "^10.0.1",
|
46
46
|
"core-js": "^3.31.1",
|
47
47
|
"js-yaml": "^4.1.0",
|
48
|
-
"myst-cli": "^1.3.
|
48
|
+
"myst-cli": "^1.3.25"
|
49
49
|
}
|
50
50
|
}
|
@@ -48855,7 +48855,7 @@ var require_input4 = __commonJS({
|
|
48855
48855
|
var { nanoid: nanoid3 } = require_non_secure();
|
48856
48856
|
var { isAbsolute, resolve: resolve9 } = require("path");
|
48857
48857
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
48858
|
-
var { fileURLToPath: fileURLToPath5, pathToFileURL } = require("url");
|
48858
|
+
var { fileURLToPath: fileURLToPath5, pathToFileURL: pathToFileURL2 } = require("url");
|
48859
48859
|
var CssSyntaxError = require_css_syntax_error();
|
48860
48860
|
var PreviousMap = require_previous_map();
|
48861
48861
|
var terminalHighlight = require_terminal_highlight();
|
@@ -48944,8 +48944,8 @@ var require_input4 = __commonJS({
|
|
48944
48944
|
}
|
48945
48945
|
result.input = { column, endColumn, endLine, line: line2, source: this.css };
|
48946
48946
|
if (this.file) {
|
48947
|
-
if (
|
48948
|
-
result.input.url =
|
48947
|
+
if (pathToFileURL2) {
|
48948
|
+
result.input.url = pathToFileURL2(this.file).toString();
|
48949
48949
|
}
|
48950
48950
|
result.input.file = this.file;
|
48951
48951
|
}
|
@@ -49008,11 +49008,11 @@ var require_input4 = __commonJS({
|
|
49008
49008
|
}
|
49009
49009
|
let fromUrl;
|
49010
49010
|
if (isAbsolute(from4.source)) {
|
49011
|
-
fromUrl =
|
49011
|
+
fromUrl = pathToFileURL2(from4.source);
|
49012
49012
|
} else {
|
49013
49013
|
fromUrl = new URL(
|
49014
49014
|
from4.source,
|
49015
|
-
this.map.consumer().sourceRoot ||
|
49015
|
+
this.map.consumer().sourceRoot || pathToFileURL2(this.map.mapFile)
|
49016
49016
|
);
|
49017
49017
|
}
|
49018
49018
|
let result = {
|
@@ -49267,7 +49267,7 @@ var require_map_generator = __commonJS({
|
|
49267
49267
|
"use strict";
|
49268
49268
|
var { dirname: dirname8, relative: relative6, resolve: resolve9, sep: sep5 } = require("path");
|
49269
49269
|
var { SourceMapConsumer, SourceMapGenerator } = require_source_map();
|
49270
|
-
var { pathToFileURL } = require("url");
|
49270
|
+
var { pathToFileURL: pathToFileURL2 } = require("url");
|
49271
49271
|
var Input = require_input4();
|
49272
49272
|
var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
|
49273
49273
|
var pathAvailable = Boolean(dirname8 && resolve9 && relative6 && sep5);
|
@@ -49565,8 +49565,8 @@ var require_map_generator = __commonJS({
|
|
49565
49565
|
let cached = this.memoizedFileURLs.get(path44);
|
49566
49566
|
if (cached)
|
49567
49567
|
return cached;
|
49568
|
-
if (
|
49569
|
-
let fileURL =
|
49568
|
+
if (pathToFileURL2) {
|
49569
|
+
let fileURL = pathToFileURL2(path44).toString();
|
49570
49570
|
this.memoizedFileURLs.set(path44, fileURL);
|
49571
49571
|
return fileURL;
|
49572
49572
|
} else {
|
@@ -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.25";
|
193895
193895
|
var version_default = version;
|
193896
193896
|
|
193897
193897
|
// ../myst-cli/dist/build/build.js
|
@@ -194769,10 +194769,10 @@ var doiOrg = {
|
|
194769
194769
|
};
|
194770
194770
|
var elife = {
|
194771
194771
|
test(url) {
|
194772
|
-
return url.hostname.endsWith("elifesciences.org") && url.pathname
|
194772
|
+
return url.hostname.endsWith("elifesciences.org") && /^\/(?:articles|reviewed-preprints)\/\d+$/.test(url.pathname);
|
194773
194773
|
},
|
194774
194774
|
parse(url) {
|
194775
|
-
return `10.7554/eLife.${url.pathname.replace(
|
194775
|
+
return `10.7554/eLife.${url.pathname.replace(/^\/(?:articles|reviewed-preprints)\//, "")}`;
|
194776
194776
|
}
|
194777
194777
|
};
|
194778
194778
|
var zenodo = {
|
@@ -195602,7 +195602,8 @@ var PAGE_FRONTMATTER_KEYS = [
|
|
195602
195602
|
"tags",
|
195603
195603
|
"site",
|
195604
195604
|
"enumerator",
|
195605
|
-
"content_includes_title"
|
195605
|
+
"content_includes_title",
|
195606
|
+
"skip_execution"
|
195606
195607
|
];
|
195607
195608
|
|
195608
195609
|
// ../myst-frontmatter/dist/exports/types.js
|
@@ -199691,6 +199692,9 @@ function validatePageFrontmatterKeys(value, opts) {
|
|
199691
199692
|
if (defined(value.jupytext)) {
|
199692
199693
|
output2.jupytext = validateJupytext(value.jupytext, incrementOptions("jupytext", opts));
|
199693
199694
|
}
|
199695
|
+
if (defined(value.skip_execution)) {
|
199696
|
+
output2.skip_execution = validateBoolean(value.skip_execution, incrementOptions("skip_execution", opts));
|
199697
|
+
}
|
199694
199698
|
if (defined(value.enumerator)) {
|
199695
199699
|
output2.enumerator = validateString(value.enumerator, incrementOptions("enumerator", opts));
|
199696
199700
|
}
|
@@ -205546,7 +205550,6 @@ var TRANSFORM_SOURCE = "myst-transforms:footnotes";
|
|
205546
205550
|
function footnotesTransform(mdast2, file) {
|
205547
205551
|
const footnotes = selectAll("footnoteDefinition", mdast2);
|
205548
205552
|
const footnotesLookup = Object.fromEntries(footnotes.map((n) => {
|
205549
|
-
delete n.number;
|
205550
205553
|
return [n.identifier, n];
|
205551
205554
|
}));
|
205552
205555
|
const references = selectAll("footnoteReference", mdast2);
|
@@ -205571,20 +205574,15 @@ function footnotesTransform(mdast2, file) {
|
|
205571
205574
|
return;
|
205572
205575
|
}
|
205573
205576
|
if (def.enumerator) {
|
205574
|
-
node3.number = def.number;
|
205575
205577
|
node3.enumerator = def.enumerator;
|
205576
205578
|
return;
|
205577
205579
|
}
|
205578
205580
|
const identifierNumber = Number(node3.identifier);
|
205579
205581
|
if (!Number.isNaN(identifierNumber) && identifierNumber > 0) {
|
205580
|
-
def.number = identifierNumber;
|
205581
|
-
node3.number = identifierNumber;
|
205582
205582
|
def.enumerator = String(identifierNumber);
|
205583
205583
|
node3.enumerator = String(identifierNumber);
|
205584
205584
|
} else {
|
205585
205585
|
footnoteCount = nextNumber(footnoteCount, reserved);
|
205586
|
-
def.number = footnoteCount;
|
205587
|
-
node3.number = footnoteCount;
|
205588
205586
|
def.enumerator = String(footnoteCount);
|
205589
205587
|
node3.enumerator = String(footnoteCount);
|
205590
205588
|
}
|
@@ -237360,7 +237358,7 @@ var TRANSFORM_SOURCE2 = "BlockTransform:BlockMetadata";
|
|
237360
237358
|
function blockMetadataTransform(mdast2, file) {
|
237361
237359
|
const blocks2 = selectAll("block", mdast2);
|
237362
237360
|
blocks2.forEach((block5) => {
|
237363
|
-
var _a6, _b, _c;
|
237361
|
+
var _a6, _b, _c, _d2, _e;
|
237364
237362
|
if (block5.meta) {
|
237365
237363
|
try {
|
237366
237364
|
const data = JSON.parse(block5.meta);
|
@@ -237374,7 +237372,17 @@ function blockMetadataTransform(mdast2, file) {
|
|
237374
237372
|
});
|
237375
237373
|
}
|
237376
237374
|
}
|
237377
|
-
const
|
237375
|
+
const kind = (_a6 = block5.data) === null || _a6 === void 0 ? void 0 : _a6.kind;
|
237376
|
+
if (kind) {
|
237377
|
+
block5.kind = kind;
|
237378
|
+
delete block5.data.kind;
|
237379
|
+
}
|
237380
|
+
const className = (_b = block5.data) === null || _b === void 0 ? void 0 : _b.class;
|
237381
|
+
if (className) {
|
237382
|
+
block5.class = className;
|
237383
|
+
delete block5.data.class;
|
237384
|
+
}
|
237385
|
+
const label = (_d2 = (_c = block5.data) === null || _c === void 0 ? void 0 : _c.label) !== null && _d2 !== void 0 ? _d2 : (_e = block5.data) === null || _e === void 0 ? void 0 : _e.id;
|
237378
237386
|
if (typeof label === "string") {
|
237379
237387
|
const normalized = normalizeLabel(label);
|
237380
237388
|
if (normalized) {
|
@@ -238916,6 +238924,154 @@ async function headingDepthTransform(tree, vfile2, opts) {
|
|
238916
238924
|
});
|
238917
238925
|
}
|
238918
238926
|
|
238927
|
+
// ../myst-transforms/dist/toc.js
|
238928
|
+
function listFromPages(pages, projectSlug) {
|
238929
|
+
if (pages.length === 0)
|
238930
|
+
return { type: "list", children: [] };
|
238931
|
+
let ignore3 = false;
|
238932
|
+
const level = pages[0].level;
|
238933
|
+
const children = pages.map((page, index4) => {
|
238934
|
+
if (ignore3)
|
238935
|
+
return void 0;
|
238936
|
+
if (page.level < level)
|
238937
|
+
ignore3 = true;
|
238938
|
+
if (page.level !== level)
|
238939
|
+
return void 0;
|
238940
|
+
return listItemFromPages(pages.slice(index4), projectSlug);
|
238941
|
+
}).filter((item) => !!item);
|
238942
|
+
return { type: "list", children };
|
238943
|
+
}
|
238944
|
+
function listItemFromPages(pages, projectSlug) {
|
238945
|
+
if (pages.length === 0)
|
238946
|
+
return;
|
238947
|
+
const { title, slug, enumerator, level } = pages[0];
|
238948
|
+
const text7 = {
|
238949
|
+
type: "text",
|
238950
|
+
value: `${enumerator ? `${enumerator} ` : ""}${title}`
|
238951
|
+
};
|
238952
|
+
const child = slug != null ? {
|
238953
|
+
type: "link",
|
238954
|
+
url: `${projectSlug ? `/${projectSlug}` : ""}/${slug}`,
|
238955
|
+
internal: true,
|
238956
|
+
children: [text7]
|
238957
|
+
} : text7;
|
238958
|
+
const item = {
|
238959
|
+
type: "listItem",
|
238960
|
+
children: [child]
|
238961
|
+
};
|
238962
|
+
if (pages[1] && pages[1].level > level) {
|
238963
|
+
item.children.push(listFromPages(pages.slice(1), projectSlug));
|
238964
|
+
}
|
238965
|
+
return item;
|
238966
|
+
}
|
238967
|
+
function listFromHeadings(headings) {
|
238968
|
+
if (headings.length === 0)
|
238969
|
+
return { type: "list", children: [] };
|
238970
|
+
let ignore3 = false;
|
238971
|
+
const depth = headings[0].depth;
|
238972
|
+
const children = headings.map((heading6, index4) => {
|
238973
|
+
if (ignore3)
|
238974
|
+
return void 0;
|
238975
|
+
if (heading6.depth < depth)
|
238976
|
+
ignore3 = true;
|
238977
|
+
if (heading6.depth !== depth)
|
238978
|
+
return void 0;
|
238979
|
+
return listItemFromHeadings(headings.slice(index4));
|
238980
|
+
}).filter((item) => !!item);
|
238981
|
+
return { type: "list", children };
|
238982
|
+
}
|
238983
|
+
function listItemFromHeadings(headings) {
|
238984
|
+
if (headings.length === 0)
|
238985
|
+
return;
|
238986
|
+
const { children, enumerator, depth, identifier } = headings[0];
|
238987
|
+
const text7 = {
|
238988
|
+
type: "text",
|
238989
|
+
value: `${enumerator ? `${enumerator} ` : ""}${toText(children)}`
|
238990
|
+
};
|
238991
|
+
const child = identifier ? {
|
238992
|
+
type: "link",
|
238993
|
+
url: `#${identifier}`,
|
238994
|
+
internal: true,
|
238995
|
+
children: [text7],
|
238996
|
+
suppressImplicitWarning: true
|
238997
|
+
} : text7;
|
238998
|
+
const item = {
|
238999
|
+
type: "listItem",
|
239000
|
+
children: [child]
|
239001
|
+
};
|
239002
|
+
if (headings[1] && headings[1].depth > depth) {
|
239003
|
+
item.children.push(listFromHeadings(headings.slice(1)));
|
239004
|
+
}
|
239005
|
+
return item;
|
239006
|
+
}
|
239007
|
+
function buildTocTransform(mdast2, vfile2, pages, projectSlug) {
|
239008
|
+
const tocHeadings = selectAll("toc > heading", mdast2);
|
239009
|
+
const tocsAndHeadings = selectAll("toc,heading", mdast2).filter((item) => {
|
239010
|
+
return !tocHeadings.includes(item);
|
239011
|
+
});
|
239012
|
+
if (!tocsAndHeadings.find((node3) => node3.type === "toc"))
|
239013
|
+
return;
|
239014
|
+
const projectTocs = tocsAndHeadings.filter((node3) => node3.type === "toc" && node3.kind === "project");
|
239015
|
+
const pageTocs = tocsAndHeadings.filter((node3) => node3.type === "toc" && node3.kind === "page");
|
239016
|
+
const sectionTocs = tocsAndHeadings.filter((node3) => node3.type === "toc" && node3.kind === "section");
|
239017
|
+
if (projectTocs.length) {
|
239018
|
+
if (!pages) {
|
239019
|
+
fileError(vfile2, `Pages not available to build Table of Contents`);
|
239020
|
+
} else {
|
239021
|
+
if (pages[0].level !== 1) {
|
239022
|
+
fileWarn(vfile2, `First page of Table of Contents must be level 1`);
|
239023
|
+
}
|
239024
|
+
projectTocs.forEach((toc) => {
|
239025
|
+
const filteredPages = toc.depth ? pages.filter((page) => page.level <= toc.depth) : pages;
|
239026
|
+
toc.type = "block";
|
239027
|
+
delete toc.kind;
|
239028
|
+
toc.data = { part: "toc:project" };
|
239029
|
+
if (!toc.children)
|
239030
|
+
toc.children = [];
|
239031
|
+
toc.children.push(listFromPages(filteredPages, projectSlug));
|
239032
|
+
});
|
239033
|
+
}
|
239034
|
+
}
|
239035
|
+
if (pageTocs.length) {
|
239036
|
+
const headings = tocsAndHeadings.filter((node3) => node3.type === "heading");
|
239037
|
+
if (headings.length === 0) {
|
239038
|
+
fileWarn(vfile2, `No page headings found for Table of Contents`);
|
239039
|
+
} else {
|
239040
|
+
if (Math.min(...headings.map((h4) => h4.depth)) !== headings[0].depth) {
|
239041
|
+
fileWarn(vfile2, "Page heading levels do not start with highest level");
|
239042
|
+
}
|
239043
|
+
pageTocs.forEach((toc) => {
|
239044
|
+
const filteredHeadings = toc.depth ? headings.filter((heading6) => heading6.depth - headings[0].depth < toc.depth) : headings;
|
239045
|
+
toc.type = "block";
|
239046
|
+
delete toc.kind;
|
239047
|
+
toc.data = { part: "toc:page" };
|
239048
|
+
if (!toc.children)
|
239049
|
+
toc.children = [];
|
239050
|
+
toc.children.push(listFromHeadings(filteredHeadings));
|
239051
|
+
});
|
239052
|
+
}
|
239053
|
+
}
|
239054
|
+
if (sectionTocs.length) {
|
239055
|
+
tocsAndHeadings.forEach((toc, index4) => {
|
239056
|
+
if (toc.type !== "toc" || toc.kind !== "section")
|
239057
|
+
return;
|
239058
|
+
const headings = tocsAndHeadings.slice(index4 + 1).filter((h4) => h4.type === "heading");
|
239059
|
+
if (headings.length === 0) {
|
239060
|
+
fileWarn(vfile2, `No section headings found for Table of Contents`);
|
239061
|
+
} else {
|
239062
|
+
const filteredHeadings = toc.depth ? headings.filter((heading6) => heading6.depth - headings[0].depth < toc.depth) : headings;
|
239063
|
+
toc.type = "block";
|
239064
|
+
delete toc.kind;
|
239065
|
+
toc.data = { part: "toc:section" };
|
239066
|
+
if (!toc.children)
|
239067
|
+
toc.children = [];
|
239068
|
+
const nextSection = filteredHeadings.findIndex((h4) => h4.depth < filteredHeadings[0].depth);
|
239069
|
+
toc.children.push(listFromHeadings(nextSection === -1 ? filteredHeadings : filteredHeadings.slice(0, nextSection)));
|
239070
|
+
}
|
239071
|
+
});
|
239072
|
+
}
|
239073
|
+
}
|
239074
|
+
|
238919
239075
|
// ../myst-transforms/dist/enumerate.js
|
238920
239076
|
var TRANSFORM_NAME2 = "myst-transforms:enumerate";
|
238921
239077
|
var DEFAULT_NUMBERING = {
|
@@ -239378,7 +239534,7 @@ function addContainerCaptionNumbersTransform(tree, file, opts) {
|
|
239378
239534
|
});
|
239379
239535
|
}
|
239380
239536
|
function implicitTargetWarning(target, node3, opts) {
|
239381
|
-
if (target.node.implicit && opts.state.vfile) {
|
239537
|
+
if (target.node.implicit && opts.state.vfile && !node3.suppressImplicitWarning) {
|
239382
239538
|
fileWarn(opts.state.vfile, `Linking "${target.node.identifier}" to an implicit ${target.kind} reference, best practice is to create an explicit reference.`, {
|
239383
239539
|
node: node3,
|
239384
239540
|
note: "Explicit references do not break when you update the title to a section, they are preferred over using the implicit HTML ID created for headers.",
|
@@ -239386,6 +239542,7 @@ function implicitTargetWarning(target, node3, opts) {
|
|
239386
239542
|
ruleId: RuleId.referenceTargetExplicit
|
239387
239543
|
});
|
239388
239544
|
}
|
239545
|
+
delete node3.suppressImplicitWarning;
|
239389
239546
|
}
|
239390
239547
|
var resolveReferenceLinksTransform = (tree, opts) => {
|
239391
239548
|
selectAll("link", tree).forEach((node3) => {
|
@@ -282455,33 +282612,26 @@ var includeDirective = {
|
|
282455
282612
|
var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
282456
282613
|
const literal = data.name === "literalinclude" || !!((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.literal) || !!((_b = data.options) === null || _b === void 0 ? void 0 : _b.lang);
|
282457
282614
|
const file = data.arg;
|
282458
|
-
if (!literal) {
|
282459
|
-
const include4 = {
|
282460
|
-
type: "include",
|
282461
|
-
file
|
282462
|
-
};
|
282463
|
-
addCommonDirectiveOptions(data, include4);
|
282464
|
-
return [include4];
|
282465
|
-
}
|
282466
282615
|
const lang = (_d2 = (_c = data.options) === null || _c === void 0 ? void 0 : _c.lang) !== null && _d2 !== void 0 ? _d2 : extToLanguage(file.split(".").pop());
|
282467
|
-
const opts = getCodeBlockOptions(
|
282616
|
+
const opts = literal ? getCodeBlockOptions(
|
282468
282617
|
data,
|
282469
282618
|
vfile2,
|
282470
282619
|
// Set the filename in the literal include by default
|
282471
282620
|
file.split(/\/|\\/).pop()
|
282472
|
-
);
|
282621
|
+
) : {};
|
282622
|
+
const caption3 = literal ? (_e = data.options) === null || _e === void 0 ? void 0 : _e.caption : void 0;
|
282473
282623
|
const filter7 = {};
|
282474
282624
|
ensureOnlyOneOf(data, vfile2, ["start-at", "start-line", "start-after", "lines"]);
|
282475
282625
|
ensureOnlyOneOf(data, vfile2, ["end-at", "end-line", "end-before", "lines"]);
|
282476
|
-
filter7.startAt = (
|
282477
|
-
filter7.startAfter = (
|
282478
|
-
filter7.endAt = (
|
282479
|
-
filter7.endBefore = (
|
282480
|
-
if ((
|
282481
|
-
filter7.lines = parseLinesString(vfile2, (
|
282626
|
+
filter7.startAt = (_f = data.options) === null || _f === void 0 ? void 0 : _f["start-at"];
|
282627
|
+
filter7.startAfter = (_g = data.options) === null || _g === void 0 ? void 0 : _g["start-after"];
|
282628
|
+
filter7.endAt = (_h = data.options) === null || _h === void 0 ? void 0 : _h["end-at"];
|
282629
|
+
filter7.endBefore = (_j = data.options) === null || _j === void 0 ? void 0 : _j["end-before"];
|
282630
|
+
if ((_k = data.options) === null || _k === void 0 ? void 0 : _k.lines) {
|
282631
|
+
filter7.lines = parseLinesString(vfile2, (_l = select('mystDirectiveOption[name="lines"]', data.node)) !== null && _l !== void 0 ? _l : void 0, (_m = data.options) === null || _m === void 0 ? void 0 : _m.lines);
|
282482
282632
|
} else {
|
282483
|
-
const startLine = (
|
282484
|
-
const endLine = (
|
282633
|
+
const startLine = (_o = data.options) === null || _o === void 0 ? void 0 : _o["start-line"];
|
282634
|
+
const endLine = (_p = data.options) === null || _p === void 0 ? void 0 : _p["end-line"];
|
282485
282635
|
const lines = [];
|
282486
282636
|
if (startLine != null)
|
282487
282637
|
lines.push(startLine);
|
@@ -282499,13 +282649,14 @@ var includeDirective = {
|
|
282499
282649
|
];
|
282500
282650
|
}
|
282501
282651
|
}
|
282652
|
+
const usesFilter = Object.values(filter7).some((value) => value !== void 0);
|
282502
282653
|
const include3 = {
|
282503
282654
|
type: "include",
|
282504
282655
|
file,
|
282505
282656
|
literal,
|
282506
282657
|
lang,
|
282507
|
-
caption:
|
282508
|
-
filter:
|
282658
|
+
caption: caption3,
|
282659
|
+
filter: usesFilter ? filter7 : void 0,
|
282509
282660
|
...opts
|
282510
282661
|
};
|
282511
282662
|
addCommonDirectiveOptions(data, include3);
|
@@ -282658,7 +282809,8 @@ var genIndexDirective = {
|
|
282658
282809
|
} else {
|
282659
282810
|
children.push({
|
282660
282811
|
type: "heading",
|
282661
|
-
depth:
|
282812
|
+
depth: 2,
|
282813
|
+
enumerated: false,
|
282662
282814
|
children: parsedArg
|
282663
282815
|
});
|
282664
282816
|
}
|
@@ -286150,6 +286302,61 @@ var divDirective = {
|
|
286150
286302
|
}
|
286151
286303
|
};
|
286152
286304
|
|
286305
|
+
// ../myst-directives/dist/toc.js
|
286306
|
+
var CONTEXTS = ["project", "page", "section"];
|
286307
|
+
var tocDirective = {
|
286308
|
+
name: "toc",
|
286309
|
+
doc: "Inserts table of contents in the page. This may be for the project (each page has an entry), the current page (each heading has an entry), or the current section (only headings in the section have an entry).",
|
286310
|
+
alias: ["tableofcontents", "table-of-contents", "toctree", "contents"],
|
286311
|
+
arg: {
|
286312
|
+
type: "myst",
|
286313
|
+
doc: "Heading to be included with table of contents"
|
286314
|
+
},
|
286315
|
+
options: {
|
286316
|
+
context: {
|
286317
|
+
type: String,
|
286318
|
+
doc: "Table of Contents context; one of project, page, or section",
|
286319
|
+
alias: ["kind"]
|
286320
|
+
},
|
286321
|
+
depth: {
|
286322
|
+
type: Number,
|
286323
|
+
doc: "Number of levels to include in Table of Contents; by default, all levels will be included",
|
286324
|
+
alias: ["maxdepth"]
|
286325
|
+
},
|
286326
|
+
...commonDirectiveOptions("toc")
|
286327
|
+
},
|
286328
|
+
run(data, vfile2) {
|
286329
|
+
var _a6, _b, _c;
|
286330
|
+
let context = ((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.context) ? data.options.context : data.name === "contents" ? "section" : "project";
|
286331
|
+
if (!CONTEXTS.includes(context)) {
|
286332
|
+
fileError(vfile2, `Unknown context for ${data.name} directive: ${context}`);
|
286333
|
+
context = "project";
|
286334
|
+
}
|
286335
|
+
let depth = (_b = data.options) === null || _b === void 0 ? void 0 : _b.depth;
|
286336
|
+
if (depth != null && depth < 1) {
|
286337
|
+
fileError(vfile2, `Table of Contents 'depth' must be a number greater than 0`);
|
286338
|
+
depth = void 0;
|
286339
|
+
}
|
286340
|
+
const children = [];
|
286341
|
+
if (data.arg) {
|
286342
|
+
const parsedArg = data.arg;
|
286343
|
+
if (((_c = parsedArg[0]) === null || _c === void 0 ? void 0 : _c.type) === "heading") {
|
286344
|
+
children.push(...parsedArg);
|
286345
|
+
} else {
|
286346
|
+
children.push({
|
286347
|
+
type: "heading",
|
286348
|
+
depth: 2,
|
286349
|
+
enumerated: false,
|
286350
|
+
children: parsedArg
|
286351
|
+
});
|
286352
|
+
}
|
286353
|
+
}
|
286354
|
+
const toc = { type: "toc", kind: context, depth, children };
|
286355
|
+
addCommonDirectiveOptions(data, toc);
|
286356
|
+
return [toc];
|
286357
|
+
}
|
286358
|
+
};
|
286359
|
+
|
286153
286360
|
// ../myst-directives/dist/index.js
|
286154
286361
|
var defaultDirectives = [
|
286155
286362
|
admonitionDirective,
|
@@ -286177,7 +286384,8 @@ var defaultDirectives = [
|
|
286177
286384
|
rawDirective,
|
286178
286385
|
rawLatexDirective,
|
286179
286386
|
rawTypstDirective,
|
286180
|
-
divDirective
|
286387
|
+
divDirective,
|
286388
|
+
tocDirective
|
286181
286389
|
];
|
286182
286390
|
|
286183
286391
|
// ../myst-roles/dist/abbreviation.js
|
@@ -289547,7 +289755,7 @@ var import_node_path16 = __toESM(require("path"), 1);
|
|
289547
289755
|
var import_nbtx = __toESM(require_cjs2(), 1);
|
289548
289756
|
|
289549
289757
|
// ../myst-cli/dist/version.js
|
289550
|
-
var version2 = "1.3.
|
289758
|
+
var version2 = "1.3.25";
|
289551
289759
|
var version_default2 = version2;
|
289552
289760
|
|
289553
289761
|
// ../myst-cli/dist/utils/headers.js
|
@@ -300032,6 +300240,9 @@ var Domains;
|
|
300032
300240
|
var import_node_fs24 = __toESM(require("fs"), 1);
|
300033
300241
|
var import_node_path29 = __toESM(require("path"), 1);
|
300034
300242
|
|
300243
|
+
// ../myst-cli/dist/spec-version.js
|
300244
|
+
var SPEC_VERSION = 1;
|
300245
|
+
|
300035
300246
|
// ../myst-cli/dist/build/site/template.js
|
300036
300247
|
var import_node_fs22 = __toESM(require("fs"), 1);
|
300037
300248
|
var import_node_path26 = require("path");
|
@@ -301413,6 +301624,71 @@ async function collectExportOptions(session, files, formats, opts) {
|
|
301413
301624
|
return filterAndMakeUnique(exportOptionsList);
|
301414
301625
|
}
|
301415
301626
|
|
301627
|
+
// ../myst-cli/dist/build/utils/projectManifest.js
|
301628
|
+
async function manifestPagesFromProject(session, projectPath) {
|
301629
|
+
const state = session.store.getState();
|
301630
|
+
const proj = selectors_exports.selectLocalProject(state, projectPath);
|
301631
|
+
if (!proj)
|
301632
|
+
return [];
|
301633
|
+
const cache = castSession(session);
|
301634
|
+
const pages = await Promise.all(proj.pages.map(async (page) => {
|
301635
|
+
var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k;
|
301636
|
+
if ("file" in page) {
|
301637
|
+
const fileInfo3 = selectors_exports.selectFileInfo(state, page.file);
|
301638
|
+
const title = fileInfo3.title || fileTitle(page.file);
|
301639
|
+
const short_title = (_a6 = fileInfo3.short_title) !== null && _a6 !== void 0 ? _a6 : void 0;
|
301640
|
+
const description = (_b = fileInfo3.description) !== null && _b !== void 0 ? _b : "";
|
301641
|
+
const thumbnail = (_c = fileInfo3.thumbnail) !== null && _c !== void 0 ? _c : "";
|
301642
|
+
const thumbnailOptimized = (_d2 = fileInfo3.thumbnailOptimized) !== null && _d2 !== void 0 ? _d2 : "";
|
301643
|
+
const banner = (_e = fileInfo3.banner) !== null && _e !== void 0 ? _e : "";
|
301644
|
+
const bannerOptimized = (_f = fileInfo3.bannerOptimized) !== null && _f !== void 0 ? _f : "";
|
301645
|
+
const date = (_g = fileInfo3.date) !== null && _g !== void 0 ? _g : "";
|
301646
|
+
const tags = (_h = fileInfo3.tags) !== null && _h !== void 0 ? _h : [];
|
301647
|
+
const { slug, level, file } = page;
|
301648
|
+
const { frontmatter } = (_k = (_j = cache.$getMdast(file)) === null || _j === void 0 ? void 0 : _j.post) !== null && _k !== void 0 ? _k : {};
|
301649
|
+
const projectPage = {
|
301650
|
+
slug,
|
301651
|
+
title,
|
301652
|
+
short_title,
|
301653
|
+
description,
|
301654
|
+
date,
|
301655
|
+
thumbnail,
|
301656
|
+
thumbnailOptimized,
|
301657
|
+
banner,
|
301658
|
+
bannerOptimized,
|
301659
|
+
tags,
|
301660
|
+
level,
|
301661
|
+
enumerator: frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.enumerator
|
301662
|
+
};
|
301663
|
+
return projectPage;
|
301664
|
+
}
|
301665
|
+
return { ...page };
|
301666
|
+
}));
|
301667
|
+
return pages;
|
301668
|
+
}
|
301669
|
+
function manifestTitleFromProject(session, projectPath) {
|
301670
|
+
const state = session.store.getState();
|
301671
|
+
const projConfig = selectors_exports.selectLocalProjectConfig(state, projectPath);
|
301672
|
+
if (projConfig === null || projConfig === void 0 ? void 0 : projConfig.title)
|
301673
|
+
return projConfig.title;
|
301674
|
+
const proj = selectors_exports.selectLocalProject(state, projectPath);
|
301675
|
+
if (!proj)
|
301676
|
+
return "Untitled";
|
301677
|
+
const projectFileInfo = selectors_exports.selectFileInfo(session.store.getState(), proj.file);
|
301678
|
+
return projectFileInfo.title || proj.index || "Untitled";
|
301679
|
+
}
|
301680
|
+
function indexFrontmatterFromProject(session, projectPath) {
|
301681
|
+
var _a6, _b;
|
301682
|
+
const state = session.store.getState();
|
301683
|
+
const cache = castSession(session);
|
301684
|
+
const proj = selectors_exports.selectLocalProject(state, projectPath);
|
301685
|
+
if (!proj)
|
301686
|
+
return {};
|
301687
|
+
const { file } = proj;
|
301688
|
+
const { frontmatter } = (_b = (_a6 = cache.$getMdast(file)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
|
301689
|
+
return frontmatter !== null && frontmatter !== void 0 ? frontmatter : {};
|
301690
|
+
}
|
301691
|
+
|
301416
301692
|
// ../myst-cli/dist/build/site/manifest.js
|
301417
301693
|
async function resolvePageExports(session, file) {
|
301418
301694
|
const exports2 = (await collectExportOptions(session, [file], [
|
@@ -301479,7 +301755,6 @@ async function resolvePageDownloads(session, file, projectPath) {
|
|
301479
301755
|
return resolvedDownloads;
|
301480
301756
|
}
|
301481
301757
|
async function localToManifestProject(session, projectPath, projectSlug) {
|
301482
|
-
var _a6, _b;
|
301483
301758
|
if (!projectPath)
|
301484
301759
|
return null;
|
301485
301760
|
const state = session.store.getState();
|
@@ -301487,43 +301762,9 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301487
301762
|
const proj = selectors_exports.selectLocalProject(state, projectPath);
|
301488
301763
|
if (!proj)
|
301489
301764
|
return null;
|
301490
|
-
const { index: index4
|
301765
|
+
const { index: index4 } = proj;
|
301491
301766
|
const projectFileInfo = selectors_exports.selectFileInfo(state, proj.file);
|
301492
|
-
const
|
301493
|
-
const cache = castSession(session);
|
301494
|
-
const pages = await Promise.all(proj.pages.map(async (page) => {
|
301495
|
-
var _a7, _b2, _c, _d2, _e, _f, _g, _h, _j, _k;
|
301496
|
-
if ("file" in page) {
|
301497
|
-
const fileInfo3 = selectors_exports.selectFileInfo(state, page.file);
|
301498
|
-
const title = fileInfo3.title || fileTitle(page.file);
|
301499
|
-
const short_title = (_a7 = fileInfo3.short_title) !== null && _a7 !== void 0 ? _a7 : void 0;
|
301500
|
-
const description = (_b2 = fileInfo3.description) !== null && _b2 !== void 0 ? _b2 : "";
|
301501
|
-
const thumbnail2 = (_c = fileInfo3.thumbnail) !== null && _c !== void 0 ? _c : "";
|
301502
|
-
const thumbnailOptimized = (_d2 = fileInfo3.thumbnailOptimized) !== null && _d2 !== void 0 ? _d2 : "";
|
301503
|
-
const banner2 = (_e = fileInfo3.banner) !== null && _e !== void 0 ? _e : "";
|
301504
|
-
const bannerOptimized = (_f = fileInfo3.bannerOptimized) !== null && _f !== void 0 ? _f : "";
|
301505
|
-
const date = (_g = fileInfo3.date) !== null && _g !== void 0 ? _g : "";
|
301506
|
-
const tags = (_h = fileInfo3.tags) !== null && _h !== void 0 ? _h : [];
|
301507
|
-
const { slug, level, file } = page;
|
301508
|
-
const { frontmatter: frontmatter2 } = (_k = (_j = cache.$getMdast(file)) === null || _j === void 0 ? void 0 : _j.post) !== null && _k !== void 0 ? _k : {};
|
301509
|
-
const projectPage = {
|
301510
|
-
slug,
|
301511
|
-
title,
|
301512
|
-
short_title,
|
301513
|
-
description,
|
301514
|
-
date,
|
301515
|
-
thumbnail: thumbnail2,
|
301516
|
-
thumbnailOptimized,
|
301517
|
-
banner: banner2,
|
301518
|
-
bannerOptimized,
|
301519
|
-
tags,
|
301520
|
-
level,
|
301521
|
-
enumerator: frontmatter2 === null || frontmatter2 === void 0 ? void 0 : frontmatter2.enumerator
|
301522
|
-
};
|
301523
|
-
return projectPage;
|
301524
|
-
}
|
301525
|
-
return { ...page };
|
301526
|
-
}));
|
301767
|
+
const pages = await manifestPagesFromProject(session, projectPath);
|
301527
301768
|
const projFrontmatter = projConfig ? filterKeys(projConfig, PROJECT_FRONTMATTER_KEYS) : {};
|
301528
301769
|
const projConfigFile = selectors_exports.selectLocalConfigFile(state, projectPath);
|
301529
301770
|
const exports2 = projConfigFile ? await resolvePageExports(session, projConfigFile) : [];
|
@@ -301531,7 +301772,7 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301531
301772
|
const parts = resolveFrontmatterParts(session, projFrontmatter);
|
301532
301773
|
const banner = await transformBanner(session, import_node_path29.default.join(projectPath, "myst.yml"), projFrontmatter, session.publicPath(), { altOutputFolder: "/", webp: true });
|
301533
301774
|
const thumbnail = await transformThumbnail(session, null, import_node_path29.default.join(projectPath, "myst.yml"), projFrontmatter, session.publicPath(), { altOutputFolder: "/", webp: true });
|
301534
|
-
const
|
301775
|
+
const frontmatter = indexFrontmatterFromProject(session, projectPath);
|
301535
301776
|
return {
|
301536
301777
|
...projFrontmatter,
|
301537
301778
|
// TODO: a null in the project frontmatter should not fall back to index page
|
@@ -301544,7 +301785,7 @@ async function localToManifestProject(session, projectPath, projectSlug) {
|
|
301544
301785
|
downloads,
|
301545
301786
|
parts,
|
301546
301787
|
bibliography: projFrontmatter.bibliography || [],
|
301547
|
-
title:
|
301788
|
+
title: manifestTitleFromProject(session, projectPath),
|
301548
301789
|
slug: projectSlug,
|
301549
301790
|
index: index4,
|
301550
301791
|
enumerator: frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.enumerator,
|
@@ -301659,9 +301900,10 @@ async function getSiteManifest(session, opts) {
|
|
301659
301900
|
validatedFrontmatter.options = resolvedOptions;
|
301660
301901
|
const parts = resolveFrontmatterParts(session, validatedFrontmatter);
|
301661
301902
|
const manifest = {
|
301903
|
+
version: SPEC_VERSION,
|
301904
|
+
myst: version_default2,
|
301662
301905
|
...validatedFrontmatter,
|
301663
301906
|
parts,
|
301664
|
-
myst: version_default2,
|
301665
301907
|
nav: nav || [],
|
301666
301908
|
actions: actions || [],
|
301667
301909
|
projects: siteProjects
|
@@ -304300,7 +304542,7 @@ async function transformMdast(session, opts) {
|
|
304300
304542
|
rendererFiles.push(...localFiles);
|
304301
304543
|
}
|
304302
304544
|
const fileCitationRenderer = combineCitationRenderers(cache, ...rendererFiles);
|
304303
|
-
if (execute) {
|
304545
|
+
if (execute && !frontmatter.skip_execution) {
|
304304
304546
|
const cachePath2 = import_node_path39.default.join(session.buildPath(), "execute");
|
304305
304547
|
await kernelExecutionTransform(mdast2, vfile2, {
|
304306
304548
|
basePath: session.sourcePath(),
|
@@ -304360,8 +304602,8 @@ async function transformMdast(session, opts) {
|
|
304360
304602
|
if (!watchMode)
|
304361
304603
|
log.info(toc(`\u{1F4D6} Built ${file} in %s.`));
|
304362
304604
|
}
|
304363
|
-
async function postProcessMdast(session, { file, checkLinks, pageReferenceStates, extraLinkTransformers }) {
|
304364
|
-
var _a6;
|
304605
|
+
async function postProcessMdast(session, { file, checkLinks, pageReferenceStates, extraLinkTransformers, site }) {
|
304606
|
+
var _a6, _b, _c;
|
304365
304607
|
const toc = tic();
|
304366
304608
|
const { log } = session;
|
304367
304609
|
const cache = castSession(session);
|
@@ -304373,6 +304615,21 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
|
|
304373
304615
|
const { mdast: mdast2, dependencies, frontmatter } = mdastPost;
|
304374
304616
|
const state = new MultiPageReferenceResolver(pageReferenceStates, file, vfile2);
|
304375
304617
|
const externalReferences = Object.values(cache.$externalReferences);
|
304618
|
+
const storeState = session.store.getState();
|
304619
|
+
const projectPath = selectors_exports.selectCurrentProjectPath(storeState);
|
304620
|
+
const siteConfig = selectors_exports.selectCurrentSiteConfig(storeState);
|
304621
|
+
const projectSlug = (_b = (_a6 = siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.projects) === null || _a6 === void 0 ? void 0 : _a6.find((proj) => proj.path === projectPath)) === null || _b === void 0 ? void 0 : _b.slug;
|
304622
|
+
if (site) {
|
304623
|
+
buildTocTransform(mdast2, vfile2, projectPath ? [
|
304624
|
+
{
|
304625
|
+
title: manifestTitleFromProject(session, projectPath),
|
304626
|
+
level: 1,
|
304627
|
+
slug: "",
|
304628
|
+
enumerator: indexFrontmatterFromProject(session, projectPath).enumerator
|
304629
|
+
},
|
304630
|
+
...await manifestPagesFromProject(session, projectPath)
|
304631
|
+
] : void 0, projectSlug);
|
304632
|
+
}
|
304376
304633
|
const transformers = [
|
304377
304634
|
...extraLinkTransformers || [],
|
304378
304635
|
new WikiTransformer(),
|
@@ -304396,7 +304653,7 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
|
|
304396
304653
|
await transformMystXRefs(session, vfile2, mdast2, frontmatter);
|
304397
304654
|
await embedTransform(session, mdast2, file, dependencies, state);
|
304398
304655
|
const pipe = unified();
|
304399
|
-
(
|
304656
|
+
(_c = session.plugins) === null || _c === void 0 ? void 0 : _c.transforms.forEach((t2) => {
|
304400
304657
|
if (t2.stage !== "project")
|
304401
304658
|
return;
|
304402
304659
|
pipe.use(t2.plugin, void 0, pluginUtils);
|
@@ -304807,6 +305064,7 @@ async function writeFile(session, { file, pageSlug, projectSlug, projectPath })
|
|
304807
305064
|
const parts = resolveFrontmatterParts(session, frontmatter);
|
304808
305065
|
const frontmatterWithExports = { ...frontmatter, exports: exports2, downloads, parts };
|
304809
305066
|
const mystData = {
|
305067
|
+
version: SPEC_VERSION,
|
304810
305068
|
kind,
|
304811
305069
|
sha256,
|
304812
305070
|
slug,
|
@@ -304857,7 +305115,8 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
|
|
304857
305115
|
return postProcessMdast(session, {
|
304858
305116
|
file: f3,
|
304859
305117
|
pageReferenceStates,
|
304860
|
-
extraLinkTransformers
|
305118
|
+
extraLinkTransformers,
|
305119
|
+
site: true
|
304861
305120
|
});
|
304862
305121
|
}));
|
304863
305122
|
await Promise.all([...pages.map((p5) => p5.file), ...fileParts].map(async (f3) => {
|
@@ -304869,7 +305128,7 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
|
|
304869
305128
|
imageAltOutputFolder: imageAltOutputFolder !== null && imageAltOutputFolder !== void 0 ? imageAltOutputFolder : "/",
|
304870
305129
|
imageExtensions: imageExtensions !== null && imageExtensions !== void 0 ? imageExtensions : WEB_IMAGE_EXTENSIONS,
|
304871
305130
|
optimizeWebp: true,
|
304872
|
-
processThumbnail:
|
305131
|
+
processThumbnail: f3 === file,
|
304873
305132
|
maxSizeWebp
|
304874
305133
|
});
|
304875
305134
|
}
|
@@ -304937,7 +305196,8 @@ async function processProject(session, siteProject, opts) {
|
|
304937
305196
|
file: page.file,
|
304938
305197
|
checkLinks: checkLinks || strict,
|
304939
305198
|
pageReferenceStates,
|
304940
|
-
extraLinkTransformers
|
305199
|
+
extraLinkTransformers,
|
305200
|
+
site: true
|
304941
305201
|
})));
|
304942
305202
|
if (writeFiles) {
|
304943
305203
|
await Promise.all(pagesToTransform.map(async (page) => {
|
@@ -309540,7 +309800,7 @@ var caption2 = (state, node3) => {
|
|
309540
309800
|
};
|
309541
309801
|
function getFootnoteNumber(node3) {
|
309542
309802
|
var _a6;
|
309543
|
-
return (_a6 = node3.
|
309803
|
+
return (_a6 = Number.parseInt(node3.enumerator, 10)) !== null && _a6 !== void 0 ? _a6 : Number(node3.identifier);
|
309544
309804
|
}
|
309545
309805
|
var footnoteDefinition = (state, node3) => {
|
309546
309806
|
const { children, current: current2 } = state;
|
@@ -318229,7 +318489,7 @@ function rewriteAssetsFolder(directory, baseurl) {
|
|
318229
318489
|
if (![".html", ".js", ".json"].includes(import_node_path57.default.extname(file)))
|
318230
318490
|
return;
|
318231
318491
|
const data = import_fs_extra.default.readFileSync(file).toString();
|
318232
|
-
const modified = data.replace(new RegExp(`\\/${ASSETS_FOLDER}\\/`, "g"), `${baseurl || ""}/build/`).replace('href="/favicon.ico"', `href="${baseurl || ""}/favicon.ico"`);
|
318492
|
+
const modified = data.replace(new RegExp(`\\/${ASSETS_FOLDER}\\/`, "g"), `${baseurl || ""}/build/`).replace('href="/favicon.ico"', `href="${baseurl || ""}/favicon.ico"`).replace('href="/myst-theme.css"', `href="${baseurl || ""}/myst-theme.css"`);
|
318233
318493
|
import_fs_extra.default.writeFileSync(file, modified);
|
318234
318494
|
});
|
318235
318495
|
}
|
@@ -325347,7 +325607,7 @@ var TOCTreeOptions = z.object({
|
|
325347
325607
|
caption: z.string(),
|
325348
325608
|
hidden: z.boolean(),
|
325349
325609
|
maxdepth: z.number(),
|
325350
|
-
|
325610
|
+
numbered: z.boolean(),
|
325351
325611
|
reversed: z.boolean(),
|
325352
325612
|
titlesonly: z.boolean()
|
325353
325613
|
}).partial();
|
@@ -325802,6 +326062,7 @@ async function upgradeGlossary(documentLines) {
|
|
325802
326062
|
|
325803
326063
|
// ../myst-cli/dist/init/jupyter-book/upgrade.js
|
325804
326064
|
async function upgradeJupyterBook(session, configFile) {
|
326065
|
+
var _a6, _b;
|
325805
326066
|
const config3 = {
|
325806
326067
|
version: 1,
|
325807
326068
|
project: {}
|
@@ -325815,14 +326076,19 @@ async function upgradeJupyterBook(session, configFile) {
|
|
325815
326076
|
session.log.info(`Migrating Jupyter Book configuration to ${source_default.blue("myst.yml")}`);
|
325816
326077
|
({ site: config3.site, project: config3.project } = upgradeConfig(configData2));
|
325817
326078
|
}
|
325818
|
-
if (await fsExists("_toc.yml")) {
|
325819
|
-
|
325820
|
-
|
325821
|
-
|
325822
|
-
|
325823
|
-
|
325824
|
-
}
|
326079
|
+
if (!await fsExists("_toc.yml")) {
|
326080
|
+
throw new Error(`${source_default.blue("_toc.yml")} is a required Jupyter Book configuration file`);
|
326081
|
+
}
|
326082
|
+
const tocContent = await import_promises4.default.readFile("_toc.yml", { encoding: "utf-8" });
|
326083
|
+
const tocData = validateSphinxExternalTOC(js_yaml_default.load(tocContent));
|
326084
|
+
if (defined2(tocData)) {
|
326085
|
+
session.log.info(`Migrating TOC to ${source_default.blue("myst.yml")}`);
|
326086
|
+
config3.project.toc = upgradeTOC(session, tocData);
|
325825
326087
|
}
|
326088
|
+
config3.site = (_a6 = config3.site) !== null && _a6 !== void 0 ? _a6 : {};
|
326089
|
+
config3.site.options = (_b = config3.site.options) !== null && _b !== void 0 ? _b : {};
|
326090
|
+
session.log.debug(source_default.dim(`Setting ${source_default.blue("site.options.folders")} to ${source_default.blue("true")}`));
|
326091
|
+
config3.site.options.folders = true;
|
325826
326092
|
await upgradeProjectSyntax(session);
|
325827
326093
|
await import_promises4.default.writeFile(configFile, js_yaml_default.dump(config3));
|
325828
326094
|
await import_promises4.default.rename("_config.yml", "._config.yml.bak");
|
@@ -326003,6 +326269,7 @@ You can start the ${readableName()} web server later with:`), source_default.bol
|
|
326003
326269
|
|
326004
326270
|
// ../myst-cli/dist/plugins.js
|
326005
326271
|
var import_node_fs44 = __toESM(require("fs"), 1);
|
326272
|
+
var import_node_url3 = require("url");
|
326006
326273
|
|
326007
326274
|
// ../myst-cli/dist/executablePlugin.js
|
326008
326275
|
var import_node_child_process2 = require("child_process");
|
@@ -326144,10 +326411,11 @@ async function loadPlugins(session) {
|
|
326144
326411
|
}
|
326145
326412
|
session.log.debug(`Loading plugins: "${configPlugins.map((info) => `${info.path} (${info.type})`).join('", "')}"`);
|
326146
326413
|
const modules = await Promise.all(configPlugins.map(async (info) => {
|
326414
|
+
var _a6, _b;
|
326147
326415
|
const { type: type2, path: path44 } = info;
|
326148
326416
|
switch (type2) {
|
326149
326417
|
case "executable": {
|
326150
|
-
if (!import_node_fs44.default.statSync(path44).isFile) {
|
326418
|
+
if (!((_a6 = import_node_fs44.default.statSync(path44, { throwIfNoEntry: false })) === null || _a6 === void 0 ? void 0 : _a6.isFile())) {
|
326151
326419
|
addWarningForFile(session, path44, `Unknown plugin "${path44}", it must be an executable file`, "error", {
|
326152
326420
|
ruleId: RuleId.pluginLoads
|
326153
326421
|
});
|
@@ -326171,15 +326439,16 @@ async function loadPlugins(session) {
|
|
326171
326439
|
return { path: path44, module: { plugin: plugin5 } };
|
326172
326440
|
}
|
326173
326441
|
case "javascript": {
|
326174
|
-
if (!import_node_fs44.default.statSync(path44).isFile || !path44.endsWith(".mjs")) {
|
326442
|
+
if (!((_b = import_node_fs44.default.statSync(path44, { throwIfNoEntry: false })) === null || _b === void 0 ? void 0 : _b.isFile()) || !path44.endsWith(".mjs")) {
|
326175
326443
|
addWarningForFile(session, path44, `Unknown plugin "${path44}", it must be an mjs file`, "error", {
|
326176
326444
|
ruleId: RuleId.pluginLoads
|
326177
326445
|
});
|
326178
326446
|
return null;
|
326179
326447
|
}
|
326180
326448
|
let module2;
|
326449
|
+
const pathURL = (0, import_node_url3.pathToFileURL)(path44);
|
326181
326450
|
try {
|
326182
|
-
module2 = await import(
|
326451
|
+
module2 = await import(pathURL.toString());
|
326183
326452
|
} catch (error) {
|
326184
326453
|
session.log.debug(`
|
326185
326454
|
|
@@ -326874,7 +327143,7 @@ var AbortError2 = class extends RequestError {
|
|
326874
327143
|
var import_node_process8 = __toESM(require("process"), 1);
|
326875
327144
|
var import_node_buffer4 = require("buffer");
|
326876
327145
|
var import_node_stream6 = require("stream");
|
326877
|
-
var
|
327146
|
+
var import_node_url6 = require("url");
|
326878
327147
|
var import_node_http4 = __toESM(require("http"), 1);
|
326879
327148
|
|
326880
327149
|
// ../../node_modules/@szmarczak/http-timer/dist/source/index.js
|
@@ -326984,7 +327253,7 @@ var source_default5 = timer;
|
|
326984
327253
|
|
326985
327254
|
// ../../node_modules/cacheable-request/dist/index.js
|
326986
327255
|
var import_node_events2 = __toESM(require("events"), 1);
|
326987
|
-
var
|
327256
|
+
var import_node_url4 = __toESM(require("url"), 1);
|
326988
327257
|
var import_node_crypto5 = __toESM(require("crypto"), 1);
|
326989
327258
|
var import_node_stream5 = __toESM(require("stream"), 1);
|
326990
327259
|
|
@@ -327313,10 +327582,10 @@ var CacheableRequest = class {
|
|
327313
327582
|
this.request = () => (options, cb) => {
|
327314
327583
|
let url;
|
327315
327584
|
if (typeof options === "string") {
|
327316
|
-
url = normalizeUrlObject(
|
327585
|
+
url = normalizeUrlObject(import_node_url4.default.parse(options));
|
327317
327586
|
options = {};
|
327318
|
-
} else if (options instanceof
|
327319
|
-
url = normalizeUrlObject(
|
327587
|
+
} else if (options instanceof import_node_url4.default.URL) {
|
327588
|
+
url = normalizeUrlObject(import_node_url4.default.parse(options.toString()));
|
327320
327589
|
options = {};
|
327321
327590
|
} else {
|
327322
327591
|
const [pathname, ...searchParts] = (options.path ?? "").split("?");
|
@@ -327334,7 +327603,7 @@ var CacheableRequest = class {
|
|
327334
327603
|
};
|
327335
327604
|
options.headers = Object.fromEntries(entries(options.headers).map(([key3, value]) => [key3.toLowerCase(), value]));
|
327336
327605
|
const ee = new import_node_events2.default();
|
327337
|
-
const normalizedUrlString = normalizeUrl(
|
327606
|
+
const normalizedUrlString = normalizeUrl(import_node_url4.default.format(url), {
|
327338
327607
|
stripWWW: false,
|
327339
327608
|
removeTrailingSlash: false,
|
327340
327609
|
stripAuthentication: false
|
@@ -328069,7 +328338,7 @@ var calculate_retry_delay_default = calculateRetryDelay;
|
|
328069
328338
|
// ../../node_modules/got/dist/source/core/options.js
|
328070
328339
|
var import_node_process7 = __toESM(require("process"), 1);
|
328071
328340
|
var import_node_util6 = require("util");
|
328072
|
-
var
|
328341
|
+
var import_node_url5 = require("url");
|
328073
328342
|
var import_node_tls = require("tls");
|
328074
328343
|
var import_node_http3 = __toESM(require("http"), 1);
|
328075
328344
|
var import_node_https2 = __toESM(require("https"), 1);
|
@@ -328614,7 +328883,7 @@ var defaultInternals = {
|
|
328614
328883
|
const next = parsed.find((entry) => entry.parameters.rel === "next" || entry.parameters.rel === '"next"');
|
328615
328884
|
if (next) {
|
328616
328885
|
return {
|
328617
|
-
url: new
|
328886
|
+
url: new import_node_url5.URL(next.reference, response.url)
|
328618
328887
|
};
|
328619
328888
|
}
|
328620
328889
|
return false;
|
@@ -328655,7 +328924,7 @@ var cloneInternals = (internals) => {
|
|
328655
328924
|
beforeRetry: [...hooks.beforeRetry],
|
328656
328925
|
afterResponse: [...hooks.afterResponse]
|
328657
328926
|
},
|
328658
|
-
searchParams: internals.searchParams ? new
|
328927
|
+
searchParams: internals.searchParams ? new import_node_url5.URLSearchParams(internals.searchParams) : void 0,
|
328659
328928
|
pagination: { ...internals.pagination }
|
328660
328929
|
};
|
328661
328930
|
if (result.url !== void 0) {
|
@@ -329106,7 +329375,7 @@ var Options2 = class {
|
|
329106
329375
|
throw new Error("`url` must not start with a slash");
|
329107
329376
|
}
|
329108
329377
|
const urlString = `${this.prefixUrl}${value.toString()}`;
|
329109
|
-
const url = new
|
329378
|
+
const url = new import_node_url5.URL(urlString);
|
329110
329379
|
this._internals.url = url;
|
329111
329380
|
if (url.protocol === "unix:") {
|
329112
329381
|
url.href = `http://unix${url.pathname}${url.search}`;
|
@@ -329240,7 +329509,7 @@ var Options2 = class {
|
|
329240
329509
|
return this._internals.url.searchParams;
|
329241
329510
|
}
|
329242
329511
|
if (this._internals.searchParams === void 0) {
|
329243
|
-
this._internals.searchParams = new
|
329512
|
+
this._internals.searchParams = new import_node_url5.URLSearchParams();
|
329244
329513
|
}
|
329245
329514
|
return this._internals.searchParams;
|
329246
329515
|
}
|
@@ -329257,12 +329526,12 @@ var Options2 = class {
|
|
329257
329526
|
const searchParameters = this.searchParams;
|
329258
329527
|
let updated;
|
329259
329528
|
if (dist_default5.string(value)) {
|
329260
|
-
updated = new
|
329261
|
-
} else if (value instanceof
|
329529
|
+
updated = new import_node_url5.URLSearchParams(value);
|
329530
|
+
} else if (value instanceof import_node_url5.URLSearchParams) {
|
329262
329531
|
updated = value;
|
329263
329532
|
} else {
|
329264
329533
|
validateSearchParameters(value);
|
329265
|
-
updated = new
|
329534
|
+
updated = new import_node_url5.URLSearchParams();
|
329266
329535
|
for (const key2 in value) {
|
329267
329536
|
const entry = value[key2];
|
329268
329537
|
if (entry === null) {
|
@@ -330571,7 +330840,7 @@ var Request3 = class extends import_node_stream6.Duplex {
|
|
330571
330840
|
}
|
330572
330841
|
const { form } = options;
|
330573
330842
|
options.form = void 0;
|
330574
|
-
options.body = new
|
330843
|
+
options.body = new import_node_url6.URLSearchParams(form).toString();
|
330575
330844
|
} else {
|
330576
330845
|
if (noContentType) {
|
330577
330846
|
headers["content-type"] = "application/json";
|
@@ -330675,7 +330944,7 @@ var Request3 = class extends import_node_stream6.Duplex {
|
|
330675
330944
|
}
|
330676
330945
|
try {
|
330677
330946
|
const redirectBuffer = import_node_buffer4.Buffer.from(response.headers.location, "binary").toString();
|
330678
|
-
const redirectUrl = new
|
330947
|
+
const redirectUrl = new import_node_url6.URL(redirectBuffer, url);
|
330679
330948
|
if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {
|
330680
330949
|
this._beforeError(new RequestError("Cannot redirect to UNIX socket", {}, this));
|
330681
330950
|
return;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|