Add component `Description` automatically from rust comment
Right now we have to do this to both get the description in the API docs and on the component:
components!("app", {
// My fancy test component
@[Description["My fancy test component"]]
testy: String,
});
It would be nice if doing just // comment would automatically add a Description to the component.
The // comment is not possible as // comments are stripped before macro invocations.
Capturing doc-comments have to be done in the form of meta-attributes, e.g #[doc = "comment"]
Through some matching trickery it is likely possible
@ten3roberts Oh sorry, I mean ///. Is that also not possible?
/// is possible, I think. It may be simpler to generate the doc comment from the macro than to parse the doc comment in the macro.
I may have been a bit unclear.
Capturing doc-comments /// comment is definitely possible, although a little tricky.
What I meant i that they need to be matched in the #[doc = "comment"] style as they desugar into that before the macros are evaluated. The /// comment syntax is only sugar.
In fact, we already capture doc attributes, but only forward them to the declared component function
All API components now come from ambient.toml (instead of being outputted to ambient.toml), so this is no longer necessary.