docify icon indicating copy to clipboard operation
docify copied to clipboard

idea: new syntax

Open sam0x17 opened this issue 11 months ago • 4 comments

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.

sam0x17 avatar Jul 31 '23 19:07 sam0x17