mystmd 1.3.22__tar.gz → 1.3.24__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mystmd
3
- Version: 1.3.22
3
+ Version: 1.3.24
4
4
  Summary: Command line tools for MyST Markdown
5
5
  Project-URL: Homepage, https://github.com/jupyter-book/mystmd
6
6
  Project-URL: Bug Tracker, https://github.com/jupyter-book/mystmd/issues
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mystmd",
3
- "version": "1.3.22",
3
+ "version": "1.3.24",
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.22"
48
+ "myst-cli": "^1.3.24"
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 (pathToFileURL) {
48948
- result.input.url = pathToFileURL(this.file).toString();
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 = pathToFileURL(from4.source);
49011
+ fromUrl = pathToFileURL2(from4.source);
49012
49012
  } else {
49013
49013
  fromUrl = new URL(
49014
49014
  from4.source,
49015
- this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)
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 (pathToFileURL) {
49569
- let fileURL = pathToFileURL(path44).toString();
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.22";
193894
+ var version = "1.3.24";
193895
193895
  var version_default = version;
193896
193896
 
193897
193897
  // ../myst-cli/dist/build/build.js
@@ -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
  }
@@ -238916,6 +238914,154 @@ async function headingDepthTransform(tree, vfile2, opts) {
238916
238914
  });
238917
238915
  }
238918
238916
 
238917
+ // ../myst-transforms/dist/toc.js
238918
+ function listFromPages(pages, projectSlug) {
238919
+ if (pages.length === 0)
238920
+ return { type: "list", children: [] };
238921
+ let ignore3 = false;
238922
+ const level = pages[0].level;
238923
+ const children = pages.map((page, index4) => {
238924
+ if (ignore3)
238925
+ return void 0;
238926
+ if (page.level < level)
238927
+ ignore3 = true;
238928
+ if (page.level !== level)
238929
+ return void 0;
238930
+ return listItemFromPages(pages.slice(index4), projectSlug);
238931
+ }).filter((item) => !!item);
238932
+ return { type: "list", children };
238933
+ }
238934
+ function listItemFromPages(pages, projectSlug) {
238935
+ if (pages.length === 0)
238936
+ return;
238937
+ const { title, slug, enumerator, level } = pages[0];
238938
+ const text7 = {
238939
+ type: "text",
238940
+ value: `${enumerator ? `${enumerator} ` : ""}${title}`
238941
+ };
238942
+ const child = slug != null ? {
238943
+ type: "link",
238944
+ url: `${projectSlug ? `/${projectSlug}` : ""}/${slug}`,
238945
+ internal: true,
238946
+ children: [text7]
238947
+ } : text7;
238948
+ const item = {
238949
+ type: "listItem",
238950
+ children: [child]
238951
+ };
238952
+ if (pages[1] && pages[1].level > level) {
238953
+ item.children.push(listFromPages(pages.slice(1), projectSlug));
238954
+ }
238955
+ return item;
238956
+ }
238957
+ function listFromHeadings(headings) {
238958
+ if (headings.length === 0)
238959
+ return { type: "list", children: [] };
238960
+ let ignore3 = false;
238961
+ const depth = headings[0].depth;
238962
+ const children = headings.map((heading6, index4) => {
238963
+ if (ignore3)
238964
+ return void 0;
238965
+ if (heading6.depth < depth)
238966
+ ignore3 = true;
238967
+ if (heading6.depth !== depth)
238968
+ return void 0;
238969
+ return listItemFromHeadings(headings.slice(index4));
238970
+ }).filter((item) => !!item);
238971
+ return { type: "list", children };
238972
+ }
238973
+ function listItemFromHeadings(headings) {
238974
+ if (headings.length === 0)
238975
+ return;
238976
+ const { children, enumerator, depth, identifier } = headings[0];
238977
+ const text7 = {
238978
+ type: "text",
238979
+ value: `${enumerator ? `${enumerator} ` : ""}${toText(children)}`
238980
+ };
238981
+ const child = identifier ? {
238982
+ type: "link",
238983
+ url: `#${identifier}`,
238984
+ internal: true,
238985
+ children: [text7],
238986
+ suppressImplicitWarning: true
238987
+ } : text7;
238988
+ const item = {
238989
+ type: "listItem",
238990
+ children: [child]
238991
+ };
238992
+ if (headings[1] && headings[1].depth > depth) {
238993
+ item.children.push(listFromHeadings(headings.slice(1)));
238994
+ }
238995
+ return item;
238996
+ }
238997
+ function buildTocTransform(mdast2, vfile2, pages, projectSlug) {
238998
+ const tocHeadings = selectAll("toc > heading", mdast2);
238999
+ const tocsAndHeadings = selectAll("toc,heading", mdast2).filter((item) => {
239000
+ return !tocHeadings.includes(item);
239001
+ });
239002
+ if (!tocsAndHeadings.find((node3) => node3.type === "toc"))
239003
+ return;
239004
+ const projectTocs = tocsAndHeadings.filter((node3) => node3.type === "toc" && node3.kind === "project");
239005
+ const pageTocs = tocsAndHeadings.filter((node3) => node3.type === "toc" && node3.kind === "page");
239006
+ const sectionTocs = tocsAndHeadings.filter((node3) => node3.type === "toc" && node3.kind === "section");
239007
+ if (projectTocs.length) {
239008
+ if (!pages) {
239009
+ fileError(vfile2, `Pages not available to build Table of Contents`);
239010
+ } else {
239011
+ if (pages[0].level !== 1) {
239012
+ fileWarn(vfile2, `First page of Table of Contents must be level 1`);
239013
+ }
239014
+ projectTocs.forEach((toc) => {
239015
+ const filteredPages = toc.depth ? pages.filter((page) => page.level <= toc.depth) : pages;
239016
+ toc.type = "block";
239017
+ delete toc.kind;
239018
+ toc.data = { part: "toc:project" };
239019
+ if (!toc.children)
239020
+ toc.children = [];
239021
+ toc.children.push(listFromPages(filteredPages, projectSlug));
239022
+ });
239023
+ }
239024
+ }
239025
+ if (pageTocs.length) {
239026
+ const headings = tocsAndHeadings.filter((node3) => node3.type === "heading");
239027
+ if (headings.length === 0) {
239028
+ fileWarn(vfile2, `No page headings found for Table of Contents`);
239029
+ } else {
239030
+ if (Math.min(...headings.map((h4) => h4.depth)) !== headings[0].depth) {
239031
+ fileWarn(vfile2, "Page heading levels do not start with highest level");
239032
+ }
239033
+ pageTocs.forEach((toc) => {
239034
+ const filteredHeadings = toc.depth ? headings.filter((heading6) => heading6.depth - headings[0].depth < toc.depth) : headings;
239035
+ toc.type = "block";
239036
+ delete toc.kind;
239037
+ toc.data = { part: "toc:page" };
239038
+ if (!toc.children)
239039
+ toc.children = [];
239040
+ toc.children.push(listFromHeadings(filteredHeadings));
239041
+ });
239042
+ }
239043
+ }
239044
+ if (sectionTocs.length) {
239045
+ tocsAndHeadings.forEach((toc, index4) => {
239046
+ if (toc.type !== "toc" || toc.kind !== "section")
239047
+ return;
239048
+ const headings = tocsAndHeadings.slice(index4 + 1).filter((h4) => h4.type === "heading");
239049
+ if (headings.length === 0) {
239050
+ fileWarn(vfile2, `No section headings found for Table of Contents`);
239051
+ } else {
239052
+ const filteredHeadings = toc.depth ? headings.filter((heading6) => heading6.depth - headings[0].depth < toc.depth) : headings;
239053
+ toc.type = "block";
239054
+ delete toc.kind;
239055
+ toc.data = { part: "toc:section" };
239056
+ if (!toc.children)
239057
+ toc.children = [];
239058
+ const nextSection = filteredHeadings.findIndex((h4) => h4.depth < filteredHeadings[0].depth);
239059
+ toc.children.push(listFromHeadings(nextSection === -1 ? filteredHeadings : filteredHeadings.slice(0, nextSection)));
239060
+ }
239061
+ });
239062
+ }
239063
+ }
239064
+
238919
239065
  // ../myst-transforms/dist/enumerate.js
238920
239066
  var TRANSFORM_NAME2 = "myst-transforms:enumerate";
238921
239067
  var DEFAULT_NUMBERING = {
@@ -239081,7 +239227,7 @@ function initializeTargetCounts(numbering, previousCounts, offset) {
239081
239227
  const targetCounts = { heading: heading6 };
239082
239228
  Object.entries(previousCounts !== null && previousCounts !== void 0 ? previousCounts : {}).filter(([key2]) => key2 !== "heading").filter(([key2]) => {
239083
239229
  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);
239230
+ return ((_a6 = numbering[key2]) === null || _a6 === void 0 ? void 0 : _a6.continue) || ((_b = numbering.all) === null || _b === void 0 ? void 0 : _b.continue);
239085
239231
  }).forEach(([key2, val]) => {
239086
239232
  targetCounts[key2] = { ...val };
239087
239233
  });
@@ -239378,7 +239524,7 @@ function addContainerCaptionNumbersTransform(tree, file, opts) {
239378
239524
  });
239379
239525
  }
239380
239526
  function implicitTargetWarning(target, node3, opts) {
239381
- if (target.node.implicit && opts.state.vfile) {
239527
+ if (target.node.implicit && opts.state.vfile && !node3.suppressImplicitWarning) {
239382
239528
  fileWarn(opts.state.vfile, `Linking "${target.node.identifier}" to an implicit ${target.kind} reference, best practice is to create an explicit reference.`, {
239383
239529
  node: node3,
239384
239530
  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 +239532,7 @@ function implicitTargetWarning(target, node3, opts) {
239386
239532
  ruleId: RuleId.referenceTargetExplicit
239387
239533
  });
239388
239534
  }
239535
+ delete node3.suppressImplicitWarning;
239389
239536
  }
239390
239537
  var resolveReferenceLinksTransform = (tree, opts) => {
239391
239538
  selectAll("link", tree).forEach((node3) => {
@@ -282455,33 +282602,26 @@ var includeDirective = {
282455
282602
  var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
282456
282603
  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
282604
  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
282605
  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(
282606
+ const opts = literal ? getCodeBlockOptions(
282468
282607
  data,
282469
282608
  vfile2,
282470
282609
  // Set the filename in the literal include by default
282471
282610
  file.split(/\/|\\/).pop()
282472
- );
282611
+ ) : {};
282612
+ const caption3 = literal ? (_e = data.options) === null || _e === void 0 ? void 0 : _e.caption : void 0;
282473
282613
  const filter7 = {};
282474
282614
  ensureOnlyOneOf(data, vfile2, ["start-at", "start-line", "start-after", "lines"]);
282475
282615
  ensureOnlyOneOf(data, vfile2, ["end-at", "end-line", "end-before", "lines"]);
282476
- filter7.startAt = (_e = data.options) === null || _e === void 0 ? void 0 : _e["start-at"];
282477
- filter7.startAfter = (_f = data.options) === null || _f === void 0 ? void 0 : _f["start-after"];
282478
- filter7.endAt = (_g = data.options) === null || _g === void 0 ? void 0 : _g["end-at"];
282479
- filter7.endBefore = (_h = data.options) === null || _h === void 0 ? void 0 : _h["end-before"];
282480
- if ((_j = data.options) === null || _j === void 0 ? void 0 : _j.lines) {
282481
- filter7.lines = parseLinesString(vfile2, (_k = select('mystDirectiveOption[name="lines"]', data.node)) !== null && _k !== void 0 ? _k : void 0, (_l = data.options) === null || _l === void 0 ? void 0 : _l.lines);
282616
+ filter7.startAt = (_f = data.options) === null || _f === void 0 ? void 0 : _f["start-at"];
282617
+ filter7.startAfter = (_g = data.options) === null || _g === void 0 ? void 0 : _g["start-after"];
282618
+ filter7.endAt = (_h = data.options) === null || _h === void 0 ? void 0 : _h["end-at"];
282619
+ filter7.endBefore = (_j = data.options) === null || _j === void 0 ? void 0 : _j["end-before"];
282620
+ if ((_k = data.options) === null || _k === void 0 ? void 0 : _k.lines) {
282621
+ 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
282622
  } else {
282483
- const startLine = (_m = data.options) === null || _m === void 0 ? void 0 : _m["start-line"];
282484
- const endLine = (_o = data.options) === null || _o === void 0 ? void 0 : _o["end-line"];
282623
+ const startLine = (_o = data.options) === null || _o === void 0 ? void 0 : _o["start-line"];
282624
+ const endLine = (_p = data.options) === null || _p === void 0 ? void 0 : _p["end-line"];
282485
282625
  const lines = [];
282486
282626
  if (startLine != null)
282487
282627
  lines.push(startLine);
@@ -282499,13 +282639,14 @@ var includeDirective = {
282499
282639
  ];
282500
282640
  }
282501
282641
  }
282642
+ const usesFilter = Object.values(filter7).some((value) => value !== void 0);
282502
282643
  const include3 = {
282503
282644
  type: "include",
282504
282645
  file,
282505
282646
  literal,
282506
282647
  lang,
282507
- caption: (_p = data.options) === null || _p === void 0 ? void 0 : _p.caption,
282508
- filter: Object.keys(filter7).length > 0 ? filter7 : void 0,
282648
+ caption: caption3,
282649
+ filter: usesFilter ? filter7 : void 0,
282509
282650
  ...opts
282510
282651
  };
282511
282652
  addCommonDirectiveOptions(data, include3);
@@ -282658,7 +282799,8 @@ var genIndexDirective = {
282658
282799
  } else {
282659
282800
  children.push({
282660
282801
  type: "heading",
282661
- depth: 1,
282802
+ depth: 2,
282803
+ enumerated: false,
282662
282804
  children: parsedArg
282663
282805
  });
282664
282806
  }
@@ -286150,6 +286292,61 @@ var divDirective = {
286150
286292
  }
286151
286293
  };
286152
286294
 
286295
+ // ../myst-directives/dist/toc.js
286296
+ var CONTEXTS = ["project", "page", "section"];
286297
+ var tocDirective = {
286298
+ name: "toc",
286299
+ 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).",
286300
+ alias: ["tableofcontents", "table-of-contents", "toctree", "contents"],
286301
+ arg: {
286302
+ type: "myst",
286303
+ doc: "Heading to be included with table of contents"
286304
+ },
286305
+ options: {
286306
+ context: {
286307
+ type: String,
286308
+ doc: "Table of Contents context; one of project, page, or section",
286309
+ alias: ["kind"]
286310
+ },
286311
+ depth: {
286312
+ type: Number,
286313
+ doc: "Number of levels to include in Table of Contents; by default, all levels will be included",
286314
+ alias: ["maxdepth"]
286315
+ },
286316
+ ...commonDirectiveOptions("toc")
286317
+ },
286318
+ run(data, vfile2) {
286319
+ var _a6, _b, _c;
286320
+ let context = ((_a6 = data.options) === null || _a6 === void 0 ? void 0 : _a6.context) ? data.options.context : data.name === "contents" ? "section" : "project";
286321
+ if (!CONTEXTS.includes(context)) {
286322
+ fileError(vfile2, `Unknown context for ${data.name} directive: ${context}`);
286323
+ context = "project";
286324
+ }
286325
+ let depth = (_b = data.options) === null || _b === void 0 ? void 0 : _b.depth;
286326
+ if (depth != null && depth < 1) {
286327
+ fileError(vfile2, `Table of Contents 'depth' must be a number greater than 0`);
286328
+ depth = void 0;
286329
+ }
286330
+ const children = [];
286331
+ if (data.arg) {
286332
+ const parsedArg = data.arg;
286333
+ if (((_c = parsedArg[0]) === null || _c === void 0 ? void 0 : _c.type) === "heading") {
286334
+ children.push(...parsedArg);
286335
+ } else {
286336
+ children.push({
286337
+ type: "heading",
286338
+ depth: 2,
286339
+ enumerated: false,
286340
+ children: parsedArg
286341
+ });
286342
+ }
286343
+ }
286344
+ const toc = { type: "toc", kind: context, depth, children };
286345
+ addCommonDirectiveOptions(data, toc);
286346
+ return [toc];
286347
+ }
286348
+ };
286349
+
286153
286350
  // ../myst-directives/dist/index.js
286154
286351
  var defaultDirectives = [
286155
286352
  admonitionDirective,
@@ -286177,7 +286374,8 @@ var defaultDirectives = [
286177
286374
  rawDirective,
286178
286375
  rawLatexDirective,
286179
286376
  rawTypstDirective,
286180
- divDirective
286377
+ divDirective,
286378
+ tocDirective
286181
286379
  ];
286182
286380
 
286183
286381
  // ../myst-roles/dist/abbreviation.js
@@ -287957,7 +288155,7 @@ var MARKDOWN_IT_CONFIG = {
287957
288155
  }
287958
288156
  }
287959
288157
  };
287960
- var EXCLUDE_TLDS = ["py", "md", "dot", "next", "so", "es"];
288158
+ var EXCLUDE_TLDS = ["py", "md", "dot", "next", "so", "es", "java", "zip"];
287961
288159
 
287962
288160
  // ../myst-parser/dist/tokensToMyst.js
287963
288161
  var import_he = __toESM(require_he(), 1);
@@ -289012,6 +289210,34 @@ function mystParse(content3, opts) {
289012
289210
  return tree;
289013
289211
  }
289014
289212
 
289213
+ // ../myst-ext-button/dist/index.js
289214
+ var REF_PATTERN6 = /^(.+?)<([^<>]+)>$/;
289215
+ var buttonRole = {
289216
+ name: "button",
289217
+ doc: "Button element with an action to navigate to internal or external links.",
289218
+ body: {
289219
+ type: String,
289220
+ doc: "The body of the button.",
289221
+ required: true
289222
+ },
289223
+ run(data) {
289224
+ const body3 = data.body;
289225
+ const match3 = REF_PATTERN6.exec(body3);
289226
+ const [, modified, rawLabel] = match3 !== null && match3 !== void 0 ? match3 : [];
289227
+ const url = rawLabel !== null && rawLabel !== void 0 ? rawLabel : body3;
289228
+ const node3 = {
289229
+ type: "link",
289230
+ url,
289231
+ children: [],
289232
+ class: "button"
289233
+ // TODO: allow users to extend this
289234
+ };
289235
+ if (modified)
289236
+ node3.children = [{ type: "text", value: modified.trim() }];
289237
+ return [node3];
289238
+ }
289239
+ };
289240
+
289015
289241
  // ../myst-ext-card/dist/index.js
289016
289242
  var HEADER_REGEX = /((?<before>[\s\S]*?)\s+){0,1}\^\^\^(\s+(?<after>[\s\S]*)){0,1}/;
289017
289243
  var cardDirective = {
@@ -289502,7 +289728,7 @@ function parseMyst(session, content3, file, opts) {
289502
289728
  extensions: {
289503
289729
  frontmatter: !(opts === null || opts === void 0 ? void 0 : opts.ignoreFrontmatter)
289504
289730
  },
289505
- roles: [...(_d2 = (_c = session.plugins) === null || _c === void 0 ? void 0 : _c.roles) !== null && _d2 !== void 0 ? _d2 : []],
289731
+ roles: [buttonRole, ...(_d2 = (_c = session.plugins) === null || _c === void 0 ? void 0 : _c.roles) !== null && _d2 !== void 0 ? _d2 : []],
289506
289732
  vfile: vfile2
289507
289733
  });
289508
289734
  logMessagesFromVFile(session, vfile2);
@@ -289519,7 +289745,7 @@ var import_node_path16 = __toESM(require("path"), 1);
289519
289745
  var import_nbtx = __toESM(require_cjs2(), 1);
289520
289746
 
289521
289747
  // ../myst-cli/dist/version.js
289522
- var version2 = "1.3.22";
289748
+ var version2 = "1.3.24";
289523
289749
  var version_default2 = version2;
289524
289750
 
289525
289751
  // ../myst-cli/dist/utils/headers.js
@@ -290707,7 +290933,7 @@ function findExpression(expressions, value) {
290707
290933
  function processLatex(value) {
290708
290934
  return value.trim().replace(/^\$(\\displaystyle)?/, "").replace(/\$$/, "").trim();
290709
290935
  }
290710
- function processPlainText(content3) {
290936
+ function stripTextQuotes(content3) {
290711
290937
  return content3.replace(/^(["'])(.*)\1$/, "$2");
290712
290938
  }
290713
290939
  function renderExpression(node3, file) {
@@ -290717,6 +290943,7 @@ function renderExpression(node3, file) {
290717
290943
  let content3;
290718
290944
  if (result.status === "ok") {
290719
290945
  Object.entries(result.data).forEach(([mimeType, value]) => {
290946
+ var _a6, _b;
290720
290947
  if (content3) {
290721
290948
  return;
290722
290949
  } else if (mimeType.startsWith("image/")) {
@@ -290731,7 +290958,13 @@ function renderExpression(node3, file) {
290731
290958
  } else if (mimeType === "text/html") {
290732
290959
  content3 = [{ type: "html", value }];
290733
290960
  } else if (mimeType === "text/plain") {
290734
- content3 = [{ type: "text", value: processPlainText(value) }];
290961
+ const stripQuotes = (_b = (_a6 = result.metadata) === null || _a6 === void 0 ? void 0 : _a6["strip-quotes"]) !== null && _b !== void 0 ? _b : true;
290962
+ content3 = [
290963
+ {
290964
+ type: "text",
290965
+ value: stripQuotes ? stripTextQuotes(value) : value
290966
+ }
290967
+ ];
290735
290968
  }
290736
290969
  });
290737
290970
  if (content3)
@@ -299997,6 +300230,9 @@ var Domains;
299997
300230
  var import_node_fs24 = __toESM(require("fs"), 1);
299998
300231
  var import_node_path29 = __toESM(require("path"), 1);
299999
300232
 
300233
+ // ../myst-cli/dist/spec-version.js
300234
+ var SPEC_VERSION = 1;
300235
+
300000
300236
  // ../myst-cli/dist/build/site/template.js
300001
300237
  var import_node_fs22 = __toESM(require("fs"), 1);
300002
300238
  var import_node_path26 = require("path");
@@ -301378,6 +301614,71 @@ async function collectExportOptions(session, files, formats, opts) {
301378
301614
  return filterAndMakeUnique(exportOptionsList);
301379
301615
  }
301380
301616
 
301617
+ // ../myst-cli/dist/build/utils/projectManifest.js
301618
+ async function manifestPagesFromProject(session, projectPath) {
301619
+ const state = session.store.getState();
301620
+ const proj = selectors_exports.selectLocalProject(state, projectPath);
301621
+ if (!proj)
301622
+ return [];
301623
+ const cache = castSession(session);
301624
+ const pages = await Promise.all(proj.pages.map(async (page) => {
301625
+ var _a6, _b, _c, _d2, _e, _f, _g, _h, _j, _k;
301626
+ if ("file" in page) {
301627
+ const fileInfo3 = selectors_exports.selectFileInfo(state, page.file);
301628
+ const title = fileInfo3.title || fileTitle(page.file);
301629
+ const short_title = (_a6 = fileInfo3.short_title) !== null && _a6 !== void 0 ? _a6 : void 0;
301630
+ const description = (_b = fileInfo3.description) !== null && _b !== void 0 ? _b : "";
301631
+ const thumbnail = (_c = fileInfo3.thumbnail) !== null && _c !== void 0 ? _c : "";
301632
+ const thumbnailOptimized = (_d2 = fileInfo3.thumbnailOptimized) !== null && _d2 !== void 0 ? _d2 : "";
301633
+ const banner = (_e = fileInfo3.banner) !== null && _e !== void 0 ? _e : "";
301634
+ const bannerOptimized = (_f = fileInfo3.bannerOptimized) !== null && _f !== void 0 ? _f : "";
301635
+ const date = (_g = fileInfo3.date) !== null && _g !== void 0 ? _g : "";
301636
+ const tags = (_h = fileInfo3.tags) !== null && _h !== void 0 ? _h : [];
301637
+ const { slug, level, file } = page;
301638
+ const { frontmatter } = (_k = (_j = cache.$getMdast(file)) === null || _j === void 0 ? void 0 : _j.post) !== null && _k !== void 0 ? _k : {};
301639
+ const projectPage = {
301640
+ slug,
301641
+ title,
301642
+ short_title,
301643
+ description,
301644
+ date,
301645
+ thumbnail,
301646
+ thumbnailOptimized,
301647
+ banner,
301648
+ bannerOptimized,
301649
+ tags,
301650
+ level,
301651
+ enumerator: frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.enumerator
301652
+ };
301653
+ return projectPage;
301654
+ }
301655
+ return { ...page };
301656
+ }));
301657
+ return pages;
301658
+ }
301659
+ function manifestTitleFromProject(session, projectPath) {
301660
+ const state = session.store.getState();
301661
+ const projConfig = selectors_exports.selectLocalProjectConfig(state, projectPath);
301662
+ if (projConfig === null || projConfig === void 0 ? void 0 : projConfig.title)
301663
+ return projConfig.title;
301664
+ const proj = selectors_exports.selectLocalProject(state, projectPath);
301665
+ if (!proj)
301666
+ return "Untitled";
301667
+ const projectFileInfo = selectors_exports.selectFileInfo(session.store.getState(), proj.file);
301668
+ return projectFileInfo.title || proj.index || "Untitled";
301669
+ }
301670
+ function indexFrontmatterFromProject(session, projectPath) {
301671
+ var _a6, _b;
301672
+ const state = session.store.getState();
301673
+ const cache = castSession(session);
301674
+ const proj = selectors_exports.selectLocalProject(state, projectPath);
301675
+ if (!proj)
301676
+ return {};
301677
+ const { file } = proj;
301678
+ const { frontmatter } = (_b = (_a6 = cache.$getMdast(file)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
301679
+ return frontmatter !== null && frontmatter !== void 0 ? frontmatter : {};
301680
+ }
301681
+
301381
301682
  // ../myst-cli/dist/build/site/manifest.js
301382
301683
  async function resolvePageExports(session, file) {
301383
301684
  const exports2 = (await collectExportOptions(session, [file], [
@@ -301444,7 +301745,6 @@ async function resolvePageDownloads(session, file, projectPath) {
301444
301745
  return resolvedDownloads;
301445
301746
  }
301446
301747
  async function localToManifestProject(session, projectPath, projectSlug) {
301447
- var _a6, _b;
301448
301748
  if (!projectPath)
301449
301749
  return null;
301450
301750
  const state = session.store.getState();
@@ -301452,43 +301752,9 @@ async function localToManifestProject(session, projectPath, projectSlug) {
301452
301752
  const proj = selectors_exports.selectLocalProject(state, projectPath);
301453
301753
  if (!proj)
301454
301754
  return null;
301455
- const { index: index4, file: indexFile } = proj;
301755
+ const { index: index4 } = proj;
301456
301756
  const projectFileInfo = selectors_exports.selectFileInfo(state, proj.file);
301457
- const projectTitle = (projConfig === null || projConfig === void 0 ? void 0 : projConfig.title) || projectFileInfo.title || proj.index;
301458
- const cache = castSession(session);
301459
- const pages = await Promise.all(proj.pages.map(async (page) => {
301460
- var _a7, _b2, _c, _d2, _e, _f, _g, _h, _j, _k;
301461
- if ("file" in page) {
301462
- const fileInfo3 = selectors_exports.selectFileInfo(state, page.file);
301463
- const title = fileInfo3.title || fileTitle(page.file);
301464
- const short_title = (_a7 = fileInfo3.short_title) !== null && _a7 !== void 0 ? _a7 : void 0;
301465
- const description = (_b2 = fileInfo3.description) !== null && _b2 !== void 0 ? _b2 : "";
301466
- const thumbnail2 = (_c = fileInfo3.thumbnail) !== null && _c !== void 0 ? _c : "";
301467
- const thumbnailOptimized = (_d2 = fileInfo3.thumbnailOptimized) !== null && _d2 !== void 0 ? _d2 : "";
301468
- const banner2 = (_e = fileInfo3.banner) !== null && _e !== void 0 ? _e : "";
301469
- const bannerOptimized = (_f = fileInfo3.bannerOptimized) !== null && _f !== void 0 ? _f : "";
301470
- const date = (_g = fileInfo3.date) !== null && _g !== void 0 ? _g : "";
301471
- const tags = (_h = fileInfo3.tags) !== null && _h !== void 0 ? _h : [];
301472
- const { slug, level, file } = page;
301473
- const { frontmatter: frontmatter2 } = (_k = (_j = cache.$getMdast(file)) === null || _j === void 0 ? void 0 : _j.post) !== null && _k !== void 0 ? _k : {};
301474
- const projectPage = {
301475
- slug,
301476
- title,
301477
- short_title,
301478
- description,
301479
- date,
301480
- thumbnail: thumbnail2,
301481
- thumbnailOptimized,
301482
- banner: banner2,
301483
- bannerOptimized,
301484
- tags,
301485
- level,
301486
- enumerator: frontmatter2 === null || frontmatter2 === void 0 ? void 0 : frontmatter2.enumerator
301487
- };
301488
- return projectPage;
301489
- }
301490
- return { ...page };
301491
- }));
301757
+ const pages = await manifestPagesFromProject(session, projectPath);
301492
301758
  const projFrontmatter = projConfig ? filterKeys(projConfig, PROJECT_FRONTMATTER_KEYS) : {};
301493
301759
  const projConfigFile = selectors_exports.selectLocalConfigFile(state, projectPath);
301494
301760
  const exports2 = projConfigFile ? await resolvePageExports(session, projConfigFile) : [];
@@ -301496,7 +301762,7 @@ async function localToManifestProject(session, projectPath, projectSlug) {
301496
301762
  const parts = resolveFrontmatterParts(session, projFrontmatter);
301497
301763
  const banner = await transformBanner(session, import_node_path29.default.join(projectPath, "myst.yml"), projFrontmatter, session.publicPath(), { altOutputFolder: "/", webp: true });
301498
301764
  const thumbnail = await transformThumbnail(session, null, import_node_path29.default.join(projectPath, "myst.yml"), projFrontmatter, session.publicPath(), { altOutputFolder: "/", webp: true });
301499
- const { frontmatter } = (_b = (_a6 = cache.$getMdast(indexFile)) === null || _a6 === void 0 ? void 0 : _a6.post) !== null && _b !== void 0 ? _b : {};
301765
+ const frontmatter = indexFrontmatterFromProject(session, projectPath);
301500
301766
  return {
301501
301767
  ...projFrontmatter,
301502
301768
  // TODO: a null in the project frontmatter should not fall back to index page
@@ -301509,7 +301775,7 @@ async function localToManifestProject(session, projectPath, projectSlug) {
301509
301775
  downloads,
301510
301776
  parts,
301511
301777
  bibliography: projFrontmatter.bibliography || [],
301512
- title: projectTitle || "Untitled",
301778
+ title: manifestTitleFromProject(session, projectPath),
301513
301779
  slug: projectSlug,
301514
301780
  index: index4,
301515
301781
  enumerator: frontmatter === null || frontmatter === void 0 ? void 0 : frontmatter.enumerator,
@@ -301624,9 +301890,10 @@ async function getSiteManifest(session, opts) {
301624
301890
  validatedFrontmatter.options = resolvedOptions;
301625
301891
  const parts = resolveFrontmatterParts(session, validatedFrontmatter);
301626
301892
  const manifest = {
301893
+ version: SPEC_VERSION,
301894
+ myst: version_default2,
301627
301895
  ...validatedFrontmatter,
301628
301896
  parts,
301629
- myst: version_default2,
301630
301897
  nav: nav || [],
301631
301898
  actions: actions || [],
301632
301899
  projects: siteProjects
@@ -304265,7 +304532,7 @@ async function transformMdast(session, opts) {
304265
304532
  rendererFiles.push(...localFiles);
304266
304533
  }
304267
304534
  const fileCitationRenderer = combineCitationRenderers(cache, ...rendererFiles);
304268
- if (execute) {
304535
+ if (execute && !frontmatter.skip_execution) {
304269
304536
  const cachePath2 = import_node_path39.default.join(session.buildPath(), "execute");
304270
304537
  await kernelExecutionTransform(mdast2, vfile2, {
304271
304538
  basePath: session.sourcePath(),
@@ -304325,8 +304592,8 @@ async function transformMdast(session, opts) {
304325
304592
  if (!watchMode)
304326
304593
  log.info(toc(`\u{1F4D6} Built ${file} in %s.`));
304327
304594
  }
304328
- async function postProcessMdast(session, { file, checkLinks, pageReferenceStates, extraLinkTransformers }) {
304329
- var _a6;
304595
+ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates, extraLinkTransformers, site }) {
304596
+ var _a6, _b, _c;
304330
304597
  const toc = tic();
304331
304598
  const { log } = session;
304332
304599
  const cache = castSession(session);
@@ -304338,6 +304605,21 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
304338
304605
  const { mdast: mdast2, dependencies, frontmatter } = mdastPost;
304339
304606
  const state = new MultiPageReferenceResolver(pageReferenceStates, file, vfile2);
304340
304607
  const externalReferences = Object.values(cache.$externalReferences);
304608
+ const storeState = session.store.getState();
304609
+ const projectPath = selectors_exports.selectCurrentProjectPath(storeState);
304610
+ const siteConfig = selectors_exports.selectCurrentSiteConfig(storeState);
304611
+ 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;
304612
+ if (site) {
304613
+ buildTocTransform(mdast2, vfile2, projectPath ? [
304614
+ {
304615
+ title: manifestTitleFromProject(session, projectPath),
304616
+ level: 1,
304617
+ slug: "",
304618
+ enumerator: indexFrontmatterFromProject(session, projectPath).enumerator
304619
+ },
304620
+ ...await manifestPagesFromProject(session, projectPath)
304621
+ ] : void 0, projectSlug);
304622
+ }
304341
304623
  const transformers = [
304342
304624
  ...extraLinkTransformers || [],
304343
304625
  new WikiTransformer(),
@@ -304361,7 +304643,7 @@ async function postProcessMdast(session, { file, checkLinks, pageReferenceStates
304361
304643
  await transformMystXRefs(session, vfile2, mdast2, frontmatter);
304362
304644
  await embedTransform(session, mdast2, file, dependencies, state);
304363
304645
  const pipe = unified();
304364
- (_a6 = session.plugins) === null || _a6 === void 0 ? void 0 : _a6.transforms.forEach((t2) => {
304646
+ (_c = session.plugins) === null || _c === void 0 ? void 0 : _c.transforms.forEach((t2) => {
304365
304647
  if (t2.stage !== "project")
304366
304648
  return;
304367
304649
  pipe.use(t2.plugin, void 0, pluginUtils);
@@ -304772,6 +305054,7 @@ async function writeFile(session, { file, pageSlug, projectSlug, projectPath })
304772
305054
  const parts = resolveFrontmatterParts(session, frontmatter);
304773
305055
  const frontmatterWithExports = { ...frontmatter, exports: exports2, downloads, parts };
304774
305056
  const mystData = {
305057
+ version: SPEC_VERSION,
304775
305058
  kind,
304776
305059
  sha256,
304777
305060
  slug,
@@ -304822,7 +305105,8 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
304822
305105
  return postProcessMdast(session, {
304823
305106
  file: f3,
304824
305107
  pageReferenceStates,
304825
- extraLinkTransformers
305108
+ extraLinkTransformers,
305109
+ site: true
304826
305110
  });
304827
305111
  }));
304828
305112
  await Promise.all([...pages.map((p5) => p5.file), ...fileParts].map(async (f3) => {
@@ -304834,7 +305118,7 @@ async function fastProcessFile(session, { file, pageSlug, projectPath, projectSl
304834
305118
  imageAltOutputFolder: imageAltOutputFolder !== null && imageAltOutputFolder !== void 0 ? imageAltOutputFolder : "/",
304835
305119
  imageExtensions: imageExtensions !== null && imageExtensions !== void 0 ? imageExtensions : WEB_IMAGE_EXTENSIONS,
304836
305120
  optimizeWebp: true,
304837
- processThumbnail: true,
305121
+ processThumbnail: f3 === file,
304838
305122
  maxSizeWebp
304839
305123
  });
304840
305124
  }
@@ -304902,7 +305186,8 @@ async function processProject(session, siteProject, opts) {
304902
305186
  file: page.file,
304903
305187
  checkLinks: checkLinks || strict,
304904
305188
  pageReferenceStates,
304905
- extraLinkTransformers
305189
+ extraLinkTransformers,
305190
+ site: true
304906
305191
  })));
304907
305192
  if (writeFiles) {
304908
305193
  await Promise.all(pagesToTransform.map(async (page) => {
@@ -309505,7 +309790,7 @@ var caption2 = (state, node3) => {
309505
309790
  };
309506
309791
  function getFootnoteNumber(node3) {
309507
309792
  var _a6;
309508
- return (_a6 = node3.number) !== null && _a6 !== void 0 ? _a6 : Number(node3.identifier);
309793
+ return (_a6 = Number.parseInt(node3.enumerator, 10)) !== null && _a6 !== void 0 ? _a6 : Number(node3.identifier);
309509
309794
  }
309510
309795
  var footnoteDefinition = (state, node3) => {
309511
309796
  const { children, current: current2 } = state;
@@ -318194,7 +318479,7 @@ function rewriteAssetsFolder(directory, baseurl) {
318194
318479
  if (![".html", ".js", ".json"].includes(import_node_path57.default.extname(file)))
318195
318480
  return;
318196
318481
  const data = import_fs_extra.default.readFileSync(file).toString();
318197
- const modified = data.replace(new RegExp(`\\/${ASSETS_FOLDER}\\/`, "g"), `${baseurl || ""}/build/`).replace('href="/favicon.ico"', `href="${baseurl || ""}/favicon.ico"`);
318482
+ 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"`);
318198
318483
  import_fs_extra.default.writeFileSync(file, modified);
318199
318484
  });
318200
318485
  }
@@ -325312,7 +325597,7 @@ var TOCTreeOptions = z.object({
325312
325597
  caption: z.string(),
325313
325598
  hidden: z.boolean(),
325314
325599
  maxdepth: z.number(),
325315
- numberted: z.boolean(),
325600
+ numbered: z.boolean(),
325316
325601
  reversed: z.boolean(),
325317
325602
  titlesonly: z.boolean()
325318
325603
  }).partial();
@@ -325767,6 +326052,7 @@ async function upgradeGlossary(documentLines) {
325767
326052
 
325768
326053
  // ../myst-cli/dist/init/jupyter-book/upgrade.js
325769
326054
  async function upgradeJupyterBook(session, configFile) {
326055
+ var _a6, _b;
325770
326056
  const config3 = {
325771
326057
  version: 1,
325772
326058
  project: {}
@@ -325780,14 +326066,19 @@ async function upgradeJupyterBook(session, configFile) {
325780
326066
  session.log.info(`Migrating Jupyter Book configuration to ${source_default.blue("myst.yml")}`);
325781
326067
  ({ site: config3.site, project: config3.project } = upgradeConfig(configData2));
325782
326068
  }
325783
- if (await fsExists("_toc.yml")) {
325784
- const tocContent = await import_promises4.default.readFile("_toc.yml", { encoding: "utf-8" });
325785
- const tocData = validateSphinxExternalTOC(js_yaml_default.load(tocContent));
325786
- if (defined2(tocData)) {
325787
- session.log.info(`Migrating TOC to ${source_default.blue("myst.yml")}`);
325788
- config3.project.toc = upgradeTOC(session, tocData);
325789
- }
326069
+ if (!await fsExists("_toc.yml")) {
326070
+ throw new Error(`${source_default.blue("_toc.yml")} is a required Jupyter Book configuration file`);
326071
+ }
326072
+ const tocContent = await import_promises4.default.readFile("_toc.yml", { encoding: "utf-8" });
326073
+ const tocData = validateSphinxExternalTOC(js_yaml_default.load(tocContent));
326074
+ if (defined2(tocData)) {
326075
+ session.log.info(`Migrating TOC to ${source_default.blue("myst.yml")}`);
326076
+ config3.project.toc = upgradeTOC(session, tocData);
325790
326077
  }
326078
+ config3.site = (_a6 = config3.site) !== null && _a6 !== void 0 ? _a6 : {};
326079
+ config3.site.options = (_b = config3.site.options) !== null && _b !== void 0 ? _b : {};
326080
+ session.log.debug(source_default.dim(`Setting ${source_default.blue("site.options.folders")} to ${source_default.blue("true")}`));
326081
+ config3.site.options.folders = true;
325791
326082
  await upgradeProjectSyntax(session);
325792
326083
  await import_promises4.default.writeFile(configFile, js_yaml_default.dump(config3));
325793
326084
  await import_promises4.default.rename("_config.yml", "._config.yml.bak");
@@ -325968,6 +326259,7 @@ You can start the ${readableName()} web server later with:`), source_default.bol
325968
326259
 
325969
326260
  // ../myst-cli/dist/plugins.js
325970
326261
  var import_node_fs44 = __toESM(require("fs"), 1);
326262
+ var import_node_url3 = require("url");
325971
326263
 
325972
326264
  // ../myst-cli/dist/executablePlugin.js
325973
326265
  var import_node_child_process2 = require("child_process");
@@ -326109,10 +326401,11 @@ async function loadPlugins(session) {
326109
326401
  }
326110
326402
  session.log.debug(`Loading plugins: "${configPlugins.map((info) => `${info.path} (${info.type})`).join('", "')}"`);
326111
326403
  const modules = await Promise.all(configPlugins.map(async (info) => {
326404
+ var _a6, _b;
326112
326405
  const { type: type2, path: path44 } = info;
326113
326406
  switch (type2) {
326114
326407
  case "executable": {
326115
- if (!import_node_fs44.default.statSync(path44).isFile) {
326408
+ if (!((_a6 = import_node_fs44.default.statSync(path44, { throwIfNoEntry: false })) === null || _a6 === void 0 ? void 0 : _a6.isFile())) {
326116
326409
  addWarningForFile(session, path44, `Unknown plugin "${path44}", it must be an executable file`, "error", {
326117
326410
  ruleId: RuleId.pluginLoads
326118
326411
  });
@@ -326136,15 +326429,16 @@ async function loadPlugins(session) {
326136
326429
  return { path: path44, module: { plugin: plugin5 } };
326137
326430
  }
326138
326431
  case "javascript": {
326139
- if (!import_node_fs44.default.statSync(path44).isFile || !path44.endsWith(".mjs")) {
326432
+ if (!((_b = import_node_fs44.default.statSync(path44, { throwIfNoEntry: false })) === null || _b === void 0 ? void 0 : _b.isFile()) || !path44.endsWith(".mjs")) {
326140
326433
  addWarningForFile(session, path44, `Unknown plugin "${path44}", it must be an mjs file`, "error", {
326141
326434
  ruleId: RuleId.pluginLoads
326142
326435
  });
326143
326436
  return null;
326144
326437
  }
326145
326438
  let module2;
326439
+ const pathURL = (0, import_node_url3.pathToFileURL)(path44);
326146
326440
  try {
326147
- module2 = await import(path44);
326441
+ module2 = await import(pathURL.toString());
326148
326442
  } catch (error) {
326149
326443
  session.log.debug(`
326150
326444
 
@@ -326839,7 +327133,7 @@ var AbortError2 = class extends RequestError {
326839
327133
  var import_node_process8 = __toESM(require("process"), 1);
326840
327134
  var import_node_buffer4 = require("buffer");
326841
327135
  var import_node_stream6 = require("stream");
326842
- var import_node_url5 = require("url");
327136
+ var import_node_url6 = require("url");
326843
327137
  var import_node_http4 = __toESM(require("http"), 1);
326844
327138
 
326845
327139
  // ../../node_modules/@szmarczak/http-timer/dist/source/index.js
@@ -326949,7 +327243,7 @@ var source_default5 = timer;
326949
327243
 
326950
327244
  // ../../node_modules/cacheable-request/dist/index.js
326951
327245
  var import_node_events2 = __toESM(require("events"), 1);
326952
- var import_node_url3 = __toESM(require("url"), 1);
327246
+ var import_node_url4 = __toESM(require("url"), 1);
326953
327247
  var import_node_crypto5 = __toESM(require("crypto"), 1);
326954
327248
  var import_node_stream5 = __toESM(require("stream"), 1);
326955
327249
 
@@ -327278,10 +327572,10 @@ var CacheableRequest = class {
327278
327572
  this.request = () => (options, cb) => {
327279
327573
  let url;
327280
327574
  if (typeof options === "string") {
327281
- url = normalizeUrlObject(import_node_url3.default.parse(options));
327575
+ url = normalizeUrlObject(import_node_url4.default.parse(options));
327282
327576
  options = {};
327283
- } else if (options instanceof import_node_url3.default.URL) {
327284
- url = normalizeUrlObject(import_node_url3.default.parse(options.toString()));
327577
+ } else if (options instanceof import_node_url4.default.URL) {
327578
+ url = normalizeUrlObject(import_node_url4.default.parse(options.toString()));
327285
327579
  options = {};
327286
327580
  } else {
327287
327581
  const [pathname, ...searchParts] = (options.path ?? "").split("?");
@@ -327299,7 +327593,7 @@ var CacheableRequest = class {
327299
327593
  };
327300
327594
  options.headers = Object.fromEntries(entries(options.headers).map(([key3, value]) => [key3.toLowerCase(), value]));
327301
327595
  const ee = new import_node_events2.default();
327302
- const normalizedUrlString = normalizeUrl(import_node_url3.default.format(url), {
327596
+ const normalizedUrlString = normalizeUrl(import_node_url4.default.format(url), {
327303
327597
  stripWWW: false,
327304
327598
  removeTrailingSlash: false,
327305
327599
  stripAuthentication: false
@@ -328034,7 +328328,7 @@ var calculate_retry_delay_default = calculateRetryDelay;
328034
328328
  // ../../node_modules/got/dist/source/core/options.js
328035
328329
  var import_node_process7 = __toESM(require("process"), 1);
328036
328330
  var import_node_util6 = require("util");
328037
- var import_node_url4 = require("url");
328331
+ var import_node_url5 = require("url");
328038
328332
  var import_node_tls = require("tls");
328039
328333
  var import_node_http3 = __toESM(require("http"), 1);
328040
328334
  var import_node_https2 = __toESM(require("https"), 1);
@@ -328579,7 +328873,7 @@ var defaultInternals = {
328579
328873
  const next = parsed.find((entry) => entry.parameters.rel === "next" || entry.parameters.rel === '"next"');
328580
328874
  if (next) {
328581
328875
  return {
328582
- url: new import_node_url4.URL(next.reference, response.url)
328876
+ url: new import_node_url5.URL(next.reference, response.url)
328583
328877
  };
328584
328878
  }
328585
328879
  return false;
@@ -328620,7 +328914,7 @@ var cloneInternals = (internals) => {
328620
328914
  beforeRetry: [...hooks.beforeRetry],
328621
328915
  afterResponse: [...hooks.afterResponse]
328622
328916
  },
328623
- searchParams: internals.searchParams ? new import_node_url4.URLSearchParams(internals.searchParams) : void 0,
328917
+ searchParams: internals.searchParams ? new import_node_url5.URLSearchParams(internals.searchParams) : void 0,
328624
328918
  pagination: { ...internals.pagination }
328625
328919
  };
328626
328920
  if (result.url !== void 0) {
@@ -329071,7 +329365,7 @@ var Options2 = class {
329071
329365
  throw new Error("`url` must not start with a slash");
329072
329366
  }
329073
329367
  const urlString = `${this.prefixUrl}${value.toString()}`;
329074
- const url = new import_node_url4.URL(urlString);
329368
+ const url = new import_node_url5.URL(urlString);
329075
329369
  this._internals.url = url;
329076
329370
  if (url.protocol === "unix:") {
329077
329371
  url.href = `http://unix${url.pathname}${url.search}`;
@@ -329205,7 +329499,7 @@ var Options2 = class {
329205
329499
  return this._internals.url.searchParams;
329206
329500
  }
329207
329501
  if (this._internals.searchParams === void 0) {
329208
- this._internals.searchParams = new import_node_url4.URLSearchParams();
329502
+ this._internals.searchParams = new import_node_url5.URLSearchParams();
329209
329503
  }
329210
329504
  return this._internals.searchParams;
329211
329505
  }
@@ -329222,12 +329516,12 @@ var Options2 = class {
329222
329516
  const searchParameters = this.searchParams;
329223
329517
  let updated;
329224
329518
  if (dist_default5.string(value)) {
329225
- updated = new import_node_url4.URLSearchParams(value);
329226
- } else if (value instanceof import_node_url4.URLSearchParams) {
329519
+ updated = new import_node_url5.URLSearchParams(value);
329520
+ } else if (value instanceof import_node_url5.URLSearchParams) {
329227
329521
  updated = value;
329228
329522
  } else {
329229
329523
  validateSearchParameters(value);
329230
- updated = new import_node_url4.URLSearchParams();
329524
+ updated = new import_node_url5.URLSearchParams();
329231
329525
  for (const key2 in value) {
329232
329526
  const entry = value[key2];
329233
329527
  if (entry === null) {
@@ -330536,7 +330830,7 @@ var Request3 = class extends import_node_stream6.Duplex {
330536
330830
  }
330537
330831
  const { form } = options;
330538
330832
  options.form = void 0;
330539
- options.body = new import_node_url5.URLSearchParams(form).toString();
330833
+ options.body = new import_node_url6.URLSearchParams(form).toString();
330540
330834
  } else {
330541
330835
  if (noContentType) {
330542
330836
  headers["content-type"] = "application/json";
@@ -330640,7 +330934,7 @@ var Request3 = class extends import_node_stream6.Duplex {
330640
330934
  }
330641
330935
  try {
330642
330936
  const redirectBuffer = import_node_buffer4.Buffer.from(response.headers.location, "binary").toString();
330643
- const redirectUrl = new import_node_url5.URL(redirectBuffer, url);
330937
+ const redirectUrl = new import_node_url6.URL(redirectBuffer, url);
330644
330938
  if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {
330645
330939
  this._beforeError(new RequestError("Cannot redirect to UNIX socket", {}, this));
330646
330940
  return;
File without changes
File without changes
File without changes
File without changes
File without changes