Skip to content

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

Open
@ojeda

Description

@ojeda

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions