| Crates.io | no-incode-comments |
| lib.rs | no-incode-comments |
| version | 0.1.0 |
| created_at | 2025-04-21 00:10:04.141657+00 |
| updated_at | 2025-04-21 00:10:04.141657+00 |
| description | A proc macro that removes in-code comments from the code |
| homepage | |
| repository | https://github.com/godbrigero/no-incode-comments |
| max_upload_size | |
| id | 1642115 |
| size | 10,079 |
A Rust procedural macro that allows you to keep documentation for your code in external Markdown files instead of inline doc comments.
This library solves the problem of maintaining documentation alongside your code by:
This approach has several benefits:
Add this to your Cargo.toml:
[dependencies]
no-incode-comments = "0.1.0"
docs/my_function.md):# MyFunction
This is documentation for my_function.
It will be rendered as the doc comment for the function.
# AnotherSection
This section won't be included since we're only importing the "MyFunction" section.
external_doc macro to import the documentation:use no_incode_comments::external_doc;
#[external_doc(path = "docs/my_function.md", key = "MyFunction")]
pub fn my_function() {
// Function implementation
}
The path parameter specifies the Markdown file location, and the key parameter indicates which section (by heading) to import.
The procedural macro:
///)See the sample code in main.rs and the corresponding documentation in docs/sample_file.md.
This project is available under the MIT License.