[rustdoc] Add new --feature-documentation command line option - #162344
[rustdoc] Add new --feature-documentation command line option#162344GuillaumeGomez wants to merge 1 commit into
--feature-documentation command line option#162344Conversation
|
Some changes occurred in HTML/CSS/JS. rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
Should this be specific to features or generalized to any cfg or cfg value? |
|
Do we want to make room for future possibilities like unstable and deprecated features, as well as feature visibility (public/internal)? Also, do we want to show optionality, default features, and enabled by / will enable? |
|
For visibility, we could hack tha into |
|
I no longer think my old rustdoc config RFC is the right path (though I still like parts of it), but I do think what I proposed for the CLI could be reasonable https://github.com/tgross35/rfcs/blob/rustdoc-cargo-config/text/0000-rustdoc-cargo-configuration.md#changes-to-rustdoc. Basically just forward the Which leaves room for things like visibility and deprecation, and also gives rustdoc the I'm just not sure it's worth figuring out a way to encode this info with separate CLI arguments when this is pretty much never going to be written by hand anyway. |
Just in case, this is about
If we accept JSON as input, I suppose we can without too much problem.
That was part of the list of unresolved questions. I think we should provide both "enabled by"/"will enable". The "enabled by" can be computed from "will enable" tough.
I think we should always display features. However, would be nice to have "hidden" features too. @tgross35 I like this approach too as it would allow |
My idea was about
|
Hum, fair. Not sure if we want to include these |
If that's what you're worried about, then why even provide structured data? A CLI option that adds an arbitrary Markdown file to the generated docs, including a link on the home page and rendering it with the same Rustdoc chrome that |
A lot could be done through that interface. I guess the question is if we want any additional features, like |
Now that rust-lang/rfcs#3485 is about to be merged, I think it's time for rustdoc to implement its part as well.
It allows to add documentation for features (from
cfg(feature = "...")).This PR is very much up to debate on all aspects (starting with the name of the CLI option). Here are a few things that I think should be discussed:
TODO: Add
test/rustdoc-uitests once the CLI and what it should look like is agreed upon.Your input is very welcome too @rust-lang/cargo!
r? @rust-lang/rustdoc