Derive Macro ReferenceDoc
#[derive(ReferenceDoc)]
{
// Attributes available to this derive:
#[reference_doc]
}
Expand description
Macro that adds an implementation of the trait MarkdownReferenceDocGenerator
to structs with derive(ReferenceDoc)
. The trait adds the fn
get_markdown_reference_docs()
. The return value is generated by consuming the
struct’s field names, types, and doc comments. Markdown headers in the
doc comments are appropriately indented based on the context in which
they appear.
Attributes: none
Example:
#[derive(ReferenceDoc)]
struct MyStruct {
/// This comment will appear for `field`, and can contain markdown.
/// It will be prefixed by a generated heading.
///
/// Other comments may link to the generated heading using the hash `#field`.
/// For example, [this](#field) is a self-referencing link.
field: i32,
}