Skip to content

Commit

Permalink
docs(lib): extract feature documentation from Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Oct 28, 2023
1 parent 32b1fe1 commit 1f8098c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions git-cliff-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ rust-version = "1.70.0"

[features]
default = ["repo"]
## Enable parsing commits from a git repository.
## You can turn this off if you already have the commits to put in the
## changelog and you don't need `git-cliff` to parse them.
repo = ["dep:git2", "dep:glob", "dep:indexmap"]

[dependencies]
Expand All @@ -28,6 +31,7 @@ toml = "0.8.6"
lazy-regex = "3.0.2"
next_version = "0.2.9"
semver = "1.0.20"
document-features = { version = "0.2.7", optional = true }

[dependencies.git2]
version = "0.18.1"
Expand All @@ -49,3 +53,7 @@ features = ["debug-embed"]

[dev-dependencies]
pretty_assertions = "1.4.0"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
11 changes: 5 additions & 6 deletions git-cliff-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
//! A highly customizable changelog generator ⛰️
//!
//! ## Features
//! The crate provides a set of optional features that can be enabled in your
//! `Cargo.toml` file.
//!
//! The [cargo features](https://doc.rust-lang.org/cargo/reference/features.html)
//! of the library are:
//! - `repo`: Enable parsing commits from a git repository. Enabled by default.
//! You can turn this off if you already have the commits to put in the
//! changelog and you don't need `git-cliff` to parse them.
//! ## Features
#![cfg_attr(feature = "document-features", doc = document_features::document_features!())]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(missing_docs, clippy::unwrap_used)]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff.png",
Expand Down

0 comments on commit 1f8098c

Please sign in to comment.