Skip to content
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

Allow to provide a custom map of rendered strings for doc(cfg(...)) #87139

Open
ojeda opened this issue Jul 14, 2021 · 0 comments
Open

Allow to provide a custom map of rendered strings for doc(cfg(...)) #87139

ojeda opened this issue Jul 14, 2021 · 0 comments
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ojeda
Copy link
Contributor

ojeda commented Jul 14, 2021

Currently, rustdoc has some hardcoded logic to render doc(cfg(...)) in:

Cfg::Cfg(name, value) => {

rustdoc could also take a map of config options to "rendered strings" (passed as e.g. a file via the command line), so that one may have:

This is supported on Networking only.

instead of:

This is supported on CONFIG_NET only.

Ideally, there could be also be one for the "short" name (that goes in the index) and the "long" name (that goes inside the item); and perhaps even allow for Markdown and to provide a custom formatting string (so that the message can be customized), e.g. it could be used to have something like:

Supported when My Driver (CONFIG_MY_DRIVER) is enabled.
Supported when My Driver (CONFIG_MY_DRIVER) is enabled as a module (M).
Supported when My Driver (CONFIG_MY_DRIVER) is enabled as a built-in (Y).

@jonas-schievink jonas-schievink added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 14, 2021
@bjorn3 bjorn3 added A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-enhancement Category: An issue proposing an enhancement or a PR with one. C-feature-request Category: A feature request, i.e: not implemented / a PR. and removed C-feature-request Category: A feature request, i.e: not implemented / a PR. C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants