mystmd 1.6.0__tar.gz → 1.6.1__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.6.0 → mystmd-1.6.1}/PKG-INFO +1 -1
- {mystmd-1.6.0 → mystmd-1.6.1}/_package.json +2 -2
- {mystmd-1.6.0 → mystmd-1.6.1}/src/mystmd_py/myst.cjs +115 -36
- {mystmd-1.6.0 → mystmd-1.6.1}/.gitignore +0 -0
- {mystmd-1.6.0 → mystmd-1.6.1}/LICENSE +0 -0
- {mystmd-1.6.0 → mystmd-1.6.1}/README.md +0 -0
- {mystmd-1.6.0 → mystmd-1.6.1}/pyproject.toml +0 -0
- {mystmd-1.6.0 → mystmd-1.6.1}/src/mystmd_py/__init__.py +0 -0
- {mystmd-1.6.0 → mystmd-1.6.1}/src/mystmd_py/main.py +0 -0
- {mystmd-1.6.0 → mystmd-1.6.1}/src/mystmd_py/nodeenv.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "mystmd",
|
3
|
-
"version": "1.6.
|
3
|
+
"version": "1.6.1",
|
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.6.
|
48
|
+
"myst-cli": "^1.6.1"
|
49
49
|
}
|
50
50
|
}
|
@@ -193391,7 +193391,7 @@ var {
|
|
193391
193391
|
} = import_index.default;
|
193392
193392
|
|
193393
193393
|
// src/version.ts
|
193394
|
-
var version = "1.6.
|
193394
|
+
var version = "1.6.1";
|
193395
193395
|
var version_default = version;
|
193396
193396
|
|
193397
193397
|
// ../myst-cli/dist/build/build.js
|
@@ -195264,6 +195264,7 @@ var PROJECT_AND_PAGE_FRONTMATTER_KEYS = [
|
|
195264
195264
|
"settings",
|
195265
195265
|
// We maybe want to move this into site frontmatter in the future
|
195266
195266
|
"edit_url",
|
195267
|
+
"source_url",
|
195267
195268
|
...KNOWN_EXTERNAL_IDENTIFIERS,
|
195268
195269
|
// Do not add any project specific keys here!
|
195269
195270
|
...SITE_FRONTMATTER_KEYS
|
@@ -199366,6 +199367,11 @@ function validateProjectAndPageFrontmatterKeys(value, opts) {
|
|
199366
199367
|
} else if (defined(value.edit_url)) {
|
199367
199368
|
output2.edit_url = validateUrl(value.edit_url, incrementOptions("edit_url", opts));
|
199368
199369
|
}
|
199370
|
+
if (value.source_url === null) {
|
199371
|
+
output2.source_url = null;
|
199372
|
+
} else if (defined(value.source_url)) {
|
199373
|
+
output2.source_url = validateUrl(value.source_url, incrementOptions("source_url", opts));
|
199374
|
+
}
|
199369
199375
|
return output2;
|
199370
199376
|
}
|
199371
199377
|
function validateProjectFrontmatterKeys(value, opts) {
|
@@ -205195,10 +205201,19 @@ function buffer(value) {
|
|
205195
205201
|
|
205196
205202
|
// ../myst-transforms/dist/admonitions.js
|
205197
205203
|
var githubAdmonitionKinds = ["note", "tip", "important", "warning", "caution"];
|
205204
|
+
function getPossibleAdmonitionHeaderChildren(possibleHeading) {
|
205205
|
+
var _a6;
|
205206
|
+
if ((possibleHeading === null || possibleHeading === void 0 ? void 0 : possibleHeading.type) === "paragraph" && ((_a6 = possibleHeading.children) === null || _a6 === void 0 ? void 0 : _a6.length) === 1 && possibleHeading.children[0].type === "strong") {
|
205207
|
+
return possibleHeading.children[0].children;
|
205208
|
+
} else if ((possibleHeading === null || possibleHeading === void 0 ? void 0 : possibleHeading.type) === "heading") {
|
205209
|
+
return possibleHeading.children;
|
205210
|
+
}
|
205211
|
+
return void 0;
|
205212
|
+
}
|
205198
205213
|
function admonitionHeadersTransform(tree, opts) {
|
205199
205214
|
const admonitions = selectAll("admonition", tree);
|
205200
205215
|
admonitions.forEach((node3) => {
|
205201
|
-
var _a6, _b, _c, _d2
|
205216
|
+
var _a6, _b, _c, _d2;
|
205202
205217
|
if (!node3.kind || node3.kind === AdmonitionKind.admonition || // This condition is legacy
|
205203
205218
|
((_b = (_a6 = node3.children) === null || _a6 === void 0 ? void 0 : _a6[0]) === null || _b === void 0 ? void 0 : _b.type) === "admonitionTitle") {
|
205204
205219
|
return;
|
@@ -205212,12 +205227,9 @@ function admonitionHeadersTransform(tree, opts) {
|
|
205212
205227
|
];
|
205213
205228
|
if ((_d2 = opts === null || opts === void 0 ? void 0 : opts.replaceAdmonitionTitles) !== null && _d2 !== void 0 ? _d2 : true) {
|
205214
205229
|
const [admonitionHeader, possibleHeading, ...rest] = node3.children;
|
205215
|
-
|
205216
|
-
|
205217
|
-
admonitionHeader.children =
|
205218
|
-
node3.children = [admonitionHeader, ...rest];
|
205219
|
-
} else if ((possibleHeading === null || possibleHeading === void 0 ? void 0 : possibleHeading.type) === "heading") {
|
205220
|
-
admonitionHeader.children = possibleHeading.children;
|
205230
|
+
const headerChildren = getPossibleAdmonitionHeaderChildren(possibleHeading);
|
205231
|
+
if (headerChildren) {
|
205232
|
+
admonitionHeader.children = headerChildren;
|
205221
205233
|
node3.children = [admonitionHeader, ...rest];
|
205222
205234
|
}
|
205223
205235
|
}
|
@@ -288336,6 +288348,60 @@ function getTokenHandlers(specHandlers) {
|
|
288336
288348
|
return handlers6;
|
288337
288349
|
}
|
288338
288350
|
|
288351
|
+
// ../myst-parser/dist/transforms/listItemParagraphs.js
|
288352
|
+
function listItemParagraphsTransform(tree) {
|
288353
|
+
selectAll("listItem", tree).forEach((node3) => {
|
288354
|
+
if (!node3.children || node3.children.length === 0)
|
288355
|
+
return;
|
288356
|
+
const phrasingTypes2 = /* @__PURE__ */ new Set([
|
288357
|
+
"text",
|
288358
|
+
"emphasis",
|
288359
|
+
"strong",
|
288360
|
+
"delete",
|
288361
|
+
"link",
|
288362
|
+
"image",
|
288363
|
+
"break",
|
288364
|
+
"subscript",
|
288365
|
+
"superscript",
|
288366
|
+
"smallcaps",
|
288367
|
+
"inlineCode",
|
288368
|
+
"inlineMath",
|
288369
|
+
"mystRole",
|
288370
|
+
"footnoteReference",
|
288371
|
+
"crossReference",
|
288372
|
+
"cite",
|
288373
|
+
"citeGroup",
|
288374
|
+
"html"
|
288375
|
+
]);
|
288376
|
+
const hasPhrasingContent = node3.children.some((child) => phrasingTypes2.has(child.type));
|
288377
|
+
if (hasPhrasingContent) {
|
288378
|
+
const newChildren = [];
|
288379
|
+
let currentPhrasingGroup = [];
|
288380
|
+
node3.children.forEach((child) => {
|
288381
|
+
if (phrasingTypes2.has(child.type)) {
|
288382
|
+
currentPhrasingGroup.push(child);
|
288383
|
+
} else {
|
288384
|
+
if (currentPhrasingGroup.length > 0) {
|
288385
|
+
newChildren.push({
|
288386
|
+
type: "paragraph",
|
288387
|
+
children: currentPhrasingGroup
|
288388
|
+
});
|
288389
|
+
currentPhrasingGroup = [];
|
288390
|
+
}
|
288391
|
+
newChildren.push(child);
|
288392
|
+
}
|
288393
|
+
});
|
288394
|
+
if (currentPhrasingGroup.length > 0) {
|
288395
|
+
newChildren.push({
|
288396
|
+
type: "paragraph",
|
288397
|
+
children: currentPhrasingGroup
|
288398
|
+
});
|
288399
|
+
}
|
288400
|
+
node3.children = newChildren;
|
288401
|
+
}
|
288402
|
+
});
|
288403
|
+
}
|
288404
|
+
|
288339
288405
|
// ../myst-parser/dist/tokensToMyst.js
|
288340
288406
|
function computeAmsmathTightness(src, map14) {
|
288341
288407
|
var _a6;
|
@@ -288835,6 +288901,7 @@ function nestSingleImagesIntoParagraphs(tree) {
|
|
288835
288901
|
var defaultOptions2 = {
|
288836
288902
|
handlers: defaultMdast,
|
288837
288903
|
hoistSingleImagesOutofParagraphs: true,
|
288904
|
+
listItemParagraphs: true,
|
288838
288905
|
nestBlocks: true
|
288839
288906
|
};
|
288840
288907
|
function tokensToMyst(src, tokens, options = defaultOptions2) {
|
@@ -288864,6 +288931,9 @@ function tokensToMyst(src, tokens, options = defaultOptions2) {
|
|
288864
288931
|
}
|
288865
288932
|
}
|
288866
288933
|
});
|
288934
|
+
if (opts.listItemParagraphs) {
|
288935
|
+
listItemParagraphsTransform(tree);
|
288936
|
+
}
|
288867
288937
|
visit(tree, "crossReference", (node3) => {
|
288868
288938
|
delete node3.children;
|
288869
288939
|
if (node3.value) {
|
@@ -289790,11 +289860,9 @@ var tabItemDirective = {
|
|
289790
289860
|
var tabDirectives = [tabSetDirective, tabItemDirective];
|
289791
289861
|
|
289792
289862
|
// ../myst-cli/dist/process/myst.js
|
289793
|
-
function
|
289863
|
+
function getMystParserOptions(session, opts) {
|
289794
289864
|
var _a6, _b, _c, _d2;
|
289795
|
-
|
289796
|
-
vfile2.path = file;
|
289797
|
-
const parsed = mystParse(content3, {
|
289865
|
+
return {
|
289798
289866
|
markdownit: { linkify: true },
|
289799
289867
|
directives: [
|
289800
289868
|
cardDirective,
|
@@ -289807,9 +289875,14 @@ function parseMyst(session, content3, file, opts) {
|
|
289807
289875
|
extensions: {
|
289808
289876
|
frontmatter: !(opts === null || opts === void 0 ? void 0 : opts.ignoreFrontmatter)
|
289809
289877
|
},
|
289810
|
-
roles: [buttonRole, ...(_d2 = (_c = session.plugins) === null || _c === void 0 ? void 0 : _c.roles) !== null && _d2 !== void 0 ? _d2 : []]
|
289811
|
-
|
289812
|
-
|
289878
|
+
roles: [buttonRole, ...(_d2 = (_c = session.plugins) === null || _c === void 0 ? void 0 : _c.roles) !== null && _d2 !== void 0 ? _d2 : []]
|
289879
|
+
};
|
289880
|
+
}
|
289881
|
+
function parseMyst(session, content3, file, opts) {
|
289882
|
+
const vfile2 = new VFile();
|
289883
|
+
vfile2.path = file;
|
289884
|
+
const parserOptions = getMystParserOptions(session, opts);
|
289885
|
+
const parsed = mystParse(content3, { ...parserOptions, vfile: vfile2 });
|
289813
289886
|
logMessagesFromVFile(session, vfile2);
|
289814
289887
|
return parsed;
|
289815
289888
|
}
|
@@ -289993,7 +290066,7 @@ var import_mime_types = __toESM(require_mime_types(), 1);
|
|
289993
290066
|
var import_node_path16 = __toESM(require("path"), 1);
|
289994
290067
|
|
289995
290068
|
// ../myst-cli/dist/version.js
|
289996
|
-
var version2 = "1.6.
|
290069
|
+
var version2 = "1.6.1";
|
289997
290070
|
var version_default2 = version2;
|
289998
290071
|
|
289999
290072
|
// ../myst-cli/dist/utils/headers.js
|
@@ -291798,14 +291871,6 @@ async function getValidatedConfigsFromFile(session, file, vfile2, stack) {
|
|
291798
291871
|
}
|
291799
291872
|
const { site: rawSite, project: rawProject } = conf !== null && conf !== void 0 ? conf : {};
|
291800
291873
|
const path44 = (0, import_node_path18.dirname)(file);
|
291801
|
-
if (rawSite) {
|
291802
|
-
site = fillSiteConfig(await validateSiteConfigAndThrow(session, path44, vfile2, rawSite), site !== null && site !== void 0 ? site : {}, incrementOptions("extend", opts));
|
291803
|
-
}
|
291804
|
-
if (site) {
|
291805
|
-
session.log.debug(`Loaded site config from ${file}`);
|
291806
|
-
} else {
|
291807
|
-
session.log.debug(`No site config in ${file}`);
|
291808
|
-
}
|
291809
291874
|
if (rawProject) {
|
291810
291875
|
project = fillProjectFrontmatter(await validateProjectConfigAndThrow(session, path44, vfile2, rawProject), project !== null && project !== void 0 ? project : {}, projectOpts);
|
291811
291876
|
}
|
@@ -291814,6 +291879,14 @@ async function getValidatedConfigsFromFile(session, file, vfile2, stack) {
|
|
291814
291879
|
} else {
|
291815
291880
|
session.log.debug(`No project config defined in ${file}`);
|
291816
291881
|
}
|
291882
|
+
if (rawSite) {
|
291883
|
+
site = fillSiteConfig(await validateSiteConfigAndThrow(session, path44, vfile2, rawSite), site !== null && site !== void 0 ? site : {}, incrementOptions("extend", opts));
|
291884
|
+
}
|
291885
|
+
if (site) {
|
291886
|
+
session.log.debug(`Loaded site config from ${file}`);
|
291887
|
+
} else {
|
291888
|
+
session.log.debug(`No site config in ${file}`);
|
291889
|
+
}
|
291817
291890
|
logMessagesFromVFile(session, vfile2);
|
291818
291891
|
return { site, project, extend: extend5 };
|
291819
291892
|
}
|
@@ -291964,13 +292037,6 @@ async function writeConfigs(session, path44, newConfigs) {
|
|
291964
292037
|
const file = configFromPath(session, path44) || defaultConfigFile(session, path44);
|
291965
292038
|
const vfile2 = new VFile();
|
291966
292039
|
vfile2.path = file;
|
291967
|
-
if (siteConfig) {
|
291968
|
-
saveSiteConfig(session, path44, await validateSiteConfigAndThrow(session, path44, vfile2, siteConfig));
|
291969
|
-
}
|
291970
|
-
siteConfig = selectors_exports.selectLocalSiteConfig(session.store.getState(), path44);
|
291971
|
-
if (siteConfig) {
|
291972
|
-
siteConfig = await resolveSiteConfigPaths(session, path44, siteConfig, resolveToRelative, file);
|
291973
|
-
}
|
291974
292040
|
if (projectConfig) {
|
291975
292041
|
saveProjectConfig(session, path44, await validateProjectConfigAndThrow(session, path44, vfile2, projectConfig));
|
291976
292042
|
}
|
@@ -291979,6 +292045,13 @@ async function writeConfigs(session, path44, newConfigs) {
|
|
291979
292045
|
projectConfig = prepareToWrite(projectConfig);
|
291980
292046
|
projectConfig = await resolveProjectConfigPaths(session, path44, projectConfig, resolveToRelative, file);
|
291981
292047
|
}
|
292048
|
+
if (siteConfig) {
|
292049
|
+
saveSiteConfig(session, path44, await validateSiteConfigAndThrow(session, path44, vfile2, siteConfig));
|
292050
|
+
}
|
292051
|
+
siteConfig = selectors_exports.selectLocalSiteConfig(session.store.getState(), path44);
|
292052
|
+
if (siteConfig) {
|
292053
|
+
siteConfig = await resolveSiteConfigPaths(session, path44, siteConfig, resolveToRelative, file);
|
292054
|
+
}
|
291982
292055
|
if (!siteConfig && !projectConfig) {
|
291983
292056
|
session.log.debug(`No new config to write to ${file}`);
|
291984
292057
|
return;
|
@@ -304720,7 +304793,8 @@ async function addEditUrl(session, frontmatter, file) {
|
|
304720
304793
|
const getGitRoot = makeExecutable("git rev-parse --show-toplevel", gitLog);
|
304721
304794
|
const gitRoot = (await getGitRoot()).trim();
|
304722
304795
|
if (gitBranch && gitRoot && file.startsWith(gitRoot)) {
|
304723
|
-
frontmatter.
|
304796
|
+
frontmatter.source_url = `${frontmatter.github}/blob/${gitBranch}${file.replace(gitRoot, "")}`;
|
304797
|
+
frontmatter.edit_url = `${frontmatter.github}/edit/${gitBranch}${file.replace(gitRoot, "")}`;
|
304724
304798
|
session.log.debug(`Added edit URL ${frontmatter.edit_url} to ${file}`);
|
304725
304799
|
}
|
304726
304800
|
} catch {
|
@@ -306907,8 +306981,13 @@ var handlers3 = {
|
|
306907
306981
|
}
|
306908
306982
|
},
|
306909
306983
|
listItem(node3, state) {
|
306984
|
+
var _a6, _b;
|
306910
306985
|
state.write("\\item ");
|
306911
|
-
|
306986
|
+
if (((_b = (_a6 = node3.children) === null || _a6 === void 0 ? void 0 : _a6[0]) === null || _b === void 0 ? void 0 : _b.type) === "paragraph" && node3.children.length === 1) {
|
306987
|
+
state.renderChildren(node3.children[0], true);
|
306988
|
+
} else {
|
306989
|
+
state.renderChildren(node3, true);
|
306990
|
+
}
|
306912
306991
|
state.write("\n");
|
306913
306992
|
},
|
306914
306993
|
thematicBreak(node3, state) {
|
@@ -313424,7 +313503,7 @@ To resolve this, run: myst build --all`, {
|
|
313424
313503
|
});
|
313425
313504
|
}
|
313426
313505
|
});
|
313427
|
-
const manuscriptExports = (await collectExportOptions(session, articleFile ? [articleFile] : [], [ExportFormats.docx, ExportFormats.pdf, ExportFormats.tex], {
|
313506
|
+
const manuscriptExports = (await collectExportOptions(session, articleFile ? [articleFile] : [], [ExportFormats.docx, ExportFormats.pdf, ExportFormats.tex, ExportFormats.typst], {
|
313428
313507
|
projectPath
|
313429
313508
|
})).filter((exp) => {
|
313430
313509
|
return exp.format !== ExportFormats.tex || import_node_path51.default.extname(exp.output) === ".zip";
|
@@ -321748,7 +321827,7 @@ ${filename}
|
|
321748
321827
|
|
321749
321828
|
${githubPagesUrl}
|
321750
321829
|
` : "on your https://{{ organization }}.github.io/{{ repo }} domain"}
|
321751
|
-
7. \u{1F389} Celebrate and tell us about your site on
|
321830
|
+
7. \u{1F389} Celebrate and tell us about your site on BlueSky or Mastodon! \u{1F426} \u{1F418}
|
321752
321831
|
`);
|
321753
321832
|
}
|
321754
321833
|
async function githubCurvenoteAction(session) {
|
@@ -321791,7 +321870,7 @@ ${filename}
|
|
321791
321870
|
${githubUrl}/actions
|
321792
321871
|
` : ""}
|
321793
321872
|
7. Once the action completes, your site should be deployed
|
321794
|
-
8. \u{1F389} Celebrate and tell us about your site on
|
321873
|
+
8. \u{1F389} Celebrate and tell us about your site on BlueSky or Mastodon! \u{1F426} \u{1F418}
|
321795
321874
|
`);
|
321796
321875
|
}
|
321797
321876
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|