rdoc

Crates.iordoc
lib.rsrdoc
version0.1.0
sourcesrc
created_at2017-04-26 00:28:30.580169
updated_at2017-04-26 00:28:30.580169
descriptionA simple rustc plugin to host documentation for your items in a separate file.
homepagehttps://github.com/mgattozzi/rdoc
repositoryhttps://github.com/mgattozzi/rdoc
max_upload_size
id12039
size17,947
Michael Gattozzi (mgattozzi)

documentation

https://docs.rs/rdoc/0.1.0/rdoc/

README

rdoc

A simple rustc plugin to host documentation for your items in a separate file.

Nightly

As this is a compiler plugin Rust Nightly is required

How to use it

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.

License

Licensed under either of

at your option.

Licensing

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.

Commit count: 0

cargo fmt