Skip to content

Commit a0cf0a7

Browse files
authored
Merge pull request tree-sitter#2585 from mgunyho/include-readme-in-lib-docs
doc: Include README in top-level Rust module documentation
2 parents 9de9396 + f9117a0 commit a0cf0a7

File tree

13 files changed

+109
-90
lines changed

13 files changed

+109
-90
lines changed

cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ rust-version.workspace = true
1414
[[bin]]
1515
name = "tree-sitter"
1616
path = "src/main.rs"
17+
doc = false
1718

1819
[[bench]]
1920
name = "benchmark"

cli/config/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# `tree-sitter-config`
1+
# Tree-sitter Config
2+
3+
Manages Tree-sitter's configuration file.
24

35
You can use a configuration file to control the behavior of the `tree-sitter`
4-
command-line program. This crate implements the logic for finding and the
6+
command-line program. This crate implements the logic for finding and the
57
parsing the contents of the configuration file.

cli/config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Manages tree-sitter's configuration file.
1+
#![doc = include_str!("../README.md")]
22

33
use anyhow::{anyhow, Context, Result};
44
use serde::{Deserialize, Serialize};

cli/loader/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# `tree-sitter-loader`
1+
# Tree-sitter Loader
22

33
The `tree-sitter` command-line program will dynamically find and build grammars
44
at runtime, if you have cloned the grammars' repositories to your local
5-
filesystem. This helper crate implements that logic, so that you can use it in
5+
filesystem. This helper crate implements that logic, so that you can use it in
66
your own program analysis tools, as well.

cli/loader/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![doc = include_str!("../README.md")]
2+
13
use anyhow::{anyhow, Context, Error, Result};
24
use libloading::{Library, Symbol};
35
use once_cell::unsync::OnceCell;

cli/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![doc = include_str!("../README.md")]
2+
13
pub mod generate;
24
pub mod highlight;
35
pub mod logger;

highlight/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `tree-sitter-highlight`
1+
# Tree-sitter Highlight
22

33
[![crates.io badge]][crates.io]
44

highlight/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![doc = include_str!("../README.md")]
2+
13
pub mod c_lib;
24
pub mod util;
35
pub use c_lib as c;

lib/binding_rust/bindings.rs

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

lib/binding_rust/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![doc = include_str!("./README.md")]
2+
13
pub mod ffi;
24
mod util;
35

0 commit comments

Comments
 (0)