Skip to content

Commit

Permalink
fix: packages
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Feb 6, 2024
1 parent 7fa0589 commit 34268ed
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 93 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,9 @@
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
},
"resolutions": {
"myst-spec": "0.0.4",
"myst-frontmatter": "1.1.22"
}
}
30 changes: 15 additions & 15 deletions src/myst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,24 @@ export async function processArticleMDAST(
article: mdast as any
};

const { frontmatter: frontmatterRaw } = getFrontmatter(file, mdast, {
removeYaml: true,
removeHeading: true
});
const { frontmatter: frontmatterRaw, identifiers } = getFrontmatter(
file,
mdast,
{}
);
const frontmatter = validatePageFrontmatter(frontmatterRaw, {
property: 'frontmatter',
messages: {}
});

const state = new ReferenceState({
const state = new ReferenceState('<internal>', {
numbering: frontmatter.numbering,
file
vfile: file,
identifiers
});
unified()
.use(mathPlugin, { macros: frontmatter?.math ?? {} }) // This must happen before enumeration, as it can add labels
.use(glossaryPlugin, { state }) // This should be before the enumerate plugins
.use(glossaryPlugin) // This should be before the enumerate plugins
.use(abbreviationPlugin, { abbreviations: frontmatter.abbreviations })
.use(enumerateTargetsPlugin, { state })
.use(linksPlugin, { transformers: linkTransforms })
Expand Down Expand Up @@ -158,29 +160,27 @@ export async function processNotebookMDAST(
cite: { order: [], data: {} },
article: mdast as any
};
const { frontmatter: frontmatterRaw } = getFrontmatter(
const { frontmatter: frontmatterRaw, identifiers } = getFrontmatter(
file,
// This is the first cell, which might have a YAML block or header.
mdast.children[0] as any,
{
removeYaml: true,
removeHeading: true
}
{}
);

const frontmatter = validatePageFrontmatter(frontmatterRaw, {
property: 'frontmatter',
messages: {}
});

const state = new ReferenceState({
const state = new ReferenceState('<internal>', {
numbering: frontmatter.numbering,
file
vfile: file,
identifiers
});

unified()
.use(mathPlugin, { macros: frontmatter?.math ?? {} }) // This must happen before enumeration, as it can add labels
.use(glossaryPlugin, { state }) // This should be before the enumerate plugins
.use(glossaryPlugin) // This should be before the enumerate plugins
.use(abbreviationPlugin, { abbreviations: frontmatter.abbreviations })
.use(enumerateTargetsPlugin, { state })
.use(linksPlugin, { transformers: linkTransforms })
Expand Down
98 changes: 20 additions & 78 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4111,20 +4111,20 @@ __metadata:
languageName: node
linkType: hard

"@types/unist@npm:*, @types/unist@npm:^3.0.0":
version: 3.0.2
resolution: "@types/unist@npm:3.0.2"
checksum: 3d04d0be69316e5f14599a0d993a208606c12818cf631fd399243d1dc7a9bd8a3917d6066baa6abc290814afbd744621484756803c80cba892c39cd4b4a85616
languageName: node
linkType: hard

"@types/unist@npm:^2, @types/unist@npm:^2.0.0":
"@types/unist@npm:*, @types/unist@npm:^2, @types/unist@npm:^2.0.0":
version: 2.0.10
resolution: "@types/unist@npm:2.0.10"
checksum: e2924e18dedf45f68a5c6ccd6015cd62f1643b1b43baac1854efa21ae9e70505db94290434a23da1137d9e31eb58e54ca175982005698ac37300a1c889f6c4aa
languageName: node
linkType: hard

"@types/unist@npm:^3.0.0":
version: 3.0.2
resolution: "@types/unist@npm:3.0.2"
checksum: 3d04d0be69316e5f14599a0d993a208606c12818cf631fd399243d1dc7a9bd8a3917d6066baa6abc290814afbd744621484756803c80cba892c39cd4b4a85616
languageName: node
linkType: hard

"@types/webpack-sources@npm:^0.1.5":
version: 0.1.12
resolution: "@types/webpack-sources@npm:0.1.12"
Expand Down Expand Up @@ -4480,7 +4480,7 @@ __metadata:
languageName: node
linkType: hard

"abab@npm:^2.0.3, abab@npm:^2.0.5, abab@npm:^2.0.6":
"abab@npm:^2.0.3, abab@npm:^2.0.6":
version: 2.0.6
resolution: "abab@npm:2.0.6"
checksum: 6ffc1af4ff315066c62600123990d87551ceb0aafa01e6539da77b0f5987ac7019466780bf480f1787576d4385e3690c81ccc37cfda12819bf510b8ab47e5a3e
Expand Down Expand Up @@ -5627,20 +5627,13 @@ __metadata:
languageName: node
linkType: hard

"csstype@npm:3.0.10":
"csstype@npm:3.0.10, csstype@npm:^3.0.2":
version: 3.0.10
resolution: "csstype@npm:3.0.10"
checksum: 20a8fa324f2b33ddf94aa7507d1b6ab3daa6f3cc308888dc50126585d7952f2471de69b2dbe0635d1fdc31223fef8e070842691877e725caf456e2378685a631
languageName: node
linkType: hard

"csstype@npm:^3.0.2":
version: 3.1.3
resolution: "csstype@npm:3.1.3"
checksum: 8db785cc92d259102725b3c694ec0c823f5619a84741b5c7991b8ad135dfaa66093038a1cc63e03361a6cd28d122be48f2106ae72334e067dd619a51f49eddf7
languageName: node
linkType: hard

"cytoscape-cose-bilkent@npm:^4.1.0":
version: 4.1.0
resolution: "cytoscape-cose-bilkent@npm:4.1.0"
Expand Down Expand Up @@ -6354,10 +6347,10 @@ __metadata:
languageName: node
linkType: hard

"entities@npm:^2.0.0":
version: 2.2.0
resolution: "entities@npm:2.2.0"
checksum: 19010dacaf0912c895ea262b4f6128574f9ccf8d4b3b65c7e8334ad0079b3706376360e28d8843ff50a78aabcb8f08f0a32dbfacdc77e47ed77ca08b713669b3
"entities@npm:^2.0.0, entities@npm:~2.1.0":
version: 2.1.0
resolution: "entities@npm:2.1.0"
checksum: a10a877e489586a3f6a691fe49bf3fc4e58f06c8e80522f08214a5150ba457e7017b447d4913a3fa041bda06ee4c92517baa4d8d75373eaa79369e9639225ffd
languageName: node
linkType: hard

Expand All @@ -6368,13 +6361,6 @@ __metadata:
languageName: node
linkType: hard

"entities@npm:~2.1.0":
version: 2.1.0
resolution: "entities@npm:2.1.0"
checksum: a10a877e489586a3f6a691fe49bf3fc4e58f06c8e80522f08214a5150ba457e7017b447d4913a3fa041bda06ee4c92517baa4d8d75373eaa79369e9639225ffd
languageName: node
linkType: hard

"entities@npm:~3.0.1":
version: 3.0.1
resolution: "entities@npm:3.0.1"
Expand Down Expand Up @@ -7179,21 +7165,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^7.1.3, glob@npm:^7.1.4":
version: 7.2.3
resolution: "glob@npm:7.2.3"
dependencies:
fs.realpath: ^1.0.0
inflight: ^1.0.4
inherits: 2
minimatch: ^3.1.1
once: ^1.3.0
path-is-absolute: ^1.0.0
checksum: 29452e97b38fa704dabb1d1045350fb2467cf0277e155aa9ff7077e90ad81d1ea9d53d3ee63bd37c05b09a065e90f16aec4a65f5b8de401d1dac40bc5605d133
languageName: node
linkType: hard

"glob@npm:~7.1.6":
"glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:~7.1.6":
version: 7.1.7
resolution: "glob@npm:7.1.7"
dependencies:
Expand Down Expand Up @@ -9800,7 +9772,7 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2":
"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.2":
version: 3.1.2
resolution: "minimatch@npm:3.1.2"
dependencies:
Expand Down Expand Up @@ -10024,7 +9996,7 @@ __metadata:
languageName: node
linkType: hard

"myst-frontmatter@npm:*, myst-frontmatter@npm:^1.1.21, myst-frontmatter@npm:^1.1.22":
"myst-frontmatter@npm:1.1.22":
version: 1.1.22
resolution: "myst-frontmatter@npm:1.1.22"
dependencies:
Expand Down Expand Up @@ -10084,20 +10056,13 @@ __metadata:
languageName: node
linkType: hard

"myst-spec@npm:^0.0.4":
"myst-spec@npm:0.0.4":
version: 0.0.4
resolution: "myst-spec@npm:0.0.4"
checksum: 2d99be3f9db36972d1ecc81cf7d1a8287bccc45b2ed4f49ee61df7d05466d9aa4955212116cfe787abbba77c46f218e736a0ba51e66d96006907d4c2967e35a5
languageName: node
linkType: hard

"myst-spec@npm:^0.0.5":
version: 0.0.5
resolution: "myst-spec@npm:0.0.5"
checksum: 322a8b15e839c15153d65f1cb014f0024a4e48320a4e1fab74d9ffcbd3b2700a8130809c6efd2436658a315badbdcd002b1c23ddf375164728cb80343f0f120f
languageName: node
linkType: hard

"myst-to-html@npm:1.0.22, myst-to-html@npm:^1.0.21":
version: 1.0.22
resolution: "myst-to-html@npm:1.0.22"
Expand Down Expand Up @@ -10922,14 +10887,7 @@ __metadata:
languageName: node
linkType: hard

"prismjs@npm:^1.27.0":
version: 1.29.0
resolution: "prismjs@npm:1.29.0"
checksum: 007a8869d4456ff8049dc59404e32d5666a07d99c3b0e30a18bd3b7676dfa07d1daae9d0f407f20983865fd8da56de91d09cb08e6aa61f5bc420a27c0beeaf93
languageName: node
linkType: hard

"prismjs@npm:~1.27.0":
"prismjs@npm:^1.27.0, prismjs@npm:~1.27.0":
version: 1.27.0
resolution: "prismjs@npm:1.27.0"
checksum: 85c7f4a3e999073502cc9e1882af01e3709706369ec254b60bff1149eda701f40d02512acab956012dc7e61cfd61743a3a34c1bd0737e8dbacd79141e5698bbc
Expand Down Expand Up @@ -11823,23 +11781,7 @@ __metadata:
languageName: node
linkType: hard

"source-map-loader@npm:^1.0.2":
version: 1.1.3
resolution: "source-map-loader@npm:1.1.3"
dependencies:
abab: ^2.0.5
iconv-lite: ^0.6.2
loader-utils: ^2.0.0
schema-utils: ^3.0.0
source-map: ^0.6.1
whatwg-mimetype: ^2.3.0
peerDependencies:
webpack: ^4.0.0 || ^5.0.0
checksum: 0ca16a1458f206e12925f242ce52913b5f35de657d2ec17fd60ab3de7fa85b72b6707951b7a18899bdf05679d679a8b9edeb660c557aafa66453886d6907e3ec
languageName: node
linkType: hard

"source-map-loader@npm:~1.0.2":
"source-map-loader@npm:^1.0.2, source-map-loader@npm:~1.0.2":
version: 1.0.2
resolution: "source-map-loader@npm:1.0.2"
dependencies:
Expand Down

0 comments on commit 34268ed

Please sign in to comment.