@lexical/code-shiki
Interfaces
CodeShikiConfig
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:927
Properties
disabled
disabled:
boolean
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:934
When true, the Shiki code highlighter is not registered on the editor. This signal can be flipped at runtime to enable or disable the highlighter, for example to switch between the Prism and Shiki highlighters without rebuilding the editor.
tokenizer
tokenizer:
Tokenizer
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:935
Tokenizer
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:77
Properties
$tokenize
$tokenize: (
this,codeNode,language?) =>LexicalNode[]
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:80
Parameters
this
codeNode
language?
string
Returns
defaultLanguage
defaultLanguage:
string
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:78
defaultTheme
defaultTheme:
string
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:79
Type Aliases
CodeHighlighterShikiConfig
CodeHighlighterShikiConfig =
Tokenizer
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:968
Deprecated
Use CodeShikiExtension instead. This type is a flat alias for Tokenizer kept for backward compatibility with CodeHighlighterShikiExtension.
Variables
CodeHighlighterShikiExtension
constCodeHighlighterShikiExtension:LexicalExtension<Tokenizer,"@lexical/code-shiki/legacy",unknown,void>
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:981
Deprecated
Use CodeShikiExtension instead.
This is a thin backward-compatibility shim that preserves the original
flat Tokenizer config API. It depends on
CodeShikiExtension and routes its configured tokenizer to the
underlying extension during init (before CodeShikiExtension builds),
so consumers using
configExtension(CodeHighlighterShikiExtension, customTokenizer)
continue to work without modification.
CodeShikiExtension
constCodeShikiExtension:LexicalExtension<CodeShikiConfig,"@lexical/code-shiki",NamedSignalsOutput<CodeShikiConfig>,unknown>
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:944
Add code highlighting support for code blocks with Shiki.
CodeExtension is a dependency, so the required CodeNode and
CodeHighlightNode nodes are registered automatically.
ShikiTokenizer
constShikiTokenizer:Tokenizer
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:89
Functions
getCodeLanguageOptions()
getCodeLanguageOptions(): [
string,string][]
Defined in: packages/lexical-code-shiki/src/FacadeShiki.ts:119
Returns
[string, string][]
getCodeThemeOptions()
getCodeThemeOptions(): [
string,string][]
Defined in: packages/lexical-code-shiki/src/FacadeShiki.ts:122
Returns
[string, string][]
isCodeLanguageLoaded()
isCodeLanguageLoaded(
language):boolean
Defined in: packages/lexical-code-shiki/src/FacadeShiki.ts:38
Parameters
language
string
Returns
boolean
loadCodeLanguage()
loadCodeLanguage(
language,editor?,codeNodeKey?):Promise<void> |undefined
Defined in: packages/lexical-code-shiki/src/FacadeShiki.ts:51
Parameters
language
string
editor?
codeNodeKey?
string
Returns
Promise<void> | undefined
loadCodeTheme()
loadCodeTheme(
theme,editor?,codeNodeKey?):Promise<void> |undefined
Defined in: packages/lexical-code-shiki/src/FacadeShiki.ts:97
Parameters
theme
string
editor?
codeNodeKey?
string
Returns
Promise<void> | undefined
normalizeCodeLanguage()
normalizeCodeLanguage(
language):string
Defined in: packages/lexical-code-shiki/src/FacadeShiki.ts:126
Parameters
language
string
Returns
string
registerCodeHighlighting()
registerCodeHighlighting(
editor,tokenizer?): () =>void
Defined in: packages/lexical-code-shiki/src/CodeHighlighterShiki.ts:769
Parameters
editor
tokenizer?
Returns
() => void