class Tartrazine::Html

Defined in:

formatters/html.cr

Constructors

Instance Method Summary

Instance methods inherited from class Tartrazine::Formatter

format(text : String, lexer : Lexer) : String format, name : String name, name=(name : String) name=, style_defs : String style_defs, theme : Theme theme, theme=(theme : Theme) theme=

Constructor Detail

def self.new(theme : Theme = Tartrazine.theme("default-dark"), *, highlight_lines : Array(Range(Int32, Int32)) = [] of Range(Int32, Int32), class_prefix : String = "", line_number_id_prefix : String = "line-", line_number_start : Int32 = 1, tab_width : Int32 = 8, line_numbers : Bool = false, linkable_line_numbers : Bool = true, standalone : Bool = false, surrounding_pre : Bool = true, wrap_long_lines : Bool = false, weight_of_bold : Int32 = 600) #

[View source]

Instance Method Detail

def class_prefix : String #

property line_number_in_table : Bool = false property with_classes : Bool = true


[View source]
def class_prefix=(class_prefix : String) #

property line_number_in_table : Bool = false property with_classes : Bool = true


[View source]
def format(text : String, lexer : BaseLexer, io : IO) : Nil #

[View source]
def format(text : String, lexer : Lexer) : String #
Description copied from class Tartrazine::Formatter

Format the text using the given lexer.


[View source]
def format_text(text : String, lexer : BaseLexer, outp : IO) #

[View source]
def get_css_class(token : String) : String #

Given a token type, return the CSS class to use.


[View source]
def highlight_lines : Array(Range(Int32, Int32)) #

[View source]
def highlight_lines=(highlight_lines : Array(Range(Int32, Int32))) #

[View source]
def highlighted?(line : Int) : Bool #

Is this line in the highlighted ranges?


[View source]
def line_number_id_prefix : String #

[View source]
def line_number_id_prefix=(line_number_id_prefix : String) #

[View source]
def line_number_start : Int32 #

[View source]
def line_number_start=(line_number_start : Int32) #

[View source]
def line_numbers=(line_numbers : Bool) #

[View source]
def line_numbers? : Bool #

[View source]
def linkable_line_numbers=(linkable_line_numbers : Bool) #

[View source]
def linkable_line_numbers? : Bool #

[View source]
def standalone=(standalone : Bool) #

[View source]
def standalone? : Bool #

[View source]
def style_defs : String #

ameba:disable Metrics/CyclomaticComplexity


[View source]
def surrounding_pre=(surrounding_pre : Bool) #

[View source]
def surrounding_pre? : Bool #

[View source]
def tab_width : Int32 #

[View source]
def tab_width=(tab_width : Int32) #

[View source]
def theme : Theme #

[View source]
def theme=(theme : Theme) #

[View source]
def weight_of_bold : Int32 #

[View source]
def weight_of_bold=(weight_of_bold : Int32) #

[View source]
def wrap_long_lines=(wrap_long_lines : Bool) #

[View source]
def wrap_long_lines? : Bool #

[View source]
def wrap_standalone #

Wrap text into a full HTML document, including the CSS for the theme


[View source]