Crates.io | rdoc |
lib.rs | rdoc |
version | 0.1.0 |
source | src |
created_at | 2017-04-26 00:28:30.580169 |
updated_at | 2017-04-26 00:28:30.580169 |
description | A simple rustc plugin to host documentation for your items in a separate file. |
homepage | https://github.com/mgattozzi/rdoc |
repository | https://github.com/mgattozzi/rdoc |
max_upload_size | |
id | 12039 |
size | 17,947 |
A simple rustc plugin to host documentation for your items in a separate file.
As this is a compiler plugin Rust Nightly is required
In your Cargo.toml
put:
[dependencies]
rdoc = "*"
In your lib.rs
or main.rs
file place the following at the top:
#![feature(plugin)]
#![plugin(rdoc)]
Given a file doc.md
living at the top of your directory, in your code place
this over the item you want to be documented:
#[rdoc = "doc.md"]
pub fn print_hello() {
println!("Hello!");
}
At compile time this annotation will turn into a doc comment with the contents
of doc.md
for whatever item is below it. No need for specific file types or
putting the ///
annotations in the file. Just write your documentation text
and rdoc
takes care of the rest for you! All you need to do is provide a valid
path in the annotation.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.