Service providing syntax based color highlighting of text for the CLI using highlight.js.
registerSyntax(syntaxName: string,syntaxDefinition: HighlightSyntax,): void
Register a new syntax.
The recommended way to define a new language syntax is to follow the instructions here:
- https://highlightjs.readthedocs.io/en/latest/language-contribution.html
- https://highlightjs.readthedocs.io/en/latest/building-testing.html
- https://github.com/highlightjs/highlight.js/blob/main/docs/language-guide.rst
There is a list of already defined languages available for import here:
https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md
getRegisteredSyntaxes(): ReadonlyArray<string>
Return the names of the currently registered syntaxes.
highlight(): 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.