Skip to content

Commit

Permalink
🔧 Correctly mark frontmatter part blocks as visibility: remove
Browse files Browse the repository at this point in the history
  • Loading branch information
fwkoch committed Nov 9, 2023
1 parent c0da750 commit a1a5605
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/myst-cli/src/transforms/parts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ describe('frontmatterPartsTransform', () => {
children: [
{
type: 'block',
data: { part: 'abstract', hidden: true },
data: { part: 'abstract' },
visibility: 'remove',
children: [
{ type: 'paragraph', children: [{ type: 'text', value: 'This is my abstract' }] },
],
},
{
type: 'block',
data: { part: 'statement', hidden: true },
data: { part: 'statement' },
visibility: 'remove',
children: [
{ type: 'paragraph', children: [{ type: 'text', value: 'and this is my statement' }] },
],
Expand Down
3 changes: 2 additions & 1 deletion packages/myst-cli/src/transforms/parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export function frontmatterPartsTransform(
) {
if (!frontmatter.parts) return;
const partBlocks = Object.entries(frontmatter.parts).map(([part, content]) => {
const data = { part, hidden: true };
const data = { part };
const root = parseMyst(session, content, file);
return {
type: 'block',
data,
visibility: 'remove',
children: root.children,
} as Block;
});
Expand Down

0 comments on commit a1a5605

Please sign in to comment.