Skip to content

fix: correct showCellNumbers default and docs syntax error#7

Merged
abhay-ramesh merged 1 commit intomainfrom
fix/docs-and-defaults
Mar 27, 2026
Merged

fix: correct showCellNumbers default and docs syntax error#7
abhay-ramesh merged 1 commit intomainfrom
fix/docs-and-defaults

Conversation

@abhay-ramesh
Copy link
Copy Markdown
Owner

Changes

Two small correctness bugs caught during a codebase audit:

1. showCellNumbers default mismatch

NotebookLoader was defaulting showCellNumbers to true, but:

  • The directive options table in the docs says the default is false
  • NotebookCodeCell also defaults it to false
  • The remark plugin passes no value when the attribute is absent, so the component default is what users actually get

This meant cell numbers appeared unexpectedly for anyone using the :::notebook directive without explicitly setting showCellNumbers.

Fix: Change the NotebookLoader default from truefalse.

2. Missing comma in getMDXComponents docs example

The code snippet in the getting-started guide was missing a trailing comma:

// ❌ Before — syntax error
return {
  ...defaultMdxComponents,
  ...components    // ← missing comma
  ...notebookComponents,
}

// ✅ After
return {
  ...defaultMdxComponents,
  ...components,
  ...notebookComponents,
}

Copying this example verbatim produced a TypeScript compilation error.

Test plan

  • Using :::notebook{file="..."} without showCellNumbers no longer shows cell numbers
  • The docs example compiles without errors when copy-pasted

🤖 Generated with Claude Code

Two small correctness bugs:

1. NotebookLoader defaulted showCellNumbers to true, but the docs table,
   directive option reference, and NotebookCodeCell all document the
   default as false. Align the component default with the documented
   behaviour.

2. The getMDXComponents example in docs/index.mdx was missing a trailing
   comma after `...components`, producing a JavaScript syntax error when
   users copy-paste it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
notebook-mdx Ready Ready Preview, Comment Mar 27, 2026 5:55pm

@abhay-ramesh abhay-ramesh merged commit 8d0312e into main Mar 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant