Skip to content

Commit

Permalink
docs(rust): properly document optional feature part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Sep 11, 2024
1 parent 1c8dea7 commit 2857e22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ debug = true

[package.metadata.docs.rs]
features = ["parser"]
rustdoc-args = ["--cfg", "docsrs"]
4 changes: 4 additions & 0 deletions bindings/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
//! [Tree]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Tree.html
//! [tree-sitter]: https://tree-sitter.github.io/

#![cfg_attr(docsrs, feature(doc_cfg))]

use tree_sitter_language::LanguageFn;

extern "C" {
Expand Down Expand Up @@ -54,9 +56,11 @@ pub const NODE_TYPES_INLINE: &str =
include_str!("../../tree-sitter-markdown-inline/src/node-types.json");

#[cfg(feature = "parser")]
#[cfg_attr(docsrs, doc(cfg(feature = "parser")))]
mod parser;

#[cfg(feature = "parser")]
#[cfg_attr(docsrs, doc(cfg(feature = "parser")))]
pub use parser::*;

#[cfg(test)]
Expand Down

0 comments on commit 2857e22

Please sign in to comment.