Skip to main content

sphinxcontrib-tree-sitter

Use tree-sitter to highlight code blocks.

Usage

CLI

python -m sphinxcontrib.tree_sitter /the/path/of/a/file

sphinx

docs/conf.py:

extensions = [
    "sphinxcontrib.tree_sitter",
]

pyproject.toml:

# ...
[project.optional-dependencies]
dev = [
  "sphinx",
  "tree-sitter-XXX",
]
uv sync
source .venv/bin/activate
sphinx-build docs _readthedocs/html
xdg-open _readthedocs/html/index.html

markdown-it-py

from markdown_it import MarkdownIt
from sphinxcontrib.tree_sitter.mdit_py_plugin import tree_sitter_plugin

md = MarkdownIt("commonmark", {"html": True}).use(tree_sitter_plugin)
code = md.render("""
```python
def f():
    print("Hello")

""")

Download files

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

Source Distribution

sphinxcontrib_tree_sitter-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinxcontrib_tree_sitter-0.0.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib_tree_sitter-0.0.2.tar.gz.

File metadata

  • Download URL: sphinxcontrib_tree_sitter-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.11","id":"zokor","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sphinxcontrib_tree_sitter-0.0.2.tar.gz
Algorithm Hash digest
SHA256 193df7b689fe838248258134b402fc4f1a000fd0ec830d82c667a454622847f4
MD5 03c5e2a5246e14d70a021f6d30c4cf03
BLAKE2b-256 353c67571695102a70e7fd77b700e2ff7a0809bfe696478894e1127269900da1

See more details on using hashes here.

File details

Details for the file sphinxcontrib_tree_sitter-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: sphinxcontrib_tree_sitter-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.11","id":"zokor","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sphinxcontrib_tree_sitter-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e39de16c8623394390d76b9b52b75421270c03fbcab67de2468cf3dcdebd2183
MD5 f9b6c0134b81b11cad52dfcbb654a6b8
BLAKE2b-256 dba4667ea716a9b03b574a99f1f807f7f97e037fd401626f8b5385119d0c5213

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.3

2 files

This release

0.0.2 This release

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page