highlight

kyo.Ansi.highlight
object highlight

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
highlight.type

Members list

Value members

Concrete methods

def apply(header: String, code: String, trailer: String, startLine: Int): String

Applies syntax highlighting to a code snippet with optional header and trailer.

Applies syntax highlighting to a code snippet with optional header and trailer.

Value parameters

code

The main code snippet to be highlighted.

header

The header text to be displayed before the code (optional).

startLine

The starting line number for the code snippet (default is 1).

trailer

The trailer text to be displayed after the code (optional).

Attributes

Returns

A string with the highlighted code, including line numbers and formatting.

def apply(code: String): String

Applies syntax highlighting to a code snippet without header or trailer.

Applies syntax highlighting to a code snippet without header or trailer.

Value parameters

code

The code snippet to be highlighted.

Attributes

Returns

A string with the highlighted code, including line numbers and formatting.