Skip to content

Comments

fix: correct the code blocks documentation#2505

Open
noahingh wants to merge 1 commit intoTypeCellOS:mainfrom
noahingh:fix-code-blocks-doc
Open

fix: correct the code blocks documentation#2505
noahingh wants to merge 1 commit intoTypeCellOS:mainfrom
noahingh:fix-code-blocks-doc

Conversation

@noahingh
Copy link

@noahingh noahingh commented Feb 22, 2026

Summary

I've made two corrections to the code blocks document.

  1. Put the codeBlock field under the blockSpecs field because it's not a root field.
  2. The dark and light theme is not supported in shiki.

public extend<
AdditionalBlockSpecs extends BlockSpecs = Record<string, never>,
AdditionalInlineContentSpecs extends Record<
string,
InlineContentSpec<InlineContentConfig>
> = Record<string, never>,
AdditionalStyleSpecs extends StyleSpecs = Record<string, never>,
>(opts: {
blockSpecs?: AdditionalBlockSpecs;
inlineContentSpecs?: AdditionalInlineContentSpecs;
styleSpecs?: AdditionalStyleSpecs;
}): CustomBlockNoteSchema<
AdditionalBlockSpecs extends undefined | Record<string, never>
? BSchema
: BSchema & {
[K in keyof AdditionalBlockSpecs]: K extends string
? AdditionalBlockSpecs[K]["config"]
: never;
},
AdditionalInlineContentSpecs extends undefined | Record<string, never>
? ISchema
: ISchema & {
[K in keyof AdditionalInlineContentSpecs]: AdditionalInlineContentSpecs[K]["config"];
},
AdditionalStyleSpecs extends undefined | Record<string, never>
? SSchema
: SSchema & {
[K in keyof AdditionalStyleSpecs]: AdditionalStyleSpecs[K]["config"];
}
> {
// Merge the new specs with existing ones
Object.assign(this.opts.blockSpecs, opts.blockSpecs);
Object.assign(this.opts.inlineContentSpecs, opts.inlineContentSpecs);
Object.assign(this.opts.styleSpecs, opts.styleSpecs);
// Reinitialize the block specs with the merged specs
const {
blockSpecs,
inlineContentSpecs,
styleSpecs,
blockSchema,
inlineContentSchema,
styleSchema,
} = this.init();
this.blockSpecs = blockSpecs;
this.styleSpecs = styleSpecs;
this.styleSchema = styleSchema;
this.inlineContentSpecs = inlineContentSpecs;
this.blockSchema = blockSchema;
this.inlineContentSchema = inlineContentSchema;
return this as any;
}
}

@vercel
Copy link

vercel bot commented Feb 22, 2026

@noahingh is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

@noahingh noahingh changed the title Correct the docs for code blocks fix: correct the code blocks documentation Feb 22, 2026
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