From 9b4e685ac8fbb0b53f09122235c0402d64f1c824 Mon Sep 17 00:00:00 2001 From: BearToCode Date: Sun, 28 Jul 2024 16:40:55 +0200 Subject: [PATCH] docs: add tab outs --- docs/src/pages/api/core.svelte.md | 6 ++++++ docs/src/pages/api/extension.svelte.md | 16 ++++++++++++++++ docs/src/pages/plugins/math.svelte.md | 8 ++++++++ 3 files changed, 30 insertions(+) diff --git a/docs/src/pages/api/core.svelte.md b/docs/src/pages/api/core.svelte.md index efcf3f21..36af36c6 100644 --- a/docs/src/pages/api/core.svelte.md +++ b/docs/src/pages/api/core.svelte.md @@ -54,6 +54,12 @@ Type: `DefaultPrefixId[] | true` Remove default prefixes by id. You can use `true` to disable all of them. +### `disableTabOuts` + +Type: `DefaultTabOutId[] | true` + +Remove default tab-outs by id. You can use `true` to disable all of them. + ### `historyOptions` History management options. diff --git a/docs/src/pages/api/extension.svelte.md b/docs/src/pages/api/extension.svelte.md index f39da6a5..3b628a48 100644 --- a/docs/src/pages/api/extension.svelte.md +++ b/docs/src/pages/api/extension.svelte.md @@ -196,6 +196,22 @@ const prefix: Prefix = { +## `tabOuts` + +"Tab-outs" allow users to use the `tab` key to skip certain pieces of text. For example, after using the bold shortcut and having typed the text, you can press `tab` to skip the ending `**`. + +### `TabOut.id` + +Type: `string` + +Id of the tab-out. + +### `TabOut.delimiter` + +Type: `string | readonly string[]` + +Text(s) to check for. If one of them is found after the textarea `selectionEnd`, pressing tab will place the cursor after that. + ### `listeners` Type: `Listener[]` diff --git a/docs/src/pages/plugins/math.svelte.md b/docs/src/pages/plugins/math.svelte.md index 7d4cc5cc..512a5e59 100644 --- a/docs/src/pages/plugins/math.svelte.md +++ b/docs/src/pages/plugins/math.svelte.md @@ -156,5 +156,13 @@ interface MathExtensionOptions { * Options for rehype-katex */ rehypeKatex?: RehypeKatexOptions; + /** + * Disable tab outs. + */ + disableTabOuts?: boolean; + /** + * Disable the katex icon. + */ + disableIcon?: boolean; } ```