Function render

  • Render code that was previously processed by calling process.

    Parameters

    • highlights: Highlights

      The processed highlight information to render.

    • theme: "abscs::abscs" | "aurora::aurora" | "blue_moon::blue_moon" | "boo::boo" | "catppuccin::frappe" | "catppuccin::latte" | "catppuccin::macchiato" | "catppuccin::mocha" | "darcula::darcula" | "dracula::dracula" | "everblush::everblush" | "everforest::dark" | "everforest::light" | "falcon::falcon" | "github::dark" | "github::dark_colorblind" | "github::dark_default" | "github::dark_dimmed" | "github::dark_high_contrast" | "github::dark_tritanopia" | "github::light" | "github::light_colorblind" | "github::light_default" | "github::light_high_contrast" | "github::light_tritanopia" | "gruvbox::dark" | "gruvbox::light" | "melange::melange" | "minimal::minimal" | "monochrome::monochrome" | "monokai::monokai" | "monokai::pro" | "monokai::ristretto" | "monokai::soda" | "moonfly::moonfly" | "moonlight::moonlight" | "neon::dark" | "neon::default" | "neon::doom" | "neon::light" | "nightfly::nightfly" | "nord::nord" | "oceanicnext::dark" | "oceanicnext::light" | "omni::omni" | "one::cool" | "one::dark" | "one::darker" | "one::deep" | "one::light" | "one::warm" | "one::warmer" | "oxocarbon::dark" | "oxocarbon::light" | "solarized::dark" | "solarized::light" | "tokyo::day" | "tokyo::moon" | "tokyo::night" | "tokyo::storm" | "vscode::dark" | "vscode::light" | "zephyr::zephyr" | Theme

      The name of the theme to use.

      All themes from the default collection are supported. The theme name is equivalent to its Rust path specifier, so for example the gruvbox dark theme is named gruvbox::dark. Alternatively, a custom theme can be specified.

    • renderer: string = 'HTML'

      The renderer to use.

      The renderer name is either HTML or Terminal in any casing. To specify a background color for the terminal renderer, append a hex color literal like terminal#282828 or Terminal#fff.

      By default, the HTML renderer will be used.

    Returns string

    The highlighted code in the requested format.

Generated using TypeDoc