module

Obelisk::Quick

Quick and convenient methods for common syntax highlighting tasks

Class methods

css(style_name : String = "github", class_prefix : String = "") : String

Generate CSS for a style (when using HTML formatter with classes)

Source
detect_language(source : String) : String | Nil

Detect language from content

Source
formatters

Get list of available formatters

Source
highlight(source : String, language : String, formatter_name : String = "html", style_name : String = "github", options : HighlightOptions = HighlightOptions.new) : String

Highlight source code with specified language, formatter, and style

Source
highlight(source : String, io : IO, language : String, formatter_name : String = "html", style_name : String = "github", options : HighlightOptions = HighlightOptions.new) : Nil

Highlight to IO

Source
highlight_file(filename : String, formatter_name : String = "html", style_name : String = "github", options : HighlightOptions = HighlightOptions.new) : String

Highlight file by auto-detecting language from filename

Source
languages

Get list of available languages

Source
styles

Get list of available styles

Source

Nested types