* fix(theme/index): Use nav element for Table of Content
* fix(renderer/html_handlebars/helpers/toc): Use ol instead of ul
Chapters and sections are ordered, so we should use the appropriate HTML tag.
* fix(renderer/html_handlebars/helpers/toc): Hide section number from screen readers
Screen readers have this functionality build-in, no need to present this. Ideally, this should not even be in the DOM tree, since the numbers can be shown by using CSS.
* fix(theme/index): Remove tabIndex="-1" from .page
Divs are not focusable by default
* fix(theme): Make sidebar accessible
Using aria-hidden (together with tabIndex) takes the links out of the tab order.
http://heydonworks.com/practical_aria_examples/#progressive-collapsibles
* fix(theme/index): Wrap content inside main tag
The main tag helps users skip additional content on the page.
* fix(theme/book): Don't focus .page on page load
The main content is identified by the main tag, not by auto-focusing it on page load.
* fix(theme/index): Make page controls accessible
* fix: Make theme selector accessible
- Use ul and li (since it is a list)
- Add aria-expanded and aria-haspopup to the toggle button
- Use button instead of div (buttons are accessible by default)
- Handle Esc key (close popup)
- Adjust CSS to keep same visual style
* fix(theme/stylus/sidebar): Make link clickable area wider
Links now expand to fill the entire row.
* fix(theme): Wrap header buttons and improve animation performance
Previously, the header had a fixed height, which meant that sometimes the print button was not visible. Animating the left property is expensive, which lead to laggy animations - transform is much cheaper and has the same effect.
* fix(theme/stylus/theme-popup): Theme button inherits color
Bug introduced while making the popup accessible
* fix(theme/book): Handle edge case when toggling sidebar
Bug introduced when switching from animating left to using transform.
This commit changes the url used to call the playground, and the
request parameter format to go with it. The older evaluate is
available in the playground as a form of backwards compatibility
and swithcing now opens way for using newer features.
- list of available crates is dynamically loaded from play.rust-lang.org
- play button is enabled only if crates used in snippet are available on playground
- ACE editor's play button is dynamically updated on each text change
- `no_run` is honored by always disabling the play button
- minor cleanups
Fixes a lot of browser incompatibilities in localStorage/cookie handling
Including but not limited to:
- loss of styling and functionality on chromium private mode
- loss of styling and functionality on safari and safari private mode
- awaiting verification if problems in mobile safari are solved.
Hidden code blocks are no longer indented with
one additional space (required for doctests to compile in some cases)
Now the behavior is similar to the rustdoc's
Fixes#179.
Highlight.js does not apply syntax highlighting to code blocks marked
no-highlight, nohighlight, plain, or text. When it finds blocks of those
languages, it does not add the `hljs` class to those code blocks either.
highlight.css and tomorrow-night.css use the `hljs` class to give code
blocks their backrgound color and text color, and we want that to apply
even if the code doesn't get syntax highlighting markup.
This is a somewhat hacky solution to get just that behavior! After this
commit, code blocks with no-highlight, nohighlight, plain, or text
language set on them will indeed get the hljs colors.
The current section headers are url encoded. Because of that they
have some funny characters like %20. We can clean that up by removing
all of the non-word characters before placing them in the anchor.
The div is now inserted after the <i>, the text color has also been changed to the foreground color and the "(default)" text that indicates the default theme is now grey to contrast with the theme name
Fixes#97
- Just uses the header's text as its anchor name. Spaces work. Scrolling to the anchor works even when the anchor is added after the dom loads.
- Adjust theme css to only style links, not <a> tags used as anchors.