Skip to content

[lexical-website] Documentation Update: re-sync the TabIndentationExtension snippet with its source - #9209

Merged
etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-extensions-tabindentation-sync
Sep 23, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-extensions-tabindentation-sync

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

extensions/defining-extensions.md and extensions/signals.md both reproduce
TabIndentationExtension as an example of a real shipped extension. Both
copies predate the $canIndent option: the interface declares two properties
where the source has three, the config object omits its default, and
register neither destructures it nor passes it to registerTabIndentation.

A reader copying either snippet as a template for their own extension gets a
config that silently drops a documented option.

Test plan

Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that the snippets match the source they
reproduce.

Before

$ grep -n "canIndent" packages/lexical-website/docs/extensions/defining-extensions.md packages/lexical-website/docs/extensions/signals.md

$ sed -n '138,146p' packages/lexical-extension/src/TabIndentationExtension.ts
export interface TabIndentationConfig {
  disabled: boolean;
  maxIndent: null | number;
  /**
   * By default, indents are set on all elements for which the {@link ElementNode.canIndent} returns true.
   * This option allows you to set indents for specific nodes without overriding the method for others.
   */
  $canIndent: CanIndentPredicate;
}

Neither copy mentions $canIndent.

After

$ grep -n "canIndent" packages/lexical-website/docs/extensions/defining-extensions.md packages/lexical-website/docs/extensions/signals.md
packages/lexical-website/docs/extensions/defining-extensions.md:241:  $canIndent: CanIndentPredicate;
packages/lexical-website/docs/extensions/defining-extensions.md:248:    $canIndent: $defaultCanIndent,
packages/lexical-website/docs/extensions/defining-extensions.md:253:    const {disabled, maxIndent, $canIndent} = state.getOutput();
packages/lexical-website/docs/extensions/defining-extensions.md:256:        return registerTabIndentation(editor, maxIndent, $canIndent);
packages/lexical-website/docs/extensions/signals.md:82:  $canIndent: CanIndentPredicate;
packages/lexical-website/docs/extensions/signals.md:89:    $canIndent: $defaultCanIndent,
packages/lexical-website/docs/extensions/signals.md:94:    const {disabled, maxIndent, $canIndent} = state.getOutput();
packages/lexical-website/docs/extensions/signals.md:100:        return registerTabIndentation(editor, maxIndent, $canIndent);

Both now match packages/lexical-extension/src/TabIndentationExtension.ts:138-169.
The signals.md copy keeps its own inline comment about peek, which is
specific to that page.

…ension snippet with its source

## Description

`extensions/defining-extensions.md` and `extensions/signals.md` both reproduce
`TabIndentationExtension` as an example of a real shipped extension. Both
copies predate the `$canIndent` option: the interface declares two properties
where the source has three, the `config` object omits its default, and
`register` neither destructures it nor passes it to `registerTabIndentation`.

A reader copying either snippet as a template for their own extension gets a
config that silently drops a documented option.

## Test plan

Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that the snippets match the source they
reproduce.

### Before

```
$ grep -n "canIndent" packages/lexical-website/docs/extensions/defining-extensions.md packages/lexical-website/docs/extensions/signals.md

$ sed -n '138,146p' packages/lexical-extension/src/TabIndentationExtension.ts
export interface TabIndentationConfig {
  disabled: boolean;
  maxIndent: null | number;
  /**
   * By default, indents are set on all elements for which the {@link ElementNode.canIndent} returns true.
   * This option allows you to set indents for specific nodes without overriding the method for others.
   */
  $canIndent: CanIndentPredicate;
}
```

Neither copy mentions `$canIndent`.

### After

```
$ grep -n "canIndent" packages/lexical-website/docs/extensions/defining-extensions.md packages/lexical-website/docs/extensions/signals.md
packages/lexical-website/docs/extensions/defining-extensions.md:241:  $canIndent: CanIndentPredicate;
packages/lexical-website/docs/extensions/defining-extensions.md:248:    $canIndent: $defaultCanIndent,
packages/lexical-website/docs/extensions/defining-extensions.md:253:    const {disabled, maxIndent, $canIndent} = state.getOutput();
packages/lexical-website/docs/extensions/defining-extensions.md:256:        return registerTabIndentation(editor, maxIndent, $canIndent);
packages/lexical-website/docs/extensions/signals.md:82:  $canIndent: CanIndentPredicate;
packages/lexical-website/docs/extensions/signals.md:89:    $canIndent: $defaultCanIndent,
packages/lexical-website/docs/extensions/signals.md:94:    const {disabled, maxIndent, $canIndent} = state.getOutput();
packages/lexical-website/docs/extensions/signals.md:100:        return registerTabIndentation(editor, maxIndent, $canIndent);
```

Both now match `packages/lexical-extension/src/TabIndentationExtension.ts:138-169`.
The `signals.md` copy keeps its own inline comment about `peek`, which is
specific to that page.
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 23, 2026 5:48pm UTC
lexical-playground Ready Ready Preview Sep 23, 2026 5:48pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 23, 2026
@etrepum
etrepum added this pull request to the merge queue Sep 23, 2026
Merged via the queue into meta:main with commit 63d23d6 Sep 23, 2026
42 checks passed
@etrepum etrepum mentioned this pull request Sep 28, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — ac7453cc Deployed Sep 23, 2026 by vercel[bot]
Preview – lexical-playground — ac7453cc Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants