Skip to content

Commit 7c50a14

Browse files
committed
Add for JATS as well.
1 parent a7a364c commit 7c50a14

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/myst-cli/src/build/jats/single.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ import { resolveFrontmatterParts } from '../../utils/resolveFrontmatterParts.js'
1414
import type { ExportWithOutput, ExportFnOptions } from '../types.js';
1515
import { cleanOutput } from '../utils/cleanOutput.js';
1616
import { getFileContent } from '../utils/getFileContent.js';
17+
import { mermaidPlugin } from '../../transforms/mermaid.js';
18+
import type { TransformSpec } from 'myst-common';
19+
20+
const mermaidTransform: TransformSpec = {
21+
name: 'mermaid',
22+
stage: 'document',
23+
plugin: mermaidPlugin,
24+
options: {
25+
format: 'png',
26+
},
27+
};
1728

1829
/**
1930
* Build a MyST project as JATS XML
@@ -39,6 +50,7 @@ export async function runJatsExport(
3950
projectPath,
4051
imageExtensions: KNOWN_IMAGE_EXTENSIONS,
4152
extraLinkTransformers,
53+
transforms: [mermaidTransform],
4254
preFrontmatters: [
4355
filterKeys(article, [...PAGE_FRONTMATTER_KEYS, ...Object.keys(FRONTMATTER_ALIASES)]),
4456
], // only apply to article, not sub_articles

0 commit comments

Comments
 (0)