{"id":28499839,"url":"https://github.com/nvim-orgmode/tree-sitter-org","last_synced_at":"2025-07-20T05:33:18.884Z","repository":{"id":217485144,"uuid":"743980429","full_name":"nvim-orgmode/tree-sitter-org","owner":"nvim-orgmode","description":"Org grammar for tree-sitter","archived":false,"fork":false,"pushed_at":"2025-05-12T07:54:13.000Z","size":3867,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T04:37:51.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scilab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"milisims/tree-sitter-org","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvim-orgmode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-16T11:48:16.000Z","updated_at":"2025-03-01T06:28:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2a6b4ca-013a-4388-aa01-a6092f878616","html_url":"https://github.com/nvim-orgmode/tree-sitter-org","commit_stats":null,"previous_names":["nvim-orgmode/tree-sitter-org"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/nvim-orgmode/tree-sitter-org","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-orgmode%2Ftree-sitter-org","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-orgmode%2Ftree-sitter-org/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-orgmode%2Ftree-sitter-org/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-orgmode%2Ftree-sitter-org/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-orgmode","download_url":"https://codeload.github.com/nvim-orgmode/tree-sitter-org/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-orgmode%2Ftree-sitter-org/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266071519,"owners_count":23871940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T15:05:01.442Z","updated_at":"2025-07-20T05:33:18.857Z","avatar_url":"https://github.com/nvim-orgmode.png","language":"Scilab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tree-sitter-org\n\n## NOTE: All PRs should be submitted to [next](https://github.com/nvim-orgmode/tree-sitter-org/tree/next) branch\n\nThis is the fork of [https://github.com/milisims/tree-sitter-org](https://github.com/milisims/tree-sitter-org).\nOriginal maintainer stopped contribution so this is a continuation.\n\nOrg grammar for tree-sitter. Here, the goal is to implement a grammar that can\nusefully parse org files to be used in any library that uses tree-sitter\nparsers. It is not meant to implement emacs' orgmode parser exactly, which is\ninherently more dynamic than tree-sitter easily allows.\n\n## Overview\n\nThis section is meant to be a quick reference, not a thorough description.\nRefer to the tests in `corpus` for examples.\n\n- Top level node: `(document)`\n- Document contains: `(directive)* (body)? (section)*`\n- Section contains: `(headline) (plan)? (property_drawer)? (body)?`\n- headline contains: `((stars), (item)?, (tag_list)?)`\n- body contains: `(element)+`\n- element contains: `(directive)* choose(paragraph, drawer, comment, footnote def, list, block, dynamic block, table)` or a bare `(directive)`\n- paragraph contains: `(expr)+`\n- expr contains: anonymous nodes for 'str', 'num', 'sym', and any ascii symbol that is not letters or numbers. (See top of grammar.js and queries for details)\n\nLike in many regex systems, `*/+` is read as \"0/1 or more\", and `?` is 0 or 1.\n\n## Example\n\n```org\n#+TITLE: Example\n\nSome *marked up* words\n\n* TODO Title\n\u003c2020-06-07 Sun\u003e\n\n  - list a\n  - [-] list a\n    - [ ] list b\n    - [x] list b\n  - list a\n\n** Subsection :tag:\n\nText\n```\n\nParses as:\n\n```\n(document [0, 0] - [16, 0]\n  body: (body [0, 0] - [4, 0]\n    directive: (directive [0, 0] - [1, 0]\n      name: (expr [0, 2] - [0, 7])\n      value: (value [0, 9] - [0, 16]\n        (expr [0, 9] - [0, 16])))\n    (paragraph [2, 0] - [3, 0]\n      (expr [2, 0] - [2, 4])\n      (expr [2, 5] - [2, 12])\n      (expr [2, 13] - [2, 16])\n      (expr [2, 17] - [2, 22])))\n  subsection: (section [4, 0] - [16, 0]\n    headline: (headline [4, 0] - [5, 0]\n      stars: (stars [4, 0] - [4, 1])\n      item: (item [4, 2] - [4, 12]\n        (expr [4, 2] - [4, 6])\n        (expr [4, 7] - [4, 12])))\n    plan: (plan [5, 0] - [6, 0]\n      (entry [5, 0] - [5, 16]\n        timestamp: (timestamp [5, 0] - [5, 16]\n          date: (date [5, 1] - [5, 11])\n          day: (day [5, 12] - [5, 15]))))\n    body: (body [6, 0] - [13, 0]\n      (list [7, 0] - [12, 0]\n        (listitem [7, 2] - [8, 0]\n          bullet: (bullet [7, 2] - [7, 3])\n          contents: (paragraph [7, 4] - [8, 0]\n            (expr [7, 4] - [7, 8])\n            (expr [7, 9] - [7, 10])))\n        (listitem [8, 2] - [11, 0]\n          bullet: (bullet [8, 2] - [8, 3])\n          checkbox: (checkbox [8, 4] - [8, 7]\n            status: (expr [8, 5] - [8, 6]))\n          contents: (paragraph [8, 8] - [9, 0]\n            (expr [8, 8] - [8, 12])\n            (expr [8, 13] - [8, 14]))\n          contents: (list [9, 0] - [11, 0]\n            (listitem [9, 4] - [10, 0]\n              bullet: (bullet [9, 4] - [9, 5])\n              checkbox: (checkbox [9, 6] - [9, 9])\n              contents: (paragraph [9, 10] - [10, 0]\n                (expr [9, 10] - [9, 14])\n                (expr [9, 15] - [9, 16])))\n            (listitem [10, 4] - [11, 0]\n              bullet: (bullet [10, 4] - [10, 5])\n              checkbox: (checkbox [10, 6] - [10, 9]\n                status: (expr [10, 7] - [10, 8]))\n              contents: (paragraph [10, 10] - [11, 0]\n                (expr [10, 10] - [10, 14])\n                (expr [10, 15] - [10, 16])))))\n        (listitem [11, 2] - [12, 0]\n          bullet: (bullet [11, 2] - [11, 3])\n          contents: (paragraph [11, 4] - [12, 0]\n            (expr [11, 4] - [11, 8])\n            (expr [11, 9] - [11, 10])))))\n    subsection: (section [13, 0] - [16, 0]\n      headline: (headline [13, 0] - [14, 0]\n        stars: (stars [13, 0] - [13, 2])\n        item: (item [13, 3] - [13, 13]\n          (expr [13, 3] - [13, 13]))\n        tags: (tag_list [13, 14] - [13, 19]\n          tag: (tag [13, 15] - [13, 18])))\n      body: (body [14, 0] - [16, 0]\n        (paragraph [15, 0] - [16, 0]\n          (expr [15, 0] - [15, 4]))))))\n```\n\n## Install\n\nFor manual install, use `make`.\n\nFor neovim, using `nvim-treesitter/nvim-treesitter`, add to your configuration:\n\n```lua\nlocal parser_config = require \"nvim-treesitter.parsers\".get_parser_configs()\nparser_config.org = {\n  install_info = {\n    url = 'https://github.com/milisims/tree-sitter-org',\n    revision = 'main',\n    files = { 'src/parser.c', 'src/scanner.c' },\n  },\n  filetype = 'org',\n}\n```\n\nTo build the parser using npm and run tests:\n\n1. Install node.js as described in the [tree-sitter documentation](https://tree-sitter.github.io/tree-sitter/creating-parsers#dependencies)\n2. Clone this repository: `git clone https://github.com/milisims/tree-sitter-org` and `cd` into it\n3. Install tree-sitter using npm: `npm install`\n4. Run tests: `./node_modules/.bin/tree-sitter generate \u0026\u0026 ./node_modules/.bin/tree-sitter test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-orgmode%2Ftree-sitter-org","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-orgmode%2Ftree-sitter-org","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-orgmode%2Ftree-sitter-org/lists"}