If the readme
Cargo.toml
key is set, doc.rs renders the README on the crate's index page. Is there a way to emulate this when running cargo doc
locally?
If I add:
#![doc = r###"contents
of
README.md
here
"###]
as a literal, I get the behaviour I'm looking for, but inlining a copy of my whole README.md is pretty inconvenient for making updates.
I tried:
#![doc = include!("README.md")]
but this gives an error:
error: unexpected token: `include`
--> src/lib.rs:3:10
|
3 | #![doc = include!("README.md")]
| ^^^^^^^
#[doc = include_str!("my_doc.md")
is the new way to do this in nightly via #78837 – Influx