doc-comment

Crates.iodoc-comment
lib.rsdoc-comment
version0.3.4
created_at2018-03-29 08:35:21.939899+00
updated_at2025-10-24 10:01:18.978216+00
descriptionMacro to generate doc comments
homepage
repositoryhttps://github.com/GuillaumeGomez/doc-comment
max_upload_size
id58042
size11,350
Guillaume Gomez (GuillaumeGomez)

documentation

http://docs.rs/crate/doc-comment

README

doc-comment

Write doc comments from macros.

Please note that calling macros in doc attribute was added in Rust 1.54 so unless you need to support older Rust versions, you don't need this crate and you can do the same thing with:

#[cfg_attr(doctest, doc = include_str!("../README.md"))]

Usage example

// Of course, we need to import the `doc_comment` macro:
#[macro_use]
extern crate doc_comment;

// If you want to test examples in your README file.
doctest!("../README.md");

// If you want to test your README file ONLY on "cargo test":
#[cfg(doctest)]
doctest!("../README.md");

// If you want to document an item:
doc_comment!(concat!("fooo", "or not foo"), pub struct Foo {});

For more information, take a look at the documentation.

Commit count: 0

cargo fmt