bobzhang/pygments/styles does not have a README file
pub struct Style {
name : String
aliases : Array[String]
background_color : String?
highlight_color : String?
line_number_color : String
line_number_background_color : String
line_number_special_color : String
line_number_special_background_color : String
web_style_gallery_exclude : Bool
styles : Map[TokenType, String]
// private fields
}fn Style::new(styles : Array[(TokenType, String)], name? : String, aliases? : Array[String], background_color? : String?, highlight_color? : String?, line_number_color? : String, line_number_background_color? : String, line_number_special_color? : String, line_number_special_background_color? : String, web_style_gallery_exclude? : Bool) -> Style raise StyleErrortest {
let st = @styles.Style::new([
(@token.keyword, "bold #008000"),
(@token.keyword_type, "nobold"),
])
let kt = st.style_for_token(@token.keyword_type)
inspect(kt.color.unwrap_or("-"), content="008000")
inspect(kt.bold, content="false")
}test {
let st = @styles.get_style_by_name("monokai")
inspect(st.background_color.unwrap_or("-"), content="#272822")
try @styles.get_style_by_name("nope") catch {
ClassNotFound(msg) =>
inspect(
msg,
content="Could not find style module 'pygments.styles.nope'.",
)
} noraise {
_ => fail("expected ClassNotFound")
}
}fn is_ansicolor(name : String) -> BoolInstall
Download zipA port of Pygments (generic syntax highlighter) to MoonBit
Dependencies