Skip to content

Commit

Permalink
docs(derive): Ensure magic attributes are searchable
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 23, 2023
1 parent c94ae5f commit 2dd5a67
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clap_derive/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ See the [clap-wide CONTRIBUTING.md](../CONTRIBUTING.md). This will contain `cla
- Prefer substituting variable names to avoid problems with `macro_rules`, see [#2823](https://github.com/clap-rs/clap/pull/2823).
- Prefer `::std::result::Result` and `::std::option::Option`, see [#3092](https://github.com/clap-rs/clap/pull/3092).
- Put whitespace between `#quoted #variables`.
- New "magic" attributes must be documented in the [derive reference](../src/_derive.rs)
- If there is no related builder method, a `#![doc(alias = "")]` should also be added
14 changes: 14 additions & 0 deletions src/_derive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,20 @@
//! ([example][_tutorial#testing])
//! - Always remember to [document](#doc-comments) args and commands with `#![deny(missing_docs)]`

// Point people here that search for attributes that don't exist in the derive (a subset of magic
// attributes)
#![doc(alias = "skip")]
#![doc(alias = "verbatim_doc_comment")]
#![doc(alias = "flatten")]
#![doc(alias = "external_subcommand")]
#![doc(alias = "subcommand")]
#![doc(alias = "rename_all")]
#![doc(alias = "rename_all_env")]
#![doc(alias = "default_value_t")]
#![doc(alias = "default_values_t")]
#![doc(alias = "default_value_os_t")]
#![doc(alias = "default_values_os_t")]

pub mod _tutorial;
#[doc(inline)]
pub use crate::_cookbook;

0 comments on commit 2dd5a67

Please sign in to comment.