<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/librustdoc/html/static/js/main.js, branch 1.77.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.77.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.77.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-01-08T16:54:05+00:00</updated>
<entry>
<title>rustdoc: hide modals when resizing the sidebar</title>
<updated>2024-01-08T16:54:05+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2024-01-08T16:27:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8b52275ee34c829a29bbb677fffd7da48d242616'/>
<id>urn:sha1:8b52275ee34c829a29bbb677fffd7da48d242616</id>
<content type='text'>
Follow-up for
https://github.com/rust-lang/rust/pull/119477#discussion_r1439085011
</content>
</entry>
<entry>
<title>Auto merge of #119066 - notriddle:notriddle/sidebar-source-redesign, r=GuillaumeGomez</title>
<updated>2023-12-31T15:32:15+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-12-31T15:32:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=67b6975051b83ef2bd28f06e8467470d570aceb3'/>
<id>urn:sha1:67b6975051b83ef2bd28f06e8467470d570aceb3</id>
<content type='text'>
rustdoc: clean up source sidebar hide button

This is a redesign of the feature, with parts pulled from https://github.com/rust-lang/rust/pull/119049 but with a button that looks more like a button and matches the one used on other sidebar pages.

Preview:

* http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/src/std/lib.rs.html
* http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/std/index.html

| | Before | After |
|--|--|--|
| Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/092bed75-79c3-412f-8e7b-557f30dfb1e3) | ![image](https://github.com/rust-lang/rust/assets/1593513/b68e1ee9-9aef-484d-a5b1-2fd29c9d72ea)
| Open | ![image](https://github.com/rust-lang/rust/assets/1593513/95cf9545-25b1-48ec-820b-02e1aec99839) | ![image](https://github.com/rust-lang/rust/assets/1593513/923532f6-59e0-4d7c-9976-21699c30d42e)
| Mobile Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/9bc00cc5-937c-4120-94be-94c7cb6d5297) | ![image](https://github.com/rust-lang/rust/assets/1593513/76a744d8-aac2-46fe-abb9-3b34e2d3ccaa)
| Mobile Open | ![image](https://github.com/rust-lang/rust/assets/1593513/d19a94fe-47b1-462d-a280-44fc215b9b72) | ![image](https://github.com/rust-lang/rust/assets/1593513/2b2e3dec-b610-4b12-8a72-35b86359ba45)
</content>
</entry>
<entry>
<title>rustdoc: treat query string `+` as space</title>
<updated>2023-12-26T21:14:28+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-12-26T20:48:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=624885d242fb8ecefa5993e834f429a635b86178'/>
<id>urn:sha1:624885d242fb8ecefa5993e834f429a635b86178</id>
<content type='text'>
Fixes #119219
</content>
</entry>
<entry>
<title>Fix corner cases when dealing with mobile mode</title>
<updated>2023-12-20T02:50:53+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-12-20T01:22:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9566db1e496e6a834529e0ffbe3397b0c0d6803a'/>
<id>urn:sha1:9566db1e496e6a834529e0ffbe3397b0c0d6803a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: clean up source sidebar hide button</title>
<updated>2023-12-18T06:06:31+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-12-18T06:06:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=859bbc5deffbee7870433c541cdbeb4a4a23780f'/>
<id>urn:sha1:859bbc5deffbee7870433c541cdbeb4a4a23780f</id>
<content type='text'>
This is a redesign of the feature, with parts pulled from
https://github.com/rust-lang/rust/pull/119049
but with a button that looks more like a button and matches the
one used on other sidebar pages.
</content>
</entry>
<entry>
<title>Rollup merge of #115660 - notriddle:notriddle/sidebar-resize, r=GuillaumeGomez</title>
<updated>2023-12-15T10:51:23+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2023-12-15T10:51:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f8b92697a1c444eea01ae9e723c40a35e42ad42c'/>
<id>urn:sha1:f8b92697a1c444eea01ae9e723c40a35e42ad42c</id>
<content type='text'>
rustdoc: allow resizing the sidebar / hiding the top bar

Fixes #97306

Preview: http://notriddle.com/rustdoc-html-demo-4/sidebar-resize/std/index.html

![image](https://github.com/rust-lang/rust/assets/1593513/a2f40ea2-0436-4e44-99e8-d160dab2a680)

## Summary

This feature adds:

1. A checkbox to the Settings popover to hide the persistent navigation bar (the sidebar on large viewports and the top bar on small ones).
2. On large viewports, it adds a resize handle to the persistent sidebar. Resizing it into nothing is equivalent to turning off the persistent navigation bar checkbox in Settings.
3. If the navigation bar is hidden, a toolbar button to the left of the search appears. Clicking it brings the navigation bar back.

## Motivation

While "mobile mode" is definitely a good default, it's not the only reason people have wanted to hide the sidebar:

* Some people use tiling window managers, and don't like rustdoc's current breakpoints. Changing the breakpoints might help with that, but there's no perfect solution, because there's a gap between "huge screen" and "smartphone" where reasonable people can disagree about whether it makes sense for the sidebar to be on-screen. https://github.com/rust-lang/rust/issues/97306

* Some people ask for ways to reduce on-screen clutter because it makes it easier to focus. There's not a media query for that (and if there was, privacy-conscious users would turn it off). https://github.com/rust-lang/rust/issues/59829

This feature is designed to avoid these problems. Resizing the sidebar especially helps, because it provides a way to hide the sidebar without adding a new top-level button (which would add clutter), and it provides a way to make rustdoc play nicer in complex, custom screen layouts.

## Guide and Reference-level explanation

On a desktop or laptop with a mouse, resize the sidebar by dragging its right edge.

On any browser, including mobile phones, the sticky top bar or side bar can be hidden from the Settings area (the button with the cog wheel, next to the search bar). When it's hidden, a convenient button will appear on the search bar's left.

## Drawbacks

This adds more JavaScript code to the render blocking area.

## Rationale and alternatives

The most obvious way to allow people to hide the sidebar would have been to let them "manually enter mobile mode." The upside is that it's a feature we already have. The downside is that it's actually really hard to come up with a terse description. Is it:

* A Setting that forces desktop viewers to always have the mobile-style top bar? If so, how do we label it? Should it be visible on mobile, and, if so, does it just not do anything?
* A persistent hide/show sidebar button, present on desktop, just like on mobile? That's clutter that I'd like to avoid.

## Prior art

* The new file browser in GitHub uses a similar divider with a mouse-over indicator
* mdBook and macOS Finder both allow you to resize the sidebar to nothing as a gesture to hide it
* https://www.nngroup.com/articles/drag-drop/

## Future possibilities

https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Table.20of.20contents proposes a new, second sidebar (a table of contents). How should it fit in with this feature? Should it be resizeable? Hideable? Can it be accessed on mobile?
</content>
</entry>
<entry>
<title>Rollup merge of #118325 - clubby789:rustdoc-search-link, r=fmease</title>
<updated>2023-11-27T07:21:19+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-11-27T07:21:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=828db2860f275d3e0ce07f746fca6ffce089da68'/>
<id>urn:sha1:828db2860f275d3e0ce07f746fca6ffce089da68</id>
<content type='text'>
Fix Rustdoc search docs link

This link has been outdated since #112725 moved the search docs to their own page
</content>
</entry>
<entry>
<title>Fix Rustdoc search docs link</title>
<updated>2023-11-26T16:22:43+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2023-11-26T16:22:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d9344d26ebe8ac6ede26ca054a57334be4299ad'/>
<id>urn:sha1:4d9344d26ebe8ac6ede26ca054a57334be4299ad</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: replace `elemIsInParent` with `Node.contains`</title>
<updated>2023-11-25T19:33:04+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-11-25T19:20:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bdcf91605caf75969919ae366e5e0561dcd85ea5'/>
<id>urn:sha1:bdcf91605caf75969919ae366e5e0561dcd85ea5</id>
<content type='text'>
According to [MDN], this function is compatible with:

* Chrome 16 and Edge 12
* Firefox 9
* Safari 1.1 and iOS Safari 1

These browsers are well within our [support matrix], which requires
compatibility with Chrome 118, Firefox 115, Safari 17, and Edge 119.

[MDN]: https://developer.mozilla.org/en-US/docs/Web/API/Node/contains#browser_compatibility
[support matrix]: https://browsersl.ist/#q=last+2+Chrome+versions%2C+last+1+Firefox+version%2C+Firefox+ESR%2C+last+1+Safari+version%2C+last+1+iOS+version%2C+last+1+Edge+version%2C+last+1+UCAndroid+version
</content>
</entry>
<entry>
<title>rustdoc: use `.rustdoc` class instead of `body`</title>
<updated>2023-11-13T06:21:21+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-11-13T06:21:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8b1bcc8d5ba65ecf6741436246ed27f74a71d40c'/>
<id>urn:sha1:8b1bcc8d5ba65ecf6741436246ed27f74a71d40c</id>
<content type='text'>
This didn't show up in our local tests, because the problem is actually
caused by docs.rs rewritten HTML (which relocates the classes that this
code looked for from the body tag to a child div).

Fixes #117290
</content>
</entry>
</feed>
