docify
docify copied to clipboard
idea: new syntax
Yandros proposed a new syntax that looks like this:
#[docify::docify]
/// some comments some comments
/// @embed("examples/samples.rs", MyCoolStruct)
/// another example:
/// @embed("src/something.rs", MyThing)
/// some closing comments
pub struct Foo;
Originally mentioned here: https://github.com/paritytech/substrate/pull/14672#issuecomment-1659032003
If we were to go with this syntax, we would finally be able to limit expansion of docify embeds to only be attempted if the caller is #[cfg(doc)]
which we currently lack the context information to be able to do, and which is currently impossible in #[doc = ..]
position but is possible for an "outer attribute" approach like this.