highlight.ts

Source

4 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

Reference

fngetHighlighter(theme: string | ThemeRegistration, customLangs: LanguageRegistration[] = []): Promise<Highlighter>Get or create the Shiki highlighter.

Get or create the Shiki highlighter.

View source

Parameters

  • theme string | ThemeRegistration
  • param unknown

Returns

Promise
fngetTextContent(node: Element | Root): stringExtract text content from a hast node.

Extract text content from a hast node.

View source

Parameters

  • node Element | Root

Returns

string
fnhighlightCode(html: string, theme: string | ThemeRegistration = "github-dark", langs: LanguageRegistration[] = []): Promise<string>Apply syntax highlighting to HTML using Shiki.

Apply syntax highlighting to HTML using Shiki.

View source

Parameters

  • html string
  • param unknown
  • param unknown

Returns

Promise
fnrehypeShikiHighlight(options: { theme: string | ThemeRegistration; langs?: LanguageRegistration[]; })Rehype plugin for syntax highlighting with Shiki.

Rehype plugin for syntax highlighting with Shiki.

View source

Parameters

  • options { ... }