From 08629215371fa434db92e0b1f6fadd34544bba9a Mon Sep 17 00:00:00 2001 From: Andrew Hlynskyi Date: Mon, 28 Aug 2023 21:16:02 +0300 Subject: [PATCH] doc: Include README as top-level module documentation for all crates --- cli/config/README.md | 6 ++++-- cli/config/src/lib.rs | 2 +- cli/loader/README.md | 4 ++-- cli/loader/src/lib.rs | 2 ++ cli/src/lib.rs | 2 ++ highlight/README.md | 2 +- highlight/src/lib.rs | 2 ++ tags/README.md | 2 +- tags/src/lib.rs | 2 ++ 9 files changed, 17 insertions(+), 7 deletions(-) diff --git a/cli/config/README.md b/cli/config/README.md index 8cbfbcf4..e7d7b39b 100644 --- a/cli/config/README.md +++ b/cli/config/README.md @@ -1,5 +1,7 @@ -# `tree-sitter-config` +# Tree-sitter Config + +Manages Tree-sitter's configuration file. You can use a configuration file to control the behavior of the `tree-sitter` -command-line program. This crate implements the logic for finding and the +command-line program. This crate implements the logic for finding and the parsing the contents of the configuration file. diff --git a/cli/config/src/lib.rs b/cli/config/src/lib.rs index 3cd09b8d..83b85358 100644 --- a/cli/config/src/lib.rs +++ b/cli/config/src/lib.rs @@ -1,4 +1,4 @@ -//! Manages tree-sitter's configuration file. +#![doc = include_str!("../README.md")] use anyhow::{anyhow, Context, Result}; use serde::{Deserialize, Serialize}; diff --git a/cli/loader/README.md b/cli/loader/README.md index 9889ec71..a3c18674 100644 --- a/cli/loader/README.md +++ b/cli/loader/README.md @@ -1,6 +1,6 @@ -# `tree-sitter-loader` +# Tree-sitter Loader The `tree-sitter` command-line program will dynamically find and build grammars at runtime, if you have cloned the grammars' repositories to your local -filesystem. This helper crate implements that logic, so that you can use it in +filesystem. This helper crate implements that logic, so that you can use it in your own program analysis tools, as well. diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs index 2b3896ef..3022b6b9 100644 --- a/cli/loader/src/lib.rs +++ b/cli/loader/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + use anyhow::{anyhow, Context, Error, Result}; use libloading::{Library, Symbol}; use once_cell::unsync::OnceCell; diff --git a/cli/src/lib.rs b/cli/src/lib.rs index d52b516a..549db773 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + pub mod generate; pub mod highlight; pub mod logger; diff --git a/highlight/README.md b/highlight/README.md index 95b229eb..459790ef 100644 --- a/highlight/README.md +++ b/highlight/README.md @@ -1,4 +1,4 @@ -# `tree-sitter-highlight` +# Tree-sitter Highlight [![crates.io badge]][crates.io] diff --git a/highlight/src/lib.rs b/highlight/src/lib.rs index fad91ad9..2903c7c5 100644 --- a/highlight/src/lib.rs +++ b/highlight/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + pub mod c_lib; pub mod util; pub use c_lib as c; diff --git a/tags/README.md b/tags/README.md index f5b85cb2..d7daac79 100644 --- a/tags/README.md +++ b/tags/README.md @@ -1,4 +1,4 @@ -# `tree-sitter-tags` +# Tree-sitter Tags [![crates.io badge]][crates.io] diff --git a/tags/src/lib.rs b/tags/src/lib.rs index 13499d86..0cf1bf96 100644 --- a/tags/src/lib.rs +++ b/tags/src/lib.rs @@ -1,3 +1,5 @@ +#![doc = include_str!("../README.md")] + pub mod c_lib; use memchr::memchr;