https://github.com/oxy2dev/tree-sitter-doctext
Tree-sitter parser for conventional comments
https://github.com/oxy2dev/tree-sitter-doctext
Last synced: 8 months ago
JSON representation
Tree-sitter parser for conventional comments
- Host: GitHub
- URL: https://github.com/oxy2dev/tree-sitter-doctext
- Owner: OXY2DEV
- License: mit
- Created: 2025-07-07T04:11:04.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T02:02:06.000Z (9 months ago)
- Last Synced: 2025-10-01T03:38:45.585Z (9 months ago)
- Language: JavaScript
- Size: 1 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tree-sitter-doctext

[Tree-sitter](https://github.com/tree-sitter/tree-sitter) parser for [conventional comments](https://conventionalcomments.org/).
>[!NOTE]
> It wasn't named `tree-sitter-comment` as that name is already taken and this parser isn't strictly for `comments`.
## 💡 Features
- Supports a subset of `markdown` such as,
+ *Italic text*
+ **Bold text**
+ `Inline_code`
+ `Code blocks`
- Supports extra syntax such as,
+ `'Single quoted text'`
+ `"Double quoted text"`
+ `@mentions`
+ `owner/repo#12`(Issue reference)
+ `https://example.com`(links)
- Supports correct tree structure for topics, subjects, description etc. to be leveraged by plugins/external programs.
- Queries(syntax & injection) for common comment topics(e.g. NOTE, WIP, FIX etc.).
## 📥 Installation
### 💡 nvim-treesitter
>[!IMPORTANT]
> If you plan on using it inside comments, you also need to add it as an injection for that language.
Put this in your `nvim-treesitter` config,
```lua
local parser_configs = require("nvim-treesitter.parsers").get_parser_configs();
parser_configs.doctext = {
install_info = {
url = "https://github.com/OXY2DEV/tree-sitter-doctext",
files = { "src/parser.c" },
branch = "main",
},
}
```
Now, quit & open Neovim and run this command,
```vim
:TSInstall doctext
```
### 💡 manual
1. Install the `tree-sitter` CLI tool.
2. Clone the repository in your machine and `cd` into it.
3. Run `tree-sitter build`(if it tells you to install dependencies then you should install them and retry).
4. Copy the `doctext.so` file to `~/.config/nvim/parser/`.
## 💥 Query files(syntax highlighting & injections)
Copy everything inside `queries/` to `~/.config/nvim/queries/doctext/` in your machine.