Skip to content

Commit

Permalink
🙈 Remove hidden output nodes from static exports
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed Jan 10, 2025
1 parent 983e3bf commit 72fa607
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-onions-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"myst-cli": patch
---

Remove hidden output nodes from PDF exports
5 changes: 5 additions & 0 deletions packages/myst-cli/src/transforms/outputs.ts
Original file line number Diff line number Diff line change
@@ -236,6 +236,11 @@ export function reduceOutputs(
const outputs = selectAll('output', mdast) as GenericNode[];
const cache = castSession(session);
outputs.forEach((node) => {
if (node.visibility === 'remove' || node.visibility === 'hide') {
// Hidden nodes should not show up in simplified outputs for static export
node.type = '__delete__';
return;
}
if (!node.data?.length && !node.children?.length) {
node.type = '__delete__';
return;

0 comments on commit 72fa607

Please sign in to comment.