@flowscripter/dynamic-cli-framework
    Preparing search index...

    Interface SyntaxHighlighterService

    Service providing syntax based color highlighting of text for the CLI using highlight.js.

    interface SyntaxHighlighterService {
        getRegisteredSyntaxes(): readonly string[];
        highlight(
            text: string,
            syntaxName: string,
            colorScheme?: ColorScheme,
        ): string;
        registerSyntax(syntaxName: string, syntaxDefinition: LanguageFn): void;
    }

    Implemented by

    Index
    • Return the names of the currently registered syntaxes.

      Returns readonly 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.

      • OptionalcolorScheme: ColorScheme

        the color scheme to use.

      Returns string