-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document built-in syntax extensions #5605
Comments
Right, would be nice if macros and syntax extensions would behave more like normal items in that regard. Proposals:
|
For macros I think @Kimundi has the right idea(s). For compiled syntax extensions, I suspect rustdoc should be taught to declaratively associate a syntax extension name with the module defining it. Possibly this could be an additional attribute on the module containing the extension, possibly part of the hypothetical loadable-syntax-extension-defining form, like a |
Nothing new to report. |
It's unclear to me why these currently aren't allowed, and my best guess is that a long time ago we didn't strip the ast of cfg nodes before syntax expansion. Now that this is done, I'm not certain that we should continue to prohibit this functionality. This is a step in the right direction towards rust-lang#5605, because now we can add an empty `std::macros` module to the documentation with a bunch of empty macros explaining how they're supposed to be used.
It's unclear to me why these currently aren't allowed, and my best guess is that a long time ago we didn't strip the ast of cfg nodes before syntax expansion. Now that this is done, I'm not certain that we should continue to prohibit this functionality. This is a step in the right direction towards #5605, because now we can add an empty `std::macros` module to the documentation with a bunch of empty macros explaining how they're supposed to be used.
Any macro tagged with #[macro_export] will be showed in the documentation for that module. This also documents all the existing macros inside of std::macros. Closes rust-lang#3163 cc rust-lang#5605 Closes rust-lang#9954
Visiting for triage. Attributes are now allowed in macros and macros tagged with Still some work left here, though. |
These syntax extensions need a place to be documented, and this starts passing a `--cfg dox` parameter to `rustdoc` when building and testing documentation in order to document macros so that they have no effect on the compiled crate, but only documentation. Closes #5605
core::unstable::extfmt
has some good documentation aboutfmt!
but this module is an implementation detail and isn't (or shouldn't be) shown in the docs. Maybe rustdoc could have a way to write arbitrary pages of documentation and we could have one for syntax extensions and macros. Once syntax extensions become user-definable then we could create a more general way of documenting them.The text was updated successfully, but these errors were encountered: