Skip to content

Commit

Permalink
Merge branch 'need-review-ja' into update-10-03
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuya6502 authored Mar 12, 2022
2 parents 93ccd91 + 04aefa1 commit fe5a57e
Show file tree
Hide file tree
Showing 187 changed files with 9,821 additions and 6,970 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: quay.io/rust-lang-ja/circleci:mdbook-0.3.6-rust-1.41.0
- image: quay.io/rust-lang-ja/circleci:mdbook-0.4.8-rust-1.49.0
parallelism: 1
steps:
- checkout
Expand Down
2 changes: 1 addition & 1 deletion docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This file makes sure that Github Pages doesn't process mdBook's output.
This file makes sure that Github Pages doesn't process mdBook's output.
232 changes: 232 additions & 0 deletions docs/404.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/appendix-00.html

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions docs/appendix-01-keywords.html

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions docs/appendix-02-operators.html

Large diffs are not rendered by default.

48 changes: 33 additions & 15 deletions docs/appendix-03-derivable-traits.html

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions docs/appendix-04-useful-development-tools.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/appendix-05-editions.html

Large diffs are not rendered by default.

62 changes: 51 additions & 11 deletions docs/appendix-06-translation.html

Large diffs are not rendered by default.

50 changes: 34 additions & 16 deletions docs/appendix-07-nightly-rust.html

Large diffs are not rendered by default.

105 changes: 63 additions & 42 deletions docs/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
window.onunload = function () { };

// Global variable, shared between modules
function playpen_text(playpen) {
let code_block = playpen.querySelector("code");
function playground_text(playground) {
let code_block = playground.querySelector("code");

if (window.ace && code_block.classList.contains("editable")) {
let editor = window.ace.edit(code_block);
Expand All @@ -23,8 +23,8 @@ function playpen_text(playpen) {
]);
}

var playpens = Array.from(document.querySelectorAll(".playpen"));
if (playpens.length > 0) {
var playgrounds = Array.from(document.querySelectorAll(".playground"));
if (playgrounds.length > 0) {
fetch_with_timeout("https://play.rust-lang.org/meta/crates", {
headers: {
'Content-Type': "application/json",
Expand All @@ -36,21 +36,21 @@ function playpen_text(playpen) {
.then(response => {
// get list of crates available in the rust playground
let playground_crates = response.crates.map(item => item["id"]);
playpens.forEach(block => handle_crate_list_update(block, playground_crates));
playgrounds.forEach(block => handle_crate_list_update(block, playground_crates));
});
}

function handle_crate_list_update(playpen_block, playground_crates) {
function handle_crate_list_update(playground_block, playground_crates) {
// update the play buttons after receiving the response
update_play_button(playpen_block, playground_crates);
update_play_button(playground_block, playground_crates);

// and install on change listener to dynamically update ACE editors
if (window.ace) {
let code_block = playpen_block.querySelector("code");
let code_block = playground_block.querySelector("code");
if (code_block.classList.contains("editable")) {
let editor = window.ace.edit(code_block);
editor.addEventListener("change", function (e) {
update_play_button(playpen_block, playground_crates);
update_play_button(playground_block, playground_crates);
});
// add Ctrl-Enter command to execute rust code
editor.commands.addCommand({
Expand All @@ -59,7 +59,7 @@ function playpen_text(playpen) {
win: "Ctrl-Enter",
mac: "Ctrl-Enter"
},
exec: _editor => run_rust_code(playpen_block)
exec: _editor => run_rust_code(playground_block)
});
}
}
Expand All @@ -77,7 +77,7 @@ function playpen_text(playpen) {
}

// get list of `extern crate`'s from snippet
var txt = playpen_text(pre_block);
var txt = playground_text(pre_block);
var re = /extern\s+crate\s+([a-zA-Z_0-9]+)\s*;/g;
var snippet_crates = [];
var item;
Expand Down Expand Up @@ -106,7 +106,7 @@ function playpen_text(playpen) {
code_block.append(result_block);
}

let text = playpen_text(code_block);
let text = playground_text(code_block);
let classes = code_block.querySelector('code').classList;
let has_2018 = classes.contains("edition2018");
let edition = has_2018 ? "2018" : "2015";
Expand Down Expand Up @@ -143,6 +143,11 @@ function playpen_text(playpen) {
languages: [], // Languages used for auto-detection
});

let code_nodes = Array
.from(document.querySelectorAll('code'))
// Don't highlight `inline code` blocks in headers.
.filter(function (node) {return !node.parentElement.classList.contains("header"); });

if (window.ace) {
// language-rust class needs to be removed for editable
// blocks or highlightjs will capture events
Expand All @@ -154,16 +159,12 @@ function playpen_text(playpen) {
.from(document.querySelectorAll('code:not(.editable)'))
.forEach(function (block) { hljs.highlightBlock(block); });
} else {
Array
.from(document.querySelectorAll('code'))
.forEach(function (block) { hljs.highlightBlock(block); });
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });
}

// Adding the hljs class gives code blocks the color css
// even if highlighting doesn't apply
Array
.from(document.querySelectorAll('code'))
.forEach(function (block) { block.classList.add('hljs'); });
code_nodes.forEach(function (block) { block.classList.add('hljs'); });

Array.from(document.querySelectorAll("code.language-rust")).forEach(function (block) {

Expand All @@ -174,23 +175,23 @@ function playpen_text(playpen) {

var buttons = document.createElement('div');
buttons.className = 'buttons';
buttons.innerHTML = "<button class=\"fa fa-expand\" title=\"Show hidden lines\" aria-label=\"Show hidden lines\"></button>";
buttons.innerHTML = "<button class=\"fa fa-eye\" title=\"Show hidden lines\" aria-label=\"Show hidden lines\"></button>";

// add expand button
var pre_block = block.parentNode;
pre_block.insertBefore(buttons, pre_block.firstChild);

pre_block.querySelector('.buttons').addEventListener('click', function (e) {
if (e.target.classList.contains('fa-expand')) {
e.target.classList.remove('fa-expand');
e.target.classList.add('fa-compress');
if (e.target.classList.contains('fa-eye')) {
e.target.classList.remove('fa-eye');
e.target.classList.add('fa-eye-slash');
e.target.title = 'Hide lines';
e.target.setAttribute('aria-label', e.target.title);

block.classList.remove('hide-boring');
} else if (e.target.classList.contains('fa-compress')) {
e.target.classList.remove('fa-compress');
e.target.classList.add('fa-expand');
} else if (e.target.classList.contains('fa-eye-slash')) {
e.target.classList.remove('fa-eye-slash');
e.target.classList.add('fa-eye');
e.target.title = 'Show hidden lines';
e.target.setAttribute('aria-label', e.target.title);

Expand All @@ -199,10 +200,10 @@ function playpen_text(playpen) {
});
});

if (window.playpen_copyable) {
if (window.playground_copyable) {
Array.from(document.querySelectorAll('pre code')).forEach(function (block) {
var pre_block = block.parentNode;
if (!pre_block.classList.contains('playpen')) {
if (!pre_block.classList.contains('playground')) {
var buttons = pre_block.querySelector(".buttons");
if (!buttons) {
buttons = document.createElement('div');
Expand All @@ -221,8 +222,8 @@ function playpen_text(playpen) {
});
}

// Process playpen code blocks
Array.from(document.querySelectorAll(".playpen")).forEach(function (pre_block) {
// Process playground code blocks
Array.from(document.querySelectorAll(".playground")).forEach(function (pre_block) {
// Add play button
var buttons = pre_block.querySelector(".buttons");
if (!buttons) {
Expand All @@ -242,7 +243,7 @@ function playpen_text(playpen) {
run_rust_code(pre_block);
});

if (window.playpen_copyable) {
if (window.playground_copyable) {
var copyCodeClipboardButton = document.createElement('button');
copyCodeClipboardButton.className = 'fa fa-copy clip-button';
copyCodeClipboardButton.innerHTML = '<i class="tooltiptext"></i>';
Expand Down Expand Up @@ -284,7 +285,7 @@ function playpen_text(playpen) {
function showThemes() {
themePopup.style.display = 'block';
themeToggleButton.setAttribute('aria-expanded', true);
themePopup.querySelector("button#" + document.body.className).focus();
themePopup.querySelector("button#" + get_theme()).focus();
}

function hideThemes() {
Expand All @@ -293,6 +294,16 @@ function playpen_text(playpen) {
themeToggleButton.focus();
}

function get_theme() {
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch (e) { }
if (theme === null || theme === undefined) {
return default_theme;
} else {
return theme;
}
}

function set_theme(theme, store = true) {
let ace_theme;

Expand Down Expand Up @@ -324,9 +335,7 @@ function playpen_text(playpen) {
});
}

var previousTheme;
try { previousTheme = localStorage.getItem('mdbook-theme'); } catch (e) { }
if (previousTheme === null || previousTheme === undefined) { previousTheme = default_theme; }
var previousTheme = get_theme();

if (store) {
try { localStorage.setItem('mdbook-theme', theme); } catch (e) { }
Expand All @@ -337,9 +346,7 @@ function playpen_text(playpen) {
}

// Set theme
var theme;
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
if (theme === null || theme === undefined) { theme = default_theme; }
var theme = get_theme();

set_theme(theme, false);

Expand Down Expand Up @@ -408,7 +415,6 @@ function playpen_text(playpen) {
(function sidebar() {
var html = document.querySelector("html");
var sidebar = document.getElementById("sidebar");
var sidebarScrollBox = document.querySelector(".sidebar-scrollbox");
var sidebarLinks = document.querySelectorAll('#sidebar a');
var sidebarToggleButton = document.getElementById("sidebar-toggle");
var sidebarResizeHandle = document.getElementById("sidebar-resize-handle");
Expand Down Expand Up @@ -450,6 +456,11 @@ function playpen_text(playpen) {
// Toggle sidebar
sidebarToggleButton.addEventListener('click', function sidebarToggle() {
if (html.classList.contains("sidebar-hidden")) {
var current_width = parseInt(
document.documentElement.style.getPropertyValue('--sidebar-width'), 10);
if (current_width < 150) {
document.documentElement.style.setProperty('--sidebar-width', '150px');
}
showSidebar();
} else if (html.classList.contains("sidebar-visible")) {
hideSidebar();
Expand All @@ -470,7 +481,16 @@ function playpen_text(playpen) {
html.classList.add('sidebar-resizing');
}
function resize(e) {
document.documentElement.style.setProperty('--sidebar-width', (e.clientX - sidebar.offsetLeft) + 'px');
var pos = (e.clientX - sidebar.offsetLeft);
if (pos < 20) {
hideSidebar();
} else {
if (html.classList.contains("sidebar-hidden")) {
showSidebar();
}
pos = Math.min(pos, window.innerWidth - 100);
document.documentElement.style.setProperty('--sidebar-width', pos + 'px');
}
}
//on mouseup remove windows functions mousemove & mouseup
function stopResize(e) {
Expand Down Expand Up @@ -507,7 +527,8 @@ function playpen_text(playpen) {
// Scroll sidebar to current active section
var activeSection = document.getElementById("sidebar").querySelector(".active");
if (activeSection) {
sidebarScrollBox.scrollTop = activeSection.offsetTop;
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
activeSection.scrollIntoView({ block: 'center' });
}
})();

Expand Down Expand Up @@ -551,8 +572,8 @@ function playpen_text(playpen) {
var clipboardSnippets = new ClipboardJS('.clip-button', {
text: function (trigger) {
hideTooltip(trigger);
let playpen = trigger.closest("pre");
return playpen_text(playpen);
let playground = trigger.closest("pre");
return playground_text(playground);
}
});

Expand Down
158 changes: 96 additions & 62 deletions docs/ch00-00-introduction.html

Large diffs are not rendered by default.

40 changes: 29 additions & 11 deletions docs/ch01-00-getting-started.html

Large diffs are not rendered by default.

178 changes: 91 additions & 87 deletions docs/ch01-01-installation.html

Large diffs are not rendered by default.

58 changes: 38 additions & 20 deletions docs/ch01-02-hello-world.html

Large diffs are not rendered by default.

62 changes: 39 additions & 23 deletions docs/ch01-03-hello-cargo.html

Large diffs are not rendered by default.

117 changes: 62 additions & 55 deletions docs/ch02-00-guessing-game-tutorial.html

Large diffs are not rendered by default.

38 changes: 28 additions & 10 deletions docs/ch03-00-common-programming-concepts.html

Large diffs are not rendered by default.

57 changes: 37 additions & 20 deletions docs/ch03-01-variables-and-mutability.html

Large diffs are not rendered by default.

90 changes: 54 additions & 36 deletions docs/ch03-02-data-types.html

Large diffs are not rendered by default.

115 changes: 81 additions & 34 deletions docs/ch03-03-how-functions-work.html

Large diffs are not rendered by default.

48 changes: 33 additions & 15 deletions docs/ch03-04-comments.html

Large diffs are not rendered by default.

70 changes: 44 additions & 26 deletions docs/ch03-05-control-flow.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch04-00-understanding-ownership.html

Large diffs are not rendered by default.

98 changes: 58 additions & 40 deletions docs/ch04-01-what-is-ownership.html

Large diffs are not rendered by default.

93 changes: 61 additions & 32 deletions docs/ch04-02-references-and-borrowing.html

Large diffs are not rendered by default.

380 changes: 207 additions & 173 deletions docs/ch04-03-slices.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch05-00-structs.html

Large diffs are not rendered by default.

78 changes: 48 additions & 30 deletions docs/ch05-01-defining-structs.html

Large diffs are not rendered by default.

76 changes: 47 additions & 29 deletions docs/ch05-02-example-structs.html

Large diffs are not rendered by default.

72 changes: 45 additions & 27 deletions docs/ch05-03-method-syntax.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch06-00-enums.html

Large diffs are not rendered by default.

92 changes: 55 additions & 37 deletions docs/ch06-01-defining-an-enum.html

Large diffs are not rendered by default.

68 changes: 43 additions & 25 deletions docs/ch06-02-match.html

Large diffs are not rendered by default.

54 changes: 36 additions & 18 deletions docs/ch06-03-if-let.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch07-01-packages-and-crates.html

Large diffs are not rendered by default.

38 changes: 28 additions & 10 deletions docs/ch07-02-defining-modules-to-control-scope-and-privacy.html

Large diffs are not rendered by default.

54 changes: 36 additions & 18 deletions docs/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html

Large diffs are not rendered by default.

82 changes: 50 additions & 32 deletions docs/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html

Large diffs are not rendered by default.

42 changes: 30 additions & 12 deletions docs/ch07-05-separating-modules-into-different-files.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch08-00-common-collections.html

Large diffs are not rendered by default.

451 changes: 235 additions & 216 deletions docs/ch08-01-vectors.html

Large diffs are not rendered by default.

120 changes: 69 additions & 51 deletions docs/ch08-02-strings.html

Large diffs are not rendered by default.

88 changes: 53 additions & 35 deletions docs/ch08-03-hash-maps.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch09-00-error-handling.html

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions docs/ch09-01-unrecoverable-errors-with-panic.html

Large diffs are not rendered by default.

72 changes: 45 additions & 27 deletions docs/ch09-02-recoverable-errors-with-result.html

Large diffs are not rendered by default.

54 changes: 36 additions & 18 deletions docs/ch09-03-to-panic-or-not-to-panic.html

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions docs/ch10-00-generics.html

Large diffs are not rendered by default.

74 changes: 46 additions & 28 deletions docs/ch10-01-syntax.html

Large diffs are not rendered by default.

86 changes: 52 additions & 34 deletions docs/ch10-02-traits.html

Large diffs are not rendered by default.

254 changes: 137 additions & 117 deletions docs/ch10-03-lifetime-syntax.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch11-00-testing.html

Large diffs are not rendered by default.

86 changes: 52 additions & 34 deletions docs/ch11-01-writing-tests.html

Large diffs are not rendered by default.

60 changes: 39 additions & 21 deletions docs/ch11-02-running-tests.html

Large diffs are not rendered by default.

71 changes: 43 additions & 28 deletions docs/ch11-03-test-organization.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch12-00-an-io-project.html

Large diffs are not rendered by default.

46 changes: 32 additions & 14 deletions docs/ch12-01-accepting-command-line-arguments.html

Large diffs are not rendered by default.

40 changes: 29 additions & 11 deletions docs/ch12-02-reading-a-file.html

Large diffs are not rendered by default.

70 changes: 44 additions & 26 deletions docs/ch12-03-improving-error-handling-and-modularity.html

Large diffs are not rendered by default.

62 changes: 40 additions & 22 deletions docs/ch12-04-testing-the-librarys-functionality.html

Large diffs are not rendered by default.

60 changes: 39 additions & 21 deletions docs/ch12-05-working-with-environment-variables.html

Large diffs are not rendered by default.

42 changes: 30 additions & 12 deletions docs/ch12-06-writing-to-stderr-instead-of-stdout.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch13-00-functional-features.html

Large diffs are not rendered by default.

90 changes: 54 additions & 36 deletions docs/ch13-01-closures.html

Large diffs are not rendered by default.

98 changes: 58 additions & 40 deletions docs/ch13-02-iterators.html

Large diffs are not rendered by default.

46 changes: 32 additions & 14 deletions docs/ch13-03-improving-our-io-project.html

Large diffs are not rendered by default.

40 changes: 29 additions & 11 deletions docs/ch13-04-performance.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch14-00-more-about-cargo.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch14-01-release-profiles.html

Large diffs are not rendered by default.

56 changes: 37 additions & 19 deletions docs/ch14-02-publishing-to-crates-io.html

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions docs/ch14-03-cargo-workspaces.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch14-04-installing-binaries.html

Large diffs are not rendered by default.

38 changes: 28 additions & 10 deletions docs/ch14-05-extending-cargo.html

Large diffs are not rendered by default.

68 changes: 42 additions & 26 deletions docs/ch15-00-smart-pointers.html

Large diffs are not rendered by default.

182 changes: 96 additions & 86 deletions docs/ch15-01-box.html

Large diffs are not rendered by default.

171 changes: 91 additions & 80 deletions docs/ch15-02-deref.html

Large diffs are not rendered by default.

42 changes: 30 additions & 12 deletions docs/ch15-03-drop.html

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions docs/ch15-04-rc.html

Large diffs are not rendered by default.

60 changes: 39 additions & 21 deletions docs/ch15-05-interior-mutability.html

Large diffs are not rendered by default.

66 changes: 42 additions & 24 deletions docs/ch15-06-reference-cycles.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch16-00-concurrency.html

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions docs/ch16-01-threads.html

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions docs/ch16-02-message-passing.html

Large diffs are not rendered by default.

56 changes: 37 additions & 19 deletions docs/ch16-03-shared-state.html

Large diffs are not rendered by default.

44 changes: 31 additions & 13 deletions docs/ch16-04-extensible-concurrency-sync-and-send.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch17-00-oop.html

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions docs/ch17-01-what-is-oo.html

Large diffs are not rendered by default.

74 changes: 46 additions & 28 deletions docs/ch17-02-trait-objects.html

Large diffs are not rendered by default.

90 changes: 54 additions & 36 deletions docs/ch17-03-oo-design-patterns.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch18-00-patterns.html

Large diffs are not rendered by default.

74 changes: 46 additions & 28 deletions docs/ch18-01-all-the-places-for-patterns.html

Large diffs are not rendered by default.

40 changes: 29 additions & 11 deletions docs/ch18-02-refutability.html

Large diffs are not rendered by default.

150 changes: 84 additions & 66 deletions docs/ch18-03-pattern-syntax.html

Large diffs are not rendered by default.

48 changes: 33 additions & 15 deletions docs/ch19-00-advanced-features.html

Large diffs are not rendered by default.

98 changes: 58 additions & 40 deletions docs/ch19-01-unsafe-rust.html

Large diffs are not rendered by default.

94 changes: 56 additions & 38 deletions docs/ch19-03-advanced-traits.html

Large diffs are not rendered by default.

86 changes: 52 additions & 34 deletions docs/ch19-04-advanced-types.html

Large diffs are not rendered by default.

74 changes: 38 additions & 36 deletions docs/ch19-05-advanced-functions-and-closures.html

Large diffs are not rendered by default.

851 changes: 509 additions & 342 deletions docs/ch19-06-macros.html

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions docs/ch20-00-final-project-a-web-server.html

Large diffs are not rendered by default.

76 changes: 47 additions & 29 deletions docs/ch20-01-single-threaded.html

Large diffs are not rendered by default.

98 changes: 58 additions & 40 deletions docs/ch20-02-multithreaded.html

Large diffs are not rendered by default.

54 changes: 36 additions & 18 deletions docs/ch20-03-graceful-shutdown-and-cleanup.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/chrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ a > .hljs {
.menu-title {
display: inline-block;
font-weight: 200;
font-size: 2rem;
font-size: 2.4rem;
line-height: var(--menu-bar-height);
text-align: center;
margin: 0;
Expand Down Expand Up @@ -423,7 +423,7 @@ ul#searchresults span.teaser em {
display: none;
}

.chapter li.expanded {
.chapter li.chapter-item {
line-height: 1.5em;
margin-top: 0.6em;
}
Expand Down
32 changes: 23 additions & 9 deletions docs/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ code {
font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */
}

/* Don't change font size in headers. */
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
font-size: unset;
}

.left { float: left; }
.right { float: right; }
.boring { opacity: 0.6; }
.hide-boring .boring { display: none; }
.hidden { display: none; }
.hidden { display: none !important; }

h2, h3 { margin-top: 2.5em; }
h4, h5 { margin-top: 2em; }
Expand All @@ -40,20 +45,23 @@ h4, h5 { margin-top: 2em; }
margin-top: 1em;
}

h1 a.header:target::before,
h2 a.header:target::before,
h3 a.header:target::before,
h4 a.header:target::before {
h1:target::before,
h2:target::before,
h3:target::before,
h4:target::before,
h5:target::before,
h6:target::before {
display: inline-block;
content: "»";
margin-left: -30px;
width: 30px;
}

h1 a.header:target,
h2 a.header:target,
h3 a.header:target,
h4 a.header:target {
/* This is broken on Safari as of version 14, but is fixed
in Safari Technology Preview 117 which I think will be Safari 14.2.
https://bugs.webkit.org/show_bug.cgi?id=218076
*/
:target {
scroll-margin-top: calc(var(--menu-bar-height) + 0.5em);
}

Expand Down Expand Up @@ -161,3 +169,9 @@ blockquote {
.tooltipped .tooltiptext {
visibility: visible;
}

.chapter li.part-title {
color: var(--sidebar-fg);
margin: 5px 0px;
font-weight: bold;
}
16 changes: 8 additions & 8 deletions docs/css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,22 @@

.light {
--bg: hsl(0, 0%, 100%);
--fg: #333333;
--fg: hsl(0, 0%, 0%);

--sidebar-bg: #fafafa;
--sidebar-fg: #364149;
--sidebar-fg: hsl(0, 0%, 0%);
--sidebar-non-existant: #aaaaaa;
--sidebar-active: #008cff;
--sidebar-active: #1f1fff;
--sidebar-spacer: #f4f4f4;

--scrollbar: #cccccc;
--scrollbar: #8F8F8F;

--icons: #cccccc;
--icons-hover: #333333;
--icons: #747474;
--icons-hover: #000000;

--links: #4183c4;
--links: #20609f;

--inline-code-color: #6e6b5e;
--inline-code-color: #301900;

--theme-popup-bg: #fafafa;
--theme-popup-border: #cccccc;
Expand Down
Loading

0 comments on commit fe5a57e

Please sign in to comment.