9

rustdoc: stabilise --default-theme command line option by ijackson · Pull Reques...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/79642
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

ijackson commented 17 days ago

As discussed in #77213, this seems like it has bedded in and can be safely and usefully made stable.

(rustdoc already has other stable options that interact quite intimately with the rustdoc-supplied CSS, and also an option for supplying entirely different CSS, so exposing the theme names this way seems a very minor step.)

There is also a commit to do some minor grammar fixes to the help message.

Collaborator

rust-highfive commented 17 days ago

r? @jyn514

(rust-highfive has picked a reviewer for you, use r? to override)

Member

jyn514 commented 17 days ago

@rfcbot fcp merge

This stabilizes the --default-theme option, which sets the 'default default' theme for rustdoc pages. The current 'default default' is hard-coded to light; this allows it to be any supported theme. Some example use cases:

  • When documenting locally, file:// URLs do not share state, so setting a default in the settings page gets discarded when you go to a new link. This lets you set the default theme when running cargo doc, so you don't have to select it again on every page.
  • When hosting your own documentation (i.e. not docs.rs), you might have a preferred theme where your documentation or logo looks better.

The flag has already been on nightly for a month or so without issues, and it seems unlikely to have unexpected consequences.

rfcbot commented 17 days ago

edited by GuillaumeGomez

Team member @jyn514 has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

Isn't there documentation to be moved/added before?

Member

jyn514 commented 17 days ago

Good catch, thanks! @ijackson can you document this in src/doc/rustdoc/src/command-line-arguments.md?

Contributor

Author

ijackson commented 17 days ago

Isn't there documentation to be moved/added before?

Thanks for the attention. Indeed, I forgot to do this. (I was confused because I'm simultaneously working on a libcore stabilisation change and of course libcore unstable items are typically already documented.)

You'll see I have pushed a doc update.

Unfortunately I was not able to actually format the command-line-arguments.md with the build system in rust-lang/rust. I tried several attempts at getting ./x.py to DTRT but the file build/x86_64-unknown-linux-gnu/doc/rustdoc/command-line-arguments.html remained stubbornly untouched. Even though it did rebuild rustc several times. My latest attempt in this flail has resulted in x.py choosing to rebuild LLVM. Even on my really very fast laptop that is going to take most of an hour and I want to go to sleep now.

However, I have run the .md update through the pandoc on my laptop (Debian buster) and the results look plausible to me.

Contributor

Author

ijackson commented 17 days ago

+Note that the set of available themes - and their appearance - is not +necessarily stable from one rustdoc version to the next. If the +requested theme does not exist, the builtin default (currently

Shouldn't we exit with an error in case a theme doesn't exist instead?

No. I considered this question and chose this behaviour. Because the set of themes isn't stable, calling that an error would make removing a theme a compatibility break.

With this approach, removing a theme simply causes things to revert to the default. That is the same thing that happens if you select a theme in the theme picker, and then later that theme is removed. I think that makes sense.

Thanks, Ian.

With documentation, it's all good for me as well!

rfcbot commented 15 days ago

bellThis is now entering its final comment period, as per the review above. bell

rfcbot commented 5 days ago

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Assignees

jyn514

Projects

None yet

Milestone

No milestone

Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK