From a1a5605f3269211382ada56835220e5cc57a3052 Mon Sep 17 00:00:00 2001 From: Franklin Koch Date: Thu, 9 Nov 2023 14:28:08 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Correctly=20mark=20frontmatter?= =?UTF-8?q?=20part=20blocks=20as=20visibility:=20remove?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/myst-cli/src/transforms/parts.spec.ts | 6 ++++-- packages/myst-cli/src/transforms/parts.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/myst-cli/src/transforms/parts.spec.ts b/packages/myst-cli/src/transforms/parts.spec.ts index b5a6c192d..951a0f949 100644 --- a/packages/myst-cli/src/transforms/parts.spec.ts +++ b/packages/myst-cli/src/transforms/parts.spec.ts @@ -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' }] }, ], diff --git a/packages/myst-cli/src/transforms/parts.ts b/packages/myst-cli/src/transforms/parts.ts index cb90586ef..6631a1b3c 100644 --- a/packages/myst-cli/src/transforms/parts.ts +++ b/packages/myst-cli/src/transforms/parts.ts @@ -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; });