Skip to content

Commit c25b635

Browse files
chore: update versions & docs
1 parent a3481e1 commit c25b635

File tree

10 files changed

+52
-51
lines changed

10 files changed

+52
-51
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uses: tree-sitter/parser-test-action@v2
4343
with:
4444
test-rust: true
45+
test-parser-cmd: npm test
4546
- name: Rebuild with default extensions
4647
run: npm run build
4748
- name: Verify grammar consistency

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tree-sitter-md"
33
description = "Markdown grammar for tree-sitter"
4-
version = "0.3.0"
4+
version = "0.3.1"
55
license = "MIT"
66
readme = "README.md"
77
keywords = ["incremental", "parsing", "tree-sitter", "markdown"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
66
[![npm][npm]](https://www.npmjs.com/package/@tree-sitter-grammars/tree-sitter-markdown)
77
[![crates][crates]](https://crates.io/crates/tree-sitter-md)
8+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-markdown/)
89

910
A Markdown parser for [tree-sitter].
1011

@@ -78,3 +79,4 @@ Unfortunately using this parser with WASM/web-tree-sitter does not work out of t
7879
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
7980
[npm]: https://img.shields.io/npm/v/%40tree-sitter-grammars%2Ftree-sitter-markdown?logo=npm
8081
[crates]: https://img.shields.io/crates/v/tree-sitter-md?logo=rust
82+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-markdown?logo=pypi&logoColor=ffd242

bindings/rust/lib.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This crate provides Markdown language support for the [tree-sitter][] parsing library.
22
//!
3-
//! It contains two grammars: [`language`] to parse the block structure of markdown documents and
4-
//! [`inline_language`] to parse inline content.
3+
//! It contains two grammars: [`LANGUAGE`] to parse the block structure of markdown documents and
4+
//! [`INLINE_LANGUAGE`] to parse inline content.
55
//!
66
//! It also supplies [`MarkdownParser`] as a convenience wrapper around the two grammars.
77
//! [`MarkdownParser::parse`] returns a [`MarkdownTree`] instread of a [`Tree`][Tree]. This struct
@@ -26,12 +26,19 @@ pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_markd
2626
pub const INLINE_LANGUAGE: LanguageFn =
2727
unsafe { LanguageFn::from_raw(tree_sitter_markdown_inline) };
2828

29+
/// The syntax highlighting queries for the block grammar.
2930
pub const HIGHLIGHT_QUERY_BLOCK: &str =
3031
include_str!("../../tree-sitter-markdown/queries/highlights.scm");
32+
33+
/// The language injection queries for the block grammar.
3134
pub const INJECTION_QUERY_BLOCK: &str =
3235
include_str!("../../tree-sitter-markdown/queries/injections.scm");
36+
37+
/// The syntax highlighting queries for the inline grammar.
3338
pub const HIGHLIGHT_QUERY_INLINE: &str =
3439
include_str!("../../tree-sitter-markdown-inline/queries/highlights.scm");
40+
41+
/// The language injection queries for the inline grammar.
3542
pub const INJECTION_QUERY_INLINE: &str =
3643
include_str!("../../tree-sitter-markdown-inline/queries/injections.scm");
3744

@@ -47,24 +54,30 @@ pub const NODE_TYPES_INLINE: &str =
4754
include_str!("../../tree-sitter-markdown-inline/src/node-types.json");
4855

4956
#[cfg(feature = "parser")]
57+
#[cfg_attr(docsrs, doc(cfg(feature = "parser")))]
5058
mod parser;
5159

5260
#[cfg(feature = "parser")]
61+
#[cfg_attr(docsrs, doc(cfg(feature = "parser")))]
5362
pub use parser::*;
5463

5564
#[cfg(test)]
5665
mod tests {
5766
use super::*;
5867

5968
#[test]
60-
fn can_load_grammar() {
69+
fn can_load_block_grammar() {
6170
let mut parser = tree_sitter::Parser::new();
6271
parser
6372
.set_language(&LANGUAGE.into())
64-
.expect("Error loading Markdown language");
65-
let mut inline_parser = tree_sitter::Parser::new();
66-
inline_parser
73+
.expect("Error loading Markdown block grammar");
74+
}
75+
76+
#[test]
77+
fn can_load_inline_grammar() {
78+
let mut parser = tree_sitter::Parser::new();
79+
parser
6780
.set_language(&INLINE_LANGUAGE.into())
68-
.expect("Error loading Markdown language");
81+
.expect("Error loading Markdown inline grammar");
6982
}
7083
}

bindings/rust/parser.rs

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/common.mak

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 15 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tree-sitter-grammars/tree-sitter-markdown",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Markdown grammar for tree-sitter",
55
"repository": "github:tree-sitter-grammars/tree-sitter-markdown",
66
"author": "MDeiml (https://github.com/MDeiml)",
@@ -24,11 +24,11 @@
2424
"common/html_entities.json"
2525
],
2626
"dependencies": {
27-
"node-addon-api": "^8.0.0",
28-
"node-gyp-build": "^4.8.0"
27+
"node-addon-api": "^8.1.0",
28+
"node-gyp-build": "^4.8.1"
2929
},
3030
"devDependencies": {
31-
"prebuildify": "^6.0.0",
31+
"prebuildify": "^6.0.1",
3232
"tree-sitter-cli": "^0.23.0"
3333
},
3434
"peerDependencies": {

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "tree-sitter-markdown"
77
description = "Markdown grammar for tree-sitter"
8-
version = "0.3.0"
8+
version = "0.3.1"
99
keywords = ["incremental", "parsing", "tree-sitter", "markdown"]
1010
classifiers = [
1111
"Intended Audience :: Developers",
@@ -17,7 +17,7 @@ classifiers = [
1717
authors = [
1818
{name = "MDeiml"}
1919
]
20-
requires-python = ">=3.8"
20+
requires-python = ">=3.9"
2121
license.text = "MIT"
2222
readme = "README.md"
2323

@@ -28,5 +28,5 @@ Homepage = "https://github.com/tree-sitter-grammars/tree-sitter-markdown"
2828
core = ["tree-sitter~=0.23"]
2929

3030
[tool.cibuildwheel]
31-
build = "cp38-*"
31+
build = "cp39-*"
3232
build-frontend = "build"

setup.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)