From 5ed3223185807eeb2be88bb51f3ec8391ff8c874 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 24 Jun 2024 14:32:55 -0700 Subject: [PATCH 1/6] Fix broken link to "Smart Punctuation" --- guide/src/format/configuration/renderers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/src/format/configuration/renderers.md b/guide/src/format/configuration/renderers.md index 04d9912b95..5efede6606 100644 --- a/guide/src/format/configuration/renderers.md +++ b/guide/src/format/configuration/renderers.md @@ -123,7 +123,7 @@ The following configuration options are available: [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) CSS media query. Defaults to `navy`. - **smart-punctuation:** Converts quotes to curly quotes, `...` to `…`, `--` to en-dash, and `---` to em-dash. - See [Smart Punctuation]. + See [Smart Punctuation](../markdown.md#smart-punctuation). Defaults to `false`. - **curly-quotes:** Deprecated alias for `smart-punctuation`. - **mathjax-support:** Adds support for [MathJax](../mathjax.md). Defaults to From f1a446fb02df97646fedc51a803e07ae3afa29aa Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 1 Aug 2024 17:42:27 +0200 Subject: [PATCH 2/6] Unify copy to clipboard icon with docs.rs, rustdoc and crates.io --- src/theme/book.js | 8 ++++---- src/theme/css/chrome.css | 24 ++++++++++++++++++++++-- src/theme/css/variables.css | 30 +++++++++++++++++++++++++++++- 3 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/theme/book.js b/src/theme/book.js index aa12e7eccf..18b8f3a4d9 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -225,7 +225,7 @@ function playground_text(playground, hidden = true) { } var clipButton = document.createElement('button'); - clipButton.className = 'fa fa-copy clip-button'; + clipButton.className = 'clip-button'; clipButton.title = 'Copy to clipboard'; clipButton.setAttribute('aria-label', clipButton.title); clipButton.innerHTML = ''; @@ -258,7 +258,7 @@ function playground_text(playground, hidden = true) { if (window.playground_copyable) { var copyCodeClipboardButton = document.createElement('button'); - copyCodeClipboardButton.className = 'fa fa-copy clip-button'; + copyCodeClipboardButton.className = 'clip-button'; copyCodeClipboardButton.innerHTML = ''; copyCodeClipboardButton.title = 'Copy to clipboard'; copyCodeClipboardButton.setAttribute('aria-label', copyCodeClipboardButton.title); @@ -597,12 +597,12 @@ function playground_text(playground, hidden = true) { function hideTooltip(elem) { elem.firstChild.innerText = ""; - elem.className = 'fa fa-copy clip-button'; + elem.className = 'clip-button'; } function showTooltip(elem, msg) { elem.firstChild.innerText = msg; - elem.className = 'fa fa-copy tooltipped'; + elem.className = 'clip-button tooltipped'; } var clipboardSnippets = new ClipboardJS('.clip-button', { diff --git a/src/theme/css/chrome.css b/src/theme/css/chrome.css index 83b7969bce..551fe0c8da 100644 --- a/src/theme/css/chrome.css +++ b/src/theme/css/chrome.css @@ -250,8 +250,8 @@ pre > .buttons i { pre > .buttons button { cursor: inherit; margin: 0px 5px; - padding: 3px 5px; - font-size: 14px; + padding: 4px 4px 3px 5px; + font-size: 23px; border-style: solid; border-width: 1px; @@ -262,6 +262,26 @@ pre > .buttons button { transition-property: color,border-color,background-color; color: var(--icons); } + +pre > .buttons button.clip-button { + padding: 2px 4px 0px 6px; +} +pre > .buttons button.clip-button::before { + /* clipboard */ + content: url('data:image/svg+xml,\ +\ +\ +'); + filter: var(--copy-button-filter); +} +pre > .buttons button.clip-button:hover::before { + filter: var(--copy-button-filter-hover); +} + @media (pointer: coarse) { pre > .buttons button { /* On mobile, make it easier to tap buttons. */ diff --git a/src/theme/css/variables.css b/src/theme/css/variables.css index 0da55e8c9a..afa974eb8d 100644 --- a/src/theme/css/variables.css +++ b/src/theme/css/variables.css @@ -56,6 +56,11 @@ --search-mark-bg: #e3b171; --color-scheme: dark; + + /* Same as `--icons` */ + --copy-button-filter: invert(45%) sepia(6%) saturate(621%) hue-rotate(198deg) brightness(99%) contrast(85%); + /* Same as `--sidebar-active` */ + --copy-button-filter-hover: invert(68%) sepia(55%) saturate(531%) hue-rotate(341deg) brightness(104%) contrast(101%); } .coal { @@ -100,6 +105,11 @@ --search-mark-bg: #355c7d; --color-scheme: dark; + + /* Same as `--icons` */ + --copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%); + /* Same as `--sidebar-active` */ + --copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%); } .light { @@ -144,6 +154,11 @@ --search-mark-bg: #a2cff5; --color-scheme: light; + + /* Same as `--icons` */ + --copy-button-filter: invert(45.49%); + /* Same as `--sidebar-active` */ + --copy-button-filter-hover: invert(14%) sepia(93%) saturate(4250%) hue-rotate(243deg) brightness(99%) contrast(130%); } .navy { @@ -188,6 +203,11 @@ --search-mark-bg: #a2cff5; --color-scheme: dark; + + /* Same as `--icons` */ + --copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%); + /* Same as `--sidebar-active` */ + --copy-button-filter-hover: invert(46%) sepia(20%) saturate(1537%) hue-rotate(156deg) brightness(85%) contrast(90%); } .rust { @@ -231,7 +251,10 @@ --searchresults-li-bg: #dec2a2; --search-mark-bg: #e69f67; - --color-scheme: light; + /* Same as `--icons` */ + --copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%); + /* Same as `--sidebar-active` */ + --copy-button-filter-hover: invert(77%) sepia(16%) saturate(1798%) hue-rotate(328deg) brightness(98%) contrast(83%); } @media (prefers-color-scheme: dark) { @@ -275,5 +298,10 @@ --searchresults-border-color: #98a3ad; --searchresults-li-bg: #2b2b2f; --search-mark-bg: #355c7d; + + /* Same as `--icons` */ + --copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%); + /* Same as `--sidebar-active` */ + --copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%); } } From 94baf19e6ae355b8143b2d3075a5e3dfd21ed63e Mon Sep 17 00:00:00 2001 From: Radek Date: Wed, 7 Aug 2024 12:01:19 +0200 Subject: [PATCH 3/6] added update how to Updating workflow is not clear for non rust users. --- guide/src/guide/installation.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guide/src/guide/installation.md b/guide/src/guide/installation.md index 3fe9e12a9b..0fc03d7dbf 100644 --- a/guide/src/guide/installation.md +++ b/guide/src/guide/installation.md @@ -47,6 +47,18 @@ cargo install --git https://github.com/rust-lang/mdBook.git mdbook Again, make sure to add the Cargo bin directory to your `PATH`. + +### Updating mdbook from source + +```sh +cargo install mdbook +``` + +This will automatically download mdBook from [crates.io], build it, and re-install it in Cargo's global binary directory (`~/.cargo/bin/` by default). + + +## Own modifications and contributing + If you are interested in making modifications to mdBook itself, check out the [Contributing Guide] for more information. [Contributing Guide]: https://github.com/rust-lang/mdBook/blob/master/CONTRIBUTING.md From 59d26dbbe7130cb78b41ec4fbaa033860a86a2dd Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 11 Aug 2024 05:45:26 -0700 Subject: [PATCH 4/6] Move "upgrade mdbook" description to the build-from-source section --- guide/src/guide/installation.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/guide/src/guide/installation.md b/guide/src/guide/installation.md index 0fc03d7dbf..c9ac9505ed 100644 --- a/guide/src/guide/installation.md +++ b/guide/src/guide/installation.md @@ -30,6 +30,9 @@ cargo install mdbook This will automatically download mdBook from [crates.io], build it, and install it in Cargo's global binary directory (`~/.cargo/bin/` by default). +You can run `cargo install mdbook` again whenever you want to update to a new version. +That command will check if there is a newer version, and re-install mdBook if a newer version is found. + To uninstall, run the command `cargo uninstall mdbook`. [Rust installation page]: https://www.rust-lang.org/tools/install @@ -47,16 +50,6 @@ cargo install --git https://github.com/rust-lang/mdBook.git mdbook Again, make sure to add the Cargo bin directory to your `PATH`. - -### Updating mdbook from source - -```sh -cargo install mdbook -``` - -This will automatically download mdBook from [crates.io], build it, and re-install it in Cargo's global binary directory (`~/.cargo/bin/` by default). - - ## Own modifications and contributing If you are interested in making modifications to mdBook itself, check out the [Contributing Guide] for more information. From b51bb101f280ff87fc3271f6536e67e2f2c1cb51 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 11 Aug 2024 05:46:48 -0700 Subject: [PATCH 5/6] Tweak heading wording --- guide/src/guide/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/src/guide/installation.md b/guide/src/guide/installation.md index c9ac9505ed..173b078cd7 100644 --- a/guide/src/guide/installation.md +++ b/guide/src/guide/installation.md @@ -50,7 +50,7 @@ cargo install --git https://github.com/rust-lang/mdBook.git mdbook Again, make sure to add the Cargo bin directory to your `PATH`. -## Own modifications and contributing +## Modifying and contributing If you are interested in making modifications to mdBook itself, check out the [Contributing Guide] for more information. From b3c23c5f8845369de05f265d53d7d15d048b0719 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 11 Aug 2024 16:18:19 +0200 Subject: [PATCH 6/6] Add credits for clipboard image --- src/theme/css/chrome.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/theme/css/chrome.css b/src/theme/css/chrome.css index 551fe0c8da..7a2b343222 100644 --- a/src/theme/css/chrome.css +++ b/src/theme/css/chrome.css @@ -267,7 +267,8 @@ pre > .buttons button.clip-button { padding: 2px 4px 0px 6px; } pre > .buttons button.clip-button::before { - /* clipboard */ + /* clipboard image from octicons (https://github.com/primer/octicons/tree/v2.0.0) MIT license + */ content: url('data:image/svg+xml,\