Skip to content

Commit

Permalink
🌁 Join gates plugin before blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed Jan 6, 2025
1 parent 6f6032b commit 278514e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/slow-cars-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"myst-transforms": patch
"myst-cli": patch
---

join gates plugin moved before blocks
4 changes: 1 addition & 3 deletions packages/myst-cli/src/process/mdast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
RRIDTransformer,
RORTransformer,
DOITransformer,
joinGatesPlugin,
glossaryPlugin,
abbreviationPlugin,
reconstructHtmlPlugin,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions packages/myst-transforms/src/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>) {
// lifting roles and directives must happen before the mystTarget transformation
Expand All @@ -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);
Expand Down

0 comments on commit 278514e

Please sign in to comment.