Skip to main content

reStructuredText grammar for tree-sitter

Project description

tree-sitter-rst

CI PyPI - Version NPM Version Crates.io Version

reStructuredText grammar for tree-sitter. Based on the specification from https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html.

Check the playground at https://stsewd.dev/tree-sitter-rst/.

Note: this grammar is still under development, a lot of things may change!

TODO

  • Allow lists with blank lines between items
  • Refactor parse citation and footer reference
  • Nested line blocks
  • Option lists
  • Add some nodes to inline?
  • Check if there is a way to re-implement some nodes to JS instead of C?
  • A definition list with classifiers can't be separated by a blank line.
  • tests, tests, and more tests!

Design notes

  • Nodes that contain body elements inside (like lists or directives), are inside a node named body.
  • In RST sections are a big node that contains body elements, here they are just a node containing the title. This is to avoid guessing the level of subtitles.
  • In RST standalone hyperlinks are reference nodes, here they are standalone_hyperlink nodes. This is to avoid confusion with inline references nodes (that are a reference node).
  • Literal blocks are part of the paragraph they precede, not a separate node, except for the expanded form of literal blocks.
  • In rst directives only have "body" node, here the body is parsed as arguments/options/content.

Design decisions

Projects using this grammar

Contributing

Check the CONTRIBUTING.md file

Other grammars

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

py_tree_sitter_rst-0.2.2.tar.gz (60.5 kB view details)

Uploaded Source

Built Distributions

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

py_tree_sitter_rst-0.2.2-cp310-abi3-win_arm64.whl (31.6 kB view details)

Uploaded CPython 3.10+Windows ARM64

py_tree_sitter_rst-0.2.2-cp310-abi3-win_amd64.whl (33.6 kB view details)

Uploaded CPython 3.10+Windows x86-64

py_tree_sitter_rst-0.2.2-cp310-abi3-musllinux_1_2_x86_64.whl (84.2 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

py_tree_sitter_rst-0.2.2-cp310-abi3-musllinux_1_2_aarch64.whl (90.1 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

py_tree_sitter_rst-0.2.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (85.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

py_tree_sitter_rst-0.2.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (91.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

py_tree_sitter_rst-0.2.2-cp310-abi3-macosx_11_0_arm64.whl (32.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

py_tree_sitter_rst-0.2.2-cp310-abi3-macosx_10_9_x86_64.whl (32.6 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file py_tree_sitter_rst-0.2.2.tar.gz.

File metadata

  • Download URL: py_tree_sitter_rst-0.2.2.tar.gz
  • Upload date:
  • Size: 60.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_tree_sitter_rst-0.2.2.tar.gz
Algorithm Hash digest
SHA256 622c822e15303b3e5c5b6893c6486a44bd3ebf04aafdae5f267103c67f8a628c
MD5 6804037ea5566db4167041d8bbb36b15
BLAKE2b-256 b226a702029075ed06cfd232ece8f9216d17fd2abcdf98c37735d1a2749f335b

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 d85ed0b1369a35456024b5a454cdfae30d2eb98f064a8b00bd30fc3e19478a18
MD5 fa3a698e85bcd03552a26f8ffae3adbb
BLAKE2b-256 dd7def0a49a8df580cf884cd04f8e65d469a9b496f95e33da84c777fff80a459

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 98661a51fed1ef3b3f07f3387c72d12f68078182cf7d2ca4556feaaeab08a8e4
MD5 edf24edea1e5d53f6120f2366c31f1d7
BLAKE2b-256 ce69e5647bd8199c24d49ccfe34a8215dd94ed28ad4ad221626d55949b50c339

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2ff065f3089b438e0759f6f32ff6deaa26cd5589b0ed5786ab2cf2309f8ebe87
MD5 31f82d789e6abf297fde1ab73b0de9d5
BLAKE2b-256 950ae1b5e8c191df580efacb73d893516d1fe2d6ebf1b920018f066153128acd

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7baf94626298aef190b984618fb6ac23ff005d1f5a0e0a30029f67c6a131a6cd
MD5 28865a70c742d980a98ee2d6c73b8e68
BLAKE2b-256 4b624df5b3843c1d952e27532869eda9b12417971b3f91ac20baa7e88c7a3548

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 381974aa88f4dbef715aadc990cbef6769c5dfd26de66e8caffa762c5d25c813
MD5 85a8af2d9c4e493f3b6a1f498c963765
BLAKE2b-256 ffc1e6cd2feef69b7592a5850468ff1cc963d83c689ca82545ec1f9da4a37557

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7b03567e55c0ce83b96099a53b22ce09bb35ab6ceaeddbf4b60e3f374229e44d
MD5 676e35798af310e30b83aca5edafbaac
BLAKE2b-256 20787c9a595037fc21be0bd81cdbf8a8aa6bacd1fb151355d665d3bb482e8650

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8883f1ae5f6164431e60a25e738091483bec5ec0a599ddbcf4178767ba1a13ed
MD5 aa881fe78727916ab1191cb7d03009ad
BLAKE2b-256 c0d2479671f594cc835133223e9c396db7d28c90854e06a0f67eb24e4aaf8ad8

See more details on using hashes here.

File details

Details for the file py_tree_sitter_rst-0.2.2-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for py_tree_sitter_rst-0.2.2-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 742d84ff805a29ddc0b245c3c5a72c55f5123970282b791f79bed43b45e280e4
MD5 b60e7d67241124010f76ff1a77376c8d
BLAKE2b-256 51927fd2241d9164cefb3e26ce09368d2e5657dc5f000a88eb17b8af99c28f82

See more details on using hashes here.

Supported by

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