Skip to main content

Module highlight

Module highlight 

Source

Functions§

classify_word
根据语言规则判断一个 word 应该使用哪种颜色样式
colorize_tokens
将文本按照 word boundary 拆分并对关键字、数字、类型名、原始类型着色
highlight_code_line
简单的代码语法高亮(无需外部依赖) 根据语言类型对常见关键字、字符串、注释、数字进行着色