Skip to content

Commit

Permalink
Merge branch 'master' into feature/links_preprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
blandger committed Jul 2, 2023
2 parents a3dfc84 + 91e3408 commit 7e5accc
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 15 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## mdBook 0.4.31
[v0.4.30...v0.4.31](https://github.com/rust-lang/mdBook/compare/v0.4.30...v0.4.31)

### Fixed
- Fixed menu border render flash during page navigation.
[#2101](https://github.com/rust-lang/mdBook/pull/2101)
- Fixed flicker setting sidebar scroll position.
[#2104](https://github.com/rust-lang/mdBook/pull/2104)
- Fixed compile error with proc-macro2 on latest Rust nightly.
[#2109](https://github.com/rust-lang/mdBook/pull/2109)

## mdBook 0.4.30
[v0.4.29...v0.4.30](https://github.com/rust-lang/mdBook/compare/v0.4.29...v0.4.30)

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mdbook"
version = "0.4.30"
version = "0.4.31"
authors = [
"Mathieu David <mathieudavid@mathieudavid.org>",
"Michael-F-Bryan <michaelfbryan@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion guide/src/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A simple approach would be to use the popular `curl` CLI tool to download the ex

```sh
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.30/mdbook-v0.4.30-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.31/mdbook-v0.4.31-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
bin/mdbook build
```

Expand Down
2 changes: 1 addition & 1 deletion guide/src/format/configuration/preprocessors.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ For example, if you have a preprocessor called `mdbook-example`, then you can in
With this table, mdBook will execute the `mdbook-example` preprocessor.

This table can include additional key-value pairs that are specific to the preprocessor.
For example, if our example prepocessor needed some extra configuration options:
For example, if our example preprocessor needed some extra configuration options:

```toml
[preprocessor.example]
Expand Down
4 changes: 2 additions & 2 deletions guide/src/format/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mdBook has several extensions beyond the standard CommonMark specification.
### Strikethrough

Text may be rendered with a horizontal line through the center by wrapping the
text with two tilde characters on each side:
text with one or two tilde characters on each side:

```text
An example of ~~strikethrough text~~.
Expand Down Expand Up @@ -223,7 +223,7 @@ To enable it, see the [`output.html.curly-quotes`] config option.

### Heading attributes

Headings can have a custom HTML ID and classes. This let's you maintain the same ID even if you change the heading's text, it also let's you add multiple classes in the heading.
Headings can have a custom HTML ID and classes. This lets you maintain the same ID even if you change the heading's text, it also lets you add multiple classes in the heading.

Example:
```md
Expand Down
7 changes: 0 additions & 7 deletions src/theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,6 @@ function playground_text(playground, hidden = true) {
firstContact = null;
}
}, { passive: true });

// Scroll sidebar to current active section
var activeSection = document.getElementById("sidebar").querySelector(".active");
if (activeSection) {
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
activeSection.scrollIntoView({ block: 'center' });
}
})();

(function chapterNavigation() {
Expand Down
22 changes: 22 additions & 0 deletions src/theme/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
</nav>

<!-- Track and set sidebar scroll position -->
<script>
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
</script>

<div id="page-wrapper" class="page-wrapper">

<div class="page">
Expand Down
2 changes: 2 additions & 0 deletions test_book/src/individual/strikethrough.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Strikethrough

~Single strike~

~~This is Striked~~

~~This is **strong**, _italic_ , **_both_** and striked~~

0 comments on commit 7e5accc

Please sign in to comment.