1
Fork 0

Update documentation about themes

This commit is contained in:
Guillaume Gomez 2022-05-11 23:18:46 +02:00
parent 44e5b3bf3e
commit dee294759b
2 changed files with 10 additions and 12 deletions

View file

@ -59,15 +59,8 @@ or the current item whose documentation is being displayed.
## The Theme Picker and Search Interface ## The Theme Picker and Search Interface
When viewing `rustdoc`'s output in a browser with JavaScript enabled, When viewing `rustdoc`'s output in a browser with JavaScript enabled,
a dynamic interface appears at the top of the page. a dynamic interface appears at the top of the page composed of the search
To the left is the theme picker, denoted with a paint-brush icon, interface, help screen, and options.
and the search interface, help screen, and options appear to the right of that.
### The Theme Picker
Clicking on the theme picker provides a list of themes -
by default `ayu`, `light`, and `dark` -
which are available for viewing.
### The Search Interface ### The Search Interface
@ -91,12 +84,16 @@ When typing in the search bar, you can prefix your search term with a type
followed by a colon (such as `mod:`) to restrict the results to just that followed by a colon (such as `mod:`) to restrict the results to just that
kind of item. (The available items are listed in the help popup.) kind of item. (The available items are listed in the help popup.)
### Changing displayed theme
You can change the displayed theme by opening the settings menu (the gear
icon in the upper right) and then pick a new one from there.
### Shortcuts ### Shortcuts
Pressing `S` while focused elsewhere on the page will move focus to the Pressing `S` while focused elsewhere on the page will move focus to the
search bar, and pressing `?` shows the help screen, search bar, and pressing `?` shows the help screen,
which includes all these shortcuts and more. which includes all these shortcuts and more.
Pressing `T` focuses the theme picker.
When the search results are focused, When the search results are focused,
the left and right arrows move between tabs and the up and down arrows move the left and right arrows move between tabs and the up and down arrows move

View file

@ -109,8 +109,9 @@ rustdoc --extend-css custom.css src/lib.rs
A good example of using this feature to create a dark theme is documented [on A good example of using this feature to create a dark theme is documented [on
this blog]. Just remember, dark theme is already included in the rustdoc output this blog]. Just remember, dark theme is already included in the rustdoc output
by clicking on the paintbrush. Adding additional options to the themes are by clicking on the gear icon in the upper right. Adding additional options to the
as easy as creating a custom theme `.css` file and using the following syntax: themes are as easy as creating a custom theme `.css` file and using the following
syntax:
```bash ```bash
rustdoc --theme awesome.css src/lib.rs rustdoc --theme awesome.css src/lib.rs