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

[rustdoc] add sub settings #64696

Merged
merged 2 commits into from
Nov 8, 2019
Merged

Conversation

GuillaumeGomez
Copy link
Member

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

Screenshot from 2019-09-23 00-46-14

r? @Mark-Simulacrum

@fbstj
Copy link
Contributor

fbstj commented Sep 23, 2019

is this just a reopening of #60778 ?

@GuillaumeGomez
Copy link
Member Author

No, I made some changes. For instance, there is no more global checkbox, just a title for sub-settings.

@Mark-Simulacrum
Copy link
Member

So to be clear, this PR changes the current "Auto-hide item declarations." into a set of preferences for each item type?

Can you update the top-level comment with an answer to this question?

  • How does this work when the previously loaded version of the page had auto-hide item declaration checked (and unchecked)? What about the reverse (i.e., going from the new version to the old)?
  • Why were these particular defaults chosen?

Personally, I never really found it all that useful to have a global hide setting for item declarations here so I would not want this feature -- I do generally work on at least a 15" screen though so in that sense I have relatively large screen real estate. Is this feature wanted by folks? And in the "yes I'd use this" not the "well, why not" sense?

@GuillaumeGomez
Copy link
Member Author

How does this work when the previously loaded version of the page had auto-hide item declaration checked (and unchecked)? What about the reverse (i.e., going from the new version to the old)?

No back compatibility if this is your question.

Why were these particular defaults chosen?

Debated on the previously opened PR.

Personally, I never really found it all that useful to have a global hide setting for item declarations here so I would not want this feature -- I do generally work on at least a 15" screen though so in that sense I have relatively large screen real estate. Is this feature wanted by folks? And in the "yes I'd use this" not the "well, why not" sense?

I've been asked to do this a lot of times actually (IRL and IRC). I personally don't care much about this feature but people seems to want to have a better control over the types declaration view.

@Mark-Simulacrum
Copy link
Member

No back compatibility if this is your question.

But, uh, what happens? Presumably we don't just error out and not run at all...

Debated on the previously opened PR.

Do you have a link? I don't see any such discussion on #60778...

I've been asked to do this a lot of times actually (IRL and IRC). I personally don't care much about this feature but people seems to want to have a better control over the types declaration view.

I would personally echo @QuietMisdreavus's concerns on #60778 that this does not seem to really carry it's weight. However, if there is indeed lots of demand, it also seems like a 'not bad' idea.

@GuillaumeGomez
Copy link
Member Author

But, uh, what happens? Presumably we don't just error out and not run at all...

It doesn't take it into account. That's pretty much it.

Do you have a link? I don't see any such discussion on #60778...

Seems like it wasn't there... Multi-channels communications are bad...

I would personally echo @QuietMisdreavus's concerns on #60778 that this does not seem to really carry it's weight. However, if there is indeed lots of demand, it also seems like a 'not bad' idea.

Like I said, I didn't do it just because. People asked me for it and at some point I just said ok and did it.

@JohnCSimon JohnCSimon added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 28, 2019
@Mark-Simulacrum
Copy link
Member

I'm going to r? @QuietMisdreavus here as a rustdoc team member, I don't personally feel comfortable driving this

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 12, 2019
@JohnCSimon
Copy link
Member

Ping from triage -
@QuietMisdreavus this seems to be waiting on a review
Thanks.

@wirelessringo
Copy link

Ping from triage. @QuietMisdreavus any updates on this? Thanks.

@bors
Copy link
Contributor

bors commented Oct 23, 2019

☔ The latest upstream changes (presumably #65716) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon
Copy link
Member

Pinging from triage:
@QuietMisdreavus can you please review this PR?
Also @GuillaumeGomez can you please resolve the merge conflict?
Thank you!

@GuillaumeGomez
Copy link
Member Author

Rebased.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-27T10:41:02.2601391Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-27T10:41:02.2791415Z ##[command]git config gc.auto 0
2019-10-27T10:41:02.2884701Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-27T10:41:02.2951364Z ##[command]git config --get-all http.proxy
2019-10-27T10:41:02.3101569Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/64696/merge:refs/remotes/pull/64696/merge
---
2019-10-27T11:42:04.6635209Z .................................................................................................... 1600/9253
2019-10-27T11:42:09.9489440Z .................................................................................................... 1700/9253
2019-10-27T11:42:22.5485565Z ..........................................................i...............i......................... 1800/9253
2019-10-27T11:42:30.2777574Z .................................................................................................... 1900/9253
2019-10-27T11:42:45.0778488Z ................................................iiiii............................................... 2000/9253
2019-10-27T11:42:56.1147102Z .................................................................................................... 2200/9253
2019-10-27T11:42:58.8471846Z .................................................................................................... 2300/9253
2019-10-27T11:43:02.6509388Z .................................................................................................... 2400/9253
2019-10-27T11:43:26.5810051Z .................................................................................................... 2500/9253
---
2019-10-27T11:46:22.5353046Z ...................................................i...............i................................ 4800/9253
2019-10-27T11:46:31.4941713Z .................................................................................................... 4900/9253
2019-10-27T11:46:40.3045559Z .................................................................................................... 5000/9253
2019-10-27T11:46:46.4994760Z .................................................................................................... 5100/9253
2019-10-27T11:46:57.3082763Z ....................................................ii.ii...........i............................... 5200/9253
2019-10-27T11:47:07.1237941Z .................................................................................................... 5400/9253
2019-10-27T11:47:16.5227520Z .................................................................................................... 5500/9253
2019-10-27T11:47:24.1816395Z ......................i............................................................................. 5600/9253
2019-10-27T11:47:30.1110608Z .................................................................................................... 5700/9253
2019-10-27T11:47:30.1110608Z .................................................................................................... 5700/9253
2019-10-27T11:47:42.3412246Z .................................................................................................... 5800/9253
2019-10-27T11:47:53.5408480Z ...................ii...i..ii...........i........................................................... 5900/9253
2019-10-27T11:48:15.3206058Z .................................................................................................... 6100/9253
2019-10-27T11:48:22.4065016Z .................................................................................................... 6200/9253
2019-10-27T11:48:22.4065016Z .................................................................................................... 6200/9253
2019-10-27T11:48:35.0077005Z ..........................................i..ii..................................................... 6300/9253
2019-10-27T11:48:57.7331834Z .................................................................................................... 6500/9253
2019-10-27T11:48:59.9899314Z ........i........................................................................................... 6600/9253
2019-10-27T11:49:02.3155042Z ...................................................................................i................ 6700/9253
2019-10-27T11:49:05.0276357Z .................................................................................................... 6800/9253
---
2019-10-27T11:53:39.8208641Z  finished in 5.691
2019-10-27T11:53:39.8383340Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T11:53:40.0183826Z 
2019-10-27T11:53:40.0184823Z running 153 tests
2019-10-27T11:53:43.2475674Z i....iii......iii..iiii...i.............................i..i..................i....i...........ii.i. 100/153
2019-10-27T11:53:45.2716671Z i..iiii..............i.........iii.i.........ii......
2019-10-27T11:53:45.8558804Z 
2019-10-27T11:53:45.8559151Z  finished in 5.433
2019-10-27T11:53:45.8559742Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T11:53:45.8560022Z 
---
2019-10-27T11:53:47.4996676Z  finished in 2.207
2019-10-27T11:53:47.5191634Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T11:53:47.6741260Z 
2019-10-27T11:53:47.6742366Z running 9 tests
2019-10-27T11:53:47.6743244Z iiiiiiiii
2019-10-27T11:53:47.6744091Z 
2019-10-27T11:53:47.6747224Z  finished in 0.155
2019-10-27T11:53:47.6939188Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T11:53:48.3600543Z 
---
2019-10-27T11:54:06.2542236Z  finished in 18.560
2019-10-27T11:54:06.2743775Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T11:54:06.4373723Z 
2019-10-27T11:54:06.4374043Z running 123 tests
2019-10-27T11:54:31.0487295Z .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....ii..........iiii..........i...ii...i.......ii. 100/123
2019-10-27T11:54:35.9177455Z i.i.i......iii.i.....ii
2019-10-27T11:54:35.9179163Z 
2019-10-27T11:54:35.9182777Z  finished in 29.644
2019-10-27T11:54:35.9192270Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T11:54:35.9194338Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2019-10-27T12:07:18.8570815Z 
2019-10-27T12:07:18.8577017Z    Doc-tests core
2019-10-27T12:07:24.3491881Z 
2019-10-27T12:07:24.3492829Z running 2408 tests
2019-10-27T12:07:36.0619514Z ......iiiii......................................................................................... 100/2408
2019-10-27T12:07:47.3846661Z ................................................................................ii.................. 200/2408
2019-10-27T12:08:13.2682921Z ..i................................................................................................. 400/2408
2019-10-27T12:08:13.2682921Z ..i................................................................................................. 400/2408
2019-10-27T12:08:23.8845926Z .................................................i..i.................iiii.......................... 500/2408
2019-10-27T12:08:44.3989466Z .................................................................................................... 700/2408
2019-10-27T12:08:55.2273469Z .................................................................................................... 800/2408
2019-10-27T12:09:05.9614076Z .................................................................................................... 900/2408
2019-10-27T12:09:17.2006571Z .................................................................................................... 1000/2408
---
2019-10-27T12:13:40.0312342Z 
2019-10-27T12:13:40.0312870Z running 999 tests
2019-10-27T12:14:02.3871271Z i................................................................................................... 100/999
2019-10-27T12:14:14.2863162Z .................................................................................................... 200/999
2019-10-27T12:14:23.0136651Z ...................iii......i......i...i......i..................................................... 300/999
2019-10-27T12:14:28.8452944Z .................................................................................................... 400/999
2019-10-27T12:14:36.9131459Z ..........................................i..i.................................ii................... 500/999
2019-10-27T12:14:52.3674667Z .................................................................................................... 700/999
2019-10-27T12:14:52.3674667Z .................................................................................................... 700/999
2019-10-27T12:15:00.3960411Z .........................iiii....................................................................... 800/999
2019-10-27T12:15:16.7373635Z .................................................................................................... 900/999
2019-10-27T12:15:24.9447184Z ...............................................iiii................................................
2019-10-27T12:15:24.9449538Z 
2019-10-27T12:15:24.9585083Z  finished in 202.616
2019-10-27T12:15:24.9604171Z Testing term stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-10-27T12:15:25.2029545Z    Compiling term v0.0.0 (/checkout/src/libterm)
---
2019-10-27T12:30:43.0581335Z Rustbook (x86_64-unknown-linux-gnu) - edition-guide
2019-10-27T12:30:43.4090662Z Building stage0 tool linkchecker (x86_64-unknown-linux-gnu)
2019-10-27T12:30:43.5700359Z    Compiling linkchecker v0.1.0 (/checkout/src/tools/linkchecker)
2019-10-27T12:30:45.6985845Z     Finished release [optimized] target(s) in 2.28s
2019-10-27T12:30:51.9631986Z settings.html:1: id is not unique: `line-numbers`
2019-10-27T12:30:53.7055636Z thread 'main' panicked at 'found some broken links', src/tools/linkchecker/main.rs:41:9
2019-10-27T12:30:53.7088271Z 
2019-10-27T12:30:53.7088574Z 
2019-10-27T12:30:53.7089303Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/linkchecker" "/checkout/obj/build/x86_64-unknown-linux-gnu/doc"
2019-10-27T12:30:53.7089540Z expected success, got: exit code: 101
---
2019-10-27T12:30:53.7181554Z   local time: Sun Oct 27 12:30:53 UTC 2019
2019-10-27T12:30:54.0104266Z   network time: Sun, 27 Oct 2019 12:30:54 GMT
2019-10-27T12:30:54.0106614Z == end clock drift check ==
2019-10-27T12:30:57.8037792Z 
2019-10-27T12:30:57.8177964Z ##[error]Bash exited with code '1'.
2019-10-27T12:30:57.8211375Z ##[section]Starting: Checkout
2019-10-27T12:30:57.8212995Z ==============================================================================
2019-10-27T12:30:57.8213047Z Task         : Get sources
2019-10-27T12:30:57.8213104Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@GuillaumeGomez
Copy link
Member Author

Fixed the issue.

cc @QuietMisdreavus

@JohnCSimon
Copy link
Member

Ping from triage
@QuietMisdreavus can you please review this PR?
Thanks

@GuillaumeGomez
Copy link
Member Author

r? @kinnison

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the pluralisation comment I have some concerns that we are not testing the generation of this content at all.

It would probably behoove us to ensure there's at least a basic test checking for the presence of the settings in the generated output.

format!(
"<div class='setting-line'>\
<div class='title'>{}</div>\
<div class='sub-setting'>{}</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this div contains potentially more than one sub-setting, I wonder if it ought to be sub-settings ?

Suggested change
<div class='sub-setting'>{}</div>
<div class='sub-settings'>{}</div>

@@ -59,3 +67,9 @@ input:checked + .slider:before {
-ms-transform: translateX(19px);
transform: translateX(19px);
}

.setting-line > .sub-setting {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To match the change to sub-settings you'd need:

Suggested change
.setting-line > .sub-setting {
.setting-line > .sub-settings {

@GuillaumeGomez
Copy link
Member Author

We have a UI server but the integration with highfive is buggy and needs to be fixed. (Maybe when @pietroalbini has some time, we could take a look to understand what's going on)

@GuillaumeGomez
Copy link
Member Author

Updated.

Copy link
Contributor

@kinnison kinnison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@kinnison
Copy link
Contributor

kinnison commented Nov 4, 2019

Regarding some basic regression testing, could we do a basic rustdoc-ui test using htmldocck.py ?

@GuillaumeGomez
Copy link
Member Author

It allows to check the DOM, so it depends what you want to check?

@kinnison
Copy link
Contributor

kinnison commented Nov 6, 2019

I was just thinking that a basic check demonstrating that the settings have made it out in a form we were expecting -- that way if the shape is changed in the future, there's a regression test reminding people to re-check it and update the test if it's good. I wouldn't block a merge on that but you were saying you wanted more tests :D

@GuillaumeGomez
Copy link
Member Author

It's more UI tests then. It's scheduled but I need to have highfive fully working on this so we don't have bad surprises.

@kinnison
Copy link
Contributor

kinnison commented Nov 6, 2019

Okay, if you want to make a note (issue?) for the need for the test, and merge the fix in the meantime, I'm good with that.

@GuillaumeGomez
Copy link
Member Author

Done here. Thanks for your review!

@bors: r=kinnison

@bors
Copy link
Contributor

bors commented Nov 7, 2019

📌 Commit 8784b07 has been approved by kinnison

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2019
Centril added a commit to Centril/rust that referenced this pull request Nov 7, 2019
…, r=kinnison

[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
Centril added a commit to Centril/rust that referenced this pull request Nov 7, 2019
…, r=kinnison

[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
Centril added a commit to Centril/rust that referenced this pull request Nov 7, 2019
…, r=kinnison

[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
bors added a commit that referenced this pull request Nov 7, 2019
Rollup of 5 pull requests

Successful merges:

 - #63793 (Have tidy ensure that we document all `unsafe` blocks in libcore)
 - #64696 ([rustdoc] add sub settings)
 - #65916 (syntax: move stuff around)
 - #66087 (Update some build-pass ui tests to use check-pass where applicable)
 - #66182 (invalid_value lint: fix help text)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Nov 7, 2019
Rollup of 5 pull requests

Successful merges:

 - #63793 (Have tidy ensure that we document all `unsafe` blocks in libcore)
 - #64696 ([rustdoc] add sub settings)
 - #65916 (syntax: move stuff around)
 - #66087 (Update some build-pass ui tests to use check-pass where applicable)
 - #66182 (invalid_value lint: fix help text)

Failed merges:

r? @ghost
@bors bors merged commit 8784b07 into rust-lang:master Nov 8, 2019
@GuillaumeGomez GuillaumeGomez deleted the rustdoc-sub-settings branch November 8, 2019 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants