seed
seed copied to clipboard
Add documentation for macros
Most of the macros exported by seed are undocumented, see: https://docs.rs/seed/0.7.0/seed/#macros It would be good if at least the most commonly used are documented with an example.
Hello, I was looking into the macros today.
It seems many of them are generated from there, is it right ?
element! {
address => Address; article => Article; aside => Aside; footer => Footer;
header => Header; h1 => H1;
...
}
So I am not sure if we can document them this way.
Also there is the comment
// @TODO merge with make_tags!
// El must be exposed in the module where this is called for these to work.
So maybe should we do try what the comment says and then see if we can document it? Maybe we could close this issue if it is not relevant anymore.
What do you think about it @MartinKavik and @L0g4n ?
I can imagine we can add a doc comment like Autogenerated element macro for generated macros with a link to more info or to associated MDN page if possible or something like that.
I saw this today. It is old but maybe useful https://stackoverflow.com/questions/33999341/generating-documentation-in-macros
I saw this today. It is old but maybe useful https://stackoverflow.com/questions/33999341/generating-documentation-in-macros
This does work though as expected, every macro would have the same documentation.
But maybe that's not be too bad considering that they mostly function the same.
What might also be useful is to include a link to the element macros section of the official guide. Since some people probably don't want to go to another site even if it's the official one, we can include the general principles of element macros, how they translate to html, and one or two generic examples in the docs.
It seems possible to make the macro documentation somewhat less generic based on this SO thread but it's from way back in 2017. I'm not too savvy with macros so I wasn't able to make it work.