* Fix: Scroll sidebar to current active section (#1067)
* Clean: Some code related to PR #1052
* Change `scrollIntoViewIfNeeded` with `scrollIntoView`
* Don't use onload event for sidebar scroll to reduce flickering.
Co-authored-by: 李鸿章 <poodll@163.com>
* ui: improve menu folding
Fold/unfold the menu bar just by the amount of scroll, not by its
full width
* refactor: use a variable for the menu bar height
* Fix menu scroll jittering, remove hover folding smoothness
Rewrite it to use `position:` `sticky` and `relative` instead
of continuous programmatic position changes
On-hover folding-unfolding transition removal is a side-effect
This prevents recursive copy-loops when the destination directory
is contained in the source directory.
Now it bails out with a descriptive error message.
Html page title for every chapter in the book is created by the following code:
```rust
let title: String;
{
let book_title = ctx
.data
.get("book_title")
.and_then(serde_json::Value::as_str)
.unwrap_or("");
title = ch.name.clone() + " - " + book_title;
}
```
If the `book.toml` file is missing, and `book_title` parameter is empty, there's an awkward ` - ` string hanging at the end of each chapter's title.
This PR adds a `match` case to handle that kind of situation.
* Using .to_lowercase() on the theme matching to avoid needed exact capitolization in the book.toml
* Changed the default-dark-theme from .to_string() to .to_lowercase() to match theme
This replaces the only use of px for font-sizes by setting up a base
rem size on the root element in a way that is easy to calculate (1 rem =
10px) and scaling up according to browser settings.
* Option to display copy buttons.
- Added field to playpen data structure
- Communicate through window.playpen_copyable
- Javascript updated to check before displaying copy buttons.
* html -> html_config
Also:
- update description of copyable in source code.
- update description of line_numbers (my last PR to this repository)
* Allow underscores in the link type name
* Add some tests for include anchors
* Include parts of Rust files and hide the rest
Fixes#618.
* Increase min supported Rust version to 1.35
* Add a test for a behavior of rustdoc_include I want to depend on
At first I thought this was a bug, but then I looked at some use cases
we have in TRPL and decided this was a feature that I'd like to use.