Skip to content

Commit

Permalink
chore: rebuild lockfiles (#205)
Browse files Browse the repository at this point in the history
* chore: rebuild lockfiles

* fix: packages
  • Loading branch information
agoose77 authored Feb 6, 2024
1 parent 08881df commit b32a676
Show file tree
Hide file tree
Showing 4 changed files with 5,960 additions and 1,751 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
Loading

0 comments on commit b32a676

Please sign in to comment.