Skip to main content

syntax highlight based on EBNF

Project description

syntaxlight

本项目仍在开发中, 尚不可用...

syntaxlight 是一个基于 BNF 的语法高亮的 python 库, 您可以 在线浏览 文法高亮结果

目前支持 C/Python 等主流编程语言和 json xml 等主流标记语言的文法解析, 支持多种高亮主题以及自定义颜色(默认使用 Vscode 风格), 您可在此查看全部文法支持和高亮支持

安装

pip install syntaxlight

快速开始

syntaxlight 提供了一个简易的 API 用于预览结果: syntaxlight.example_display

import syntaxlight

syntaxlight.example_display('./test/c/2.c')

# syntaxlight.example_display('./your-code.c', style='one-dark-pro')

运行可以得到 syntaxlight_example/ 文件夹, 使用浏览器打开其中的 index.html 即可预览

文档和 API

关于详细的 API 使用方法, 以及对于默认配置的修改情况请参阅 syntaxlight 使用文档

参考

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syntaxlight-0.0.2.tar.gz (45.4 kB view hashes)

Uploaded Source

Built Distribution

syntaxlight-0.0.2-py3-none-any.whl (56.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page