Attribute Macro docify_macros::export_content

source ·
#[export_content]
Expand description

Like #[docify::export] but only exports the inner contents of whatever item the attribute is attached to.

For example, given the following:

#[docify::export_content]
mod my_mod {
    pub fn some_fun() {
        println!("hello world!");
    }
}

only this part would be exported:

pub fn some_fun() {
    println!("hello world");
}

Note that if #[docify::export_content] is used on an item that has no notion of inner contents, such as a type, static, or const declaration, it will simply function like a regular #[docify::export] attribute.

Supported items include:

  • functions
  • modules
  • trait declarations
  • trait impls
  • basic blocks (when inside an outer macro pattern)

All other items will behave like they normally do with #[docify::export]. Notably this includes structs and enums, because while these items have a defined notion of “contents”, those contents cannot stand on their own as valid rust code.