Skip to content

Commit 2b69693

Browse files
committed
Merge branch 'master' into chore/upgrade-pulldown-cmark
2 parents be4df60 + 5194d2b commit 2b69693

File tree

5 files changed

+62
-8
lines changed

5 files changed

+62
-8
lines changed

guide/src/format/configuration/renderers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ The following configuration options are available:
123123
[`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
124124
CSS media query. Defaults to `navy`.
125125
- **smart-punctuation:** Converts quotes to curly quotes, `...` to ``, `--` to en-dash, and `---` to em-dash.
126-
See [Smart Punctuation].
126+
See [Smart Punctuation](../markdown.md#smart-punctuation).
127127
Defaults to `false`.
128128
- **curly-quotes:** Deprecated alias for `smart-punctuation`.
129129
- **mathjax-support:** Adds support for [MathJax](../mathjax.md). Defaults to

guide/src/guide/installation.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ cargo install mdbook
3030

3131
This will automatically download mdBook from [crates.io], build it, and install it in Cargo's global binary directory (`~/.cargo/bin/` by default).
3232

33+
You can run `cargo install mdbook` again whenever you want to update to a new version.
34+
That command will check if there is a newer version, and re-install mdBook if a newer version is found.
35+
3336
To uninstall, run the command `cargo uninstall mdbook`.
3437

3538
[Rust installation page]: https://www.rust-lang.org/tools/install
@@ -47,6 +50,8 @@ cargo install --git https://github.com/rust-lang/mdBook.git mdbook
4750

4851
Again, make sure to add the Cargo bin directory to your `PATH`.
4952

53+
## Modifying and contributing
54+
5055
If you are interested in making modifications to mdBook itself, check out the [Contributing Guide] for more information.
5156

5257
[Contributing Guide]: https://github.com/rust-lang/mdBook/blob/master/CONTRIBUTING.md

src/theme/book.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ function playground_text(playground, hidden = true) {
225225
}
226226

227227
var clipButton = document.createElement('button');
228-
clipButton.className = 'fa fa-copy clip-button';
228+
clipButton.className = 'clip-button';
229229
clipButton.title = 'Copy to clipboard';
230230
clipButton.setAttribute('aria-label', clipButton.title);
231231
clipButton.innerHTML = '<i class=\"tooltiptext\"></i>';
@@ -258,7 +258,7 @@ function playground_text(playground, hidden = true) {
258258

259259
if (window.playground_copyable) {
260260
var copyCodeClipboardButton = document.createElement('button');
261-
copyCodeClipboardButton.className = 'fa fa-copy clip-button';
261+
copyCodeClipboardButton.className = 'clip-button';
262262
copyCodeClipboardButton.innerHTML = '<i class="tooltiptext"></i>';
263263
copyCodeClipboardButton.title = 'Copy to clipboard';
264264
copyCodeClipboardButton.setAttribute('aria-label', copyCodeClipboardButton.title);
@@ -597,12 +597,12 @@ function playground_text(playground, hidden = true) {
597597

598598
function hideTooltip(elem) {
599599
elem.firstChild.innerText = "";
600-
elem.className = 'fa fa-copy clip-button';
600+
elem.className = 'clip-button';
601601
}
602602

603603
function showTooltip(elem, msg) {
604604
elem.firstChild.innerText = msg;
605-
elem.className = 'fa fa-copy tooltipped';
605+
elem.className = 'clip-button tooltipped';
606606
}
607607

608608
var clipboardSnippets = new ClipboardJS('.clip-button', {

src/theme/css/chrome.css

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ pre > .buttons i {
250250
pre > .buttons button {
251251
cursor: inherit;
252252
margin: 0px 5px;
253-
padding: 3px 5px;
254-
font-size: 14px;
253+
padding: 4px 4px 3px 5px;
254+
font-size: 23px;
255255

256256
border-style: solid;
257257
border-width: 1px;
@@ -262,6 +262,27 @@ pre > .buttons button {
262262
transition-property: color,border-color,background-color;
263263
color: var(--icons);
264264
}
265+
266+
pre > .buttons button.clip-button {
267+
padding: 2px 4px 0px 6px;
268+
}
269+
pre > .buttons button.clip-button::before {
270+
/* clipboard image from octicons (https://github.com/primer/octicons/tree/v2.0.0) MIT license
271+
*/
272+
content: url('data:image/svg+xml,<svg width="21" height="20" viewBox="0 0 24 25" \
273+
xmlns="http://www.w3.org/2000/svg" aria-label="Copy to clipboard">\
274+
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 \
275+
0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 \
276+
7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 \
277+
2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"/>\
278+
<path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"/>\
279+
</svg>');
280+
filter: var(--copy-button-filter);
281+
}
282+
pre > .buttons button.clip-button:hover::before {
283+
filter: var(--copy-button-filter-hover);
284+
}
285+
265286
@media (pointer: coarse) {
266287
pre > .buttons button {
267288
/* On mobile, make it easier to tap buttons. */

src/theme/css/variables.css

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
--search-mark-bg: #e3b171;
5757

5858
--color-scheme: dark;
59+
60+
/* Same as `--icons` */
61+
--copy-button-filter: invert(45%) sepia(6%) saturate(621%) hue-rotate(198deg) brightness(99%) contrast(85%);
62+
/* Same as `--sidebar-active` */
63+
--copy-button-filter-hover: invert(68%) sepia(55%) saturate(531%) hue-rotate(341deg) brightness(104%) contrast(101%);
5964
}
6065

6166
.coal {
@@ -100,6 +105,11 @@
100105
--search-mark-bg: #355c7d;
101106

102107
--color-scheme: dark;
108+
109+
/* Same as `--icons` */
110+
--copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%);
111+
/* Same as `--sidebar-active` */
112+
--copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%);
103113
}
104114

105115
.light {
@@ -144,6 +154,11 @@
144154
--search-mark-bg: #a2cff5;
145155

146156
--color-scheme: light;
157+
158+
/* Same as `--icons` */
159+
--copy-button-filter: invert(45.49%);
160+
/* Same as `--sidebar-active` */
161+
--copy-button-filter-hover: invert(14%) sepia(93%) saturate(4250%) hue-rotate(243deg) brightness(99%) contrast(130%);
147162
}
148163

149164
.navy {
@@ -188,6 +203,11 @@
188203
--search-mark-bg: #a2cff5;
189204

190205
--color-scheme: dark;
206+
207+
/* Same as `--icons` */
208+
--copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%);
209+
/* Same as `--sidebar-active` */
210+
--copy-button-filter-hover: invert(46%) sepia(20%) saturate(1537%) hue-rotate(156deg) brightness(85%) contrast(90%);
191211
}
192212

193213
.rust {
@@ -231,7 +251,10 @@
231251
--searchresults-li-bg: #dec2a2;
232252
--search-mark-bg: #e69f67;
233253

234-
--color-scheme: light;
254+
/* Same as `--icons` */
255+
--copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%);
256+
/* Same as `--sidebar-active` */
257+
--copy-button-filter-hover: invert(77%) sepia(16%) saturate(1798%) hue-rotate(328deg) brightness(98%) contrast(83%);
235258
}
236259

237260
@media (prefers-color-scheme: dark) {
@@ -275,5 +298,10 @@
275298
--searchresults-border-color: #98a3ad;
276299
--searchresults-li-bg: #2b2b2f;
277300
--search-mark-bg: #355c7d;
301+
302+
/* Same as `--icons` */
303+
--copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%);
304+
/* Same as `--sidebar-active` */
305+
--copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%);
278306
}
279307
}

0 commit comments

Comments
 (0)