From 278514e1adb65527c104459ad8f59774d577f730 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Mon, 6 Jan 2025 08:53:31 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=81=20Join=20gates=20plugin=20before?= =?UTF-8?q?=20blocks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/slow-cars-smash.md | 6 ++++++ packages/myst-cli/src/process/mdast.ts | 4 +--- packages/myst-transforms/src/basic.ts | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/slow-cars-smash.md diff --git a/.changeset/slow-cars-smash.md b/.changeset/slow-cars-smash.md new file mode 100644 index 000000000..c5e897706 --- /dev/null +++ b/.changeset/slow-cars-smash.md @@ -0,0 +1,6 @@ +--- +"myst-transforms": patch +"myst-cli": patch +--- + +join gates plugin moved before blocks diff --git a/packages/myst-cli/src/process/mdast.ts b/packages/myst-cli/src/process/mdast.ts index fb50a03cd..f620767d3 100644 --- a/packages/myst-cli/src/process/mdast.ts +++ b/packages/myst-cli/src/process/mdast.ts @@ -25,7 +25,6 @@ import { RRIDTransformer, RORTransformer, DOITransformer, - joinGatesPlugin, glossaryPlugin, abbreviationPlugin, reconstructHtmlPlugin, @@ -197,8 +196,7 @@ export async function transformMdast( .use(glossaryPlugin) // This should be before the enumerate plugins .use(abbreviationPlugin, { abbreviations: frontmatter.abbreviations }) .use(indexIdentifierPlugin) - .use(enumerateTargetsPlugin, { state }) // This should be after math/container transforms - .use(joinGatesPlugin); + .use(enumerateTargetsPlugin, { state }); // This should be after math/container transforms // Load custom transform plugins session.plugins?.transforms.forEach((t) => { if (t.stage !== 'document') return; diff --git a/packages/myst-transforms/src/basic.ts b/packages/myst-transforms/src/basic.ts index acec0b037..2a0bd2c81 100644 --- a/packages/myst-transforms/src/basic.ts +++ b/packages/myst-transforms/src/basic.ts @@ -14,6 +14,7 @@ import { codeBlockToDirectiveTransform, inlineCodeFlattenTransform } from './cod import { removeUnicodeTransform } from './removeUnicode.js'; import { containerChildrenTransform } from './containers.js'; import { headingDepthTransform } from './headings.js'; +import { joinGatesTransform } from './joinGates.js'; export function basicTransformations(tree: GenericParent, file: VFile, opts?: Record) { // lifting roles and directives must happen before the mystTarget transformation @@ -31,6 +32,7 @@ export function basicTransformations(tree: GenericParent, file: VFile, opts?: Re headingLabelTransform(tree); admonitionBlockquoteTransform(tree); // Must be before header transforms admonitionHeadersTransform(tree); + joinGatesTransform(tree, file); // This should be before block nesting blockNestingTransform(tree); // Block metadata may contain labels/html_ids blockMetadataTransform(tree, file);