
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
syntaxlight 是一个用于解析代码并生成 html 字符串的 python 库, 可以用于配合 Markdown 解析器完成网页 html 中 <pre><code>
标签内的代码高亮, 您可以 在线浏览 文法高亮结果
目前支持 C/Python 等主流编程语言和 json xml 等主流标记语言的文法解析, 支持多种高亮主题以及自定义颜色(默认使用 Vscode 风格), 您可在此查看全部文法支持和高亮支持
pip install syntaxlight
syntaxlight 提供了一个简易的 API 用于预览结果: syntaxlight.example_display
import syntaxlight
syntaxlight.example_display('./1.c')
# syntaxlight.example_display('./your-code.c', style='one-dark-pro')
运行可以得到 syntaxlight_example/
文件夹, 使用浏览器打开其中的 index.html 即可预览.
关于详细的 API 使用方法, 以及对于默认配置的修改情况请参阅 syntaxlight 使用文档
本仓库的 Makefile 与 test.py 提供了对于测试用例的渲染预览, 运行后打开 syntaxlight_example/index.html 即可
# 浏览所有 C 测试用例集合渲染结果
make
# 浏览所有 json 测试用例集合渲染结果
make t=json
# 浏览 json 第一个 test/json/1.json 测试用例渲染结果
make t=json i=1
# 浏览 toml 第一个 test/toml/1.json 测试用例在 one-dark-pro 风格下的渲染结果
make t=toml i=1 s=one-dark-pro
FAQs
syntax highlight based on EBNF
We found that syntaxlight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.