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

In [-] doc buttons, change hyphen ‘-’ to minus ‘−’ #24797

Merged
merged 3 commits into from
Apr 27, 2015

Conversation

roryokane
Copy link
Contributor

The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look slightly smoother.

If you don’t want to use literal Unicode characters, I can change ‘−’ to \u2212. I’m not starting with that suggestion because ‘−’ is easier to read and understand, and if I used \u2212, it would probably be necessary to also comment the usage on each line to explain what character is being used.

The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look more smooth.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@killercup
Copy link
Member

You can also use − and + to make this more explicit.

@liigo
Copy link
Contributor

liigo commented Apr 25, 2015

HTML files should be updated too.

@alexcrichton
Copy link
Member

I agree with @killercup that it may be best to use the HTML escape sequences here instead as otherwise it's pretty subtle to miss in a refactoring.

So that if people accidentally delete the character, they won’t re-type it as a hyphen, which would cause bugs.

I changed ‘+’ too, even though it won’t be re-typed incorrectly, so that it is easier to see when plus is used as a symbol for the button, and when it is used as an operator in code. It also makes it clearer that the use of an entity for minus is on purpose, so people won’t be tempted to replace the entity incorrectly with a hyphen character.
@roryokane
Copy link
Contributor Author

Thanks for the comments. I have made those changes.

@nikomatsakis
Copy link
Contributor

@bors r+ rollup 72e8f7b

@bors
Copy link
Contributor

bors commented Apr 27, 2015

📌 Commit 72e8f7b has been approved by nikomatsakis

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Apr 27, 2015
The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look slightly smoother.

If you don’t want to use literal Unicode characters, I can change ‘−’ to `\u2212`. I’m not starting with that suggestion because ‘−’ is easier to read and understand, and if I used `\u2212`, it would probably be necessary to also comment the usage on each line to explain what character is being used.
bors added a commit that referenced this pull request Apr 27, 2015
@bors bors merged commit 72e8f7b into rust-lang:master Apr 27, 2015
@bluss
Copy link
Member

bluss commented Apr 28, 2015

The toggle all button (upper right hand corner) seems to have broken.

@jooert
Copy link
Contributor

jooert commented Apr 28, 2015

The problem seems to be (see this StackOverflow question) that jQuery sees the unicode character, not the html entity. Rolling back the last commit 72e8f7b fixes this problem.

@jooert
Copy link
Contributor

jooert commented Apr 28, 2015

Or using "\u2212" for the minus sign, which is less likely to be deleted accidentally.

@liigo
Copy link
Contributor

liigo commented Apr 29, 2015

the toggle [-]/[+] is broken: #24918
was this change tested in real browsers before merge?
@roryokane @nikomatsakis

@liigo
Copy link
Contributor

liigo commented Apr 29, 2015

How about revert this, and use a monospaced font (to make - and + the same width) ?

roryokane added a commit to roryokane/rust that referenced this pull request Apr 30, 2015
The cause of the problem is described here: rust-lang#24797 (comment) .

I tested this new `main.js` by changing the `main.js` content of a rendered docs page to this new content. The [−] button worked again.
bors added a commit that referenced this pull request May 7, 2015
My change in #24797 had a bug, described in that issue’s comments, and first discovered in issue #24918. This fixes it.

I tested this new `main.js` by changing the `main.js` content of [a rendered docs page](https://doc.rust-lang.org/std/option/) to this new content. The ‘[−]’ button worked again.

I am also including another related fix, because it would require manual merging if I made a separate pull request for it. The page-global ‘[−]’ button currently adds `#` to the end of the URL whenever it is clicked. I am changing its `href` from `#` to `javascript:void(0)` (the same as the `href` for section-specific ‘[−]’ links) to fix that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants