Skip to main content

reStructuredText grammar for tree-sitter

Project description

tree-sitter-rst

CI

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

tree_sitter_rst-0.2.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distributions

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

tree_sitter_rst-0.2.0-cp310-abi3-win_arm64.whl (27.7 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_rst-0.2.0-cp310-abi3-win_amd64.whl (29.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_rst-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl (75.9 kB view details)

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

tree_sitter_rst-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.8 kB view details)

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

tree_sitter_rst-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (81.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

tree_sitter_rst-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (26.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_rst-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl (26.4 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_rst-0.2.0.tar.gz.

File metadata

  • Download URL: tree_sitter_rst-0.2.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tree_sitter_rst-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b3e23a2f83bd6c3d43f1fcc70a381833c240dcbe84f24176041673b3b303cc4
MD5 97304bc552b64ff1dc73dcbdd08c0744
BLAKE2b-256 a8daff6b9c81594e2bb3a056fedfb980ce1c9cd9aea56c5e8851b237701fcc99

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 04987c0cf7cede274d5bdbe781d33d8528341c6a3709222ff56c028f56c17e1f
MD5 dc4111c7b551c2cebcb3d3f04d56723f
BLAKE2b-256 d07e64ca49abec7fe38b2e1bf6a62c2cddcd013603c289e06ab624a08e459f4b

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7168aade70a855f6eb0bb2d7103bf7c5fc1674e307c03327380d6bc854fdf355
MD5 4fcb09e42ab8543adb5ed69afeaba46c
BLAKE2b-256 a1059da00c1bd8c8e69af62be549b77a52ae40677eaf84d7ccc7f20b7eafd65d

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 34d3c5b59d3983f43ad3940fee295d534de550a768b74063c8f86210d1b4b4e1
MD5 bca5b932b81ff1999fee327d371cb7c0
BLAKE2b-256 2ae0275feb91b76c1d90ba63c7f92dc43d9df764345b64e1d483852c699602aa

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2431765300b8debfb5b46d903140fcb81a6088de6aba4794f69002e547ae8d2e
MD5 de211757b2131ea255241ed216c2f19c
BLAKE2b-256 978daf3ba0080d96705a7740367701e55a1b1caed6da4efff6891a9fafaf04a1

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8fe565cd00e829d053b227d87ba673328ac4f1fb46699c3808b7cf89b3d4801e
MD5 ce742a8429dc10985e793aeb7bdc1f01
BLAKE2b-256 44bd731d2358b7335126113ac8848625d8cc63dbaf35708b127f548d298b59c2

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 23f3a947909b71ba0f12967ca13f6d2593c84ac935d8566afd209ad4debed62d
MD5 cfa56127b2fcb41ec4991cb0f8591cfc
BLAKE2b-256 2051bfadd363c50186e6af4c8a9b9663b5f2e6aa2b17af03fa3341a1ea440526

See more details on using hashes here.

File details

Details for the file tree_sitter_rst-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_rst-0.2.0-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d2b8c3bdcc2d931b24c6b88c296cc47625a8f3f4fd2843e7b0eae894e9fd2ce9
MD5 9e771ce5b618bd0e038ce5ec18736949
BLAKE2b-256 9169d3cf891e9d924e8a4ab3143eb992f01382d45bb06afca3ffa0078e66d2f6

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