method SyntaxHighlighterService.highlight
SyntaxHighlighterService.highlight(
text: string,
syntaxName: string,
colorScheme?: ColorScheme,
): string

Return a syntactically highlighted version of the provided text using the specified syntax. The returned text will include appropriate color styling. An optional ColorScheme can be provided.

Parameters

text: string

the text to highlight.

syntaxName: string

the syntax to use.

optional
colorScheme: ColorScheme

the color scheme to use.

Return Type

string

Usage

import type SyntaxHighlighterService from ".";