Metadata-Version: 2.4
Name: tree-sitter-highlight
Version: 0.0.1
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Requires-Dist: pytest-cov>=7 ; extra == 'dev'
Requires-Dist: tree-sitter-python>=0.25.0 ; extra == 'dev'
Provides-Extra: dev
Summary: python binding for tree-sitter-highlight
Author-email: "Wu, Zhenyu" <wuzhenyu@ustc.edu>
License-Expression: GPL-3.0-or-later
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: homepage, https://github.com/sphinx-contrib/tree-sitter-highlight

# Python binding

```python
import tree_sitter_bash
import tree_sitter_python
from tree_sitter_highlight import highlight, search_parsers


parsers = search_parsers(
    tree_sitter_python,
    # NOTE: same as
    # python=tree_sitter_python,
    sh = tree_sitter_bash,
)
code = highlight(
    file = "/home/user/.bashrc",
    source = nil,
    language = "sh",
    parsers = parsers,
    theme = {"variable": {"color": "#F8F8F2"}},
    format = "terminal",
    layout = "document",
    style = "classes",
    prefix = "TS",
    math_escape = ["comment", "string"],
)
```

