Skip to content

Commit

Permalink
✨ Apply HTML transforms in demo (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Apr 19, 2024
1 parent 36282f2 commit 407e054
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-waves-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'myst-demo': patch
---

Apply html transforms
4 changes: 4 additions & 0 deletions packages/myst-demo/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ async function parse(
mathPlugin,
footnotesPlugin,
keysPlugin,
htmlPlugin,
reconstructHtmlPlugin,
basicTransformationsPlugin,
enumerateTargetsPlugin,
resolveReferencesPlugin,
Expand Down Expand Up @@ -163,6 +165,8 @@ async function parse(
}
});
unified()
.use(reconstructHtmlPlugin) // We need to group and link the HTML first
.use(htmlPlugin) // Some of the HTML plugins need to operate on the transformed html, e.g. figure caption transforms
.use(basicTransformationsPlugin, { parser: parseMyst })
.use(mathPlugin, { macros: frontmatter?.math ?? {} }) // This must happen before enumeration, as it can add labels
.use(glossaryPlugin) // This should be before the enumerate plugins
Expand Down

0 comments on commit 407e054

Please sign in to comment.