From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/mdbook/src/theme/book.js | 17 ++++++--- vendor/mdbook/src/theme/css/chrome.css | 14 +++++--- vendor/mdbook/src/theme/css/general.css | 16 +++++++-- vendor/mdbook/src/theme/css/variables.css | 2 ++ vendor/mdbook/src/theme/index.hbs | 59 +++++++++++++++---------------- vendor/mdbook/src/theme/mod.rs | 2 +- vendor/mdbook/src/theme/redirect.hbs | 4 +-- 7 files changed, 70 insertions(+), 44 deletions(-) (limited to 'vendor/mdbook/src/theme') diff --git a/vendor/mdbook/src/theme/book.js b/vendor/mdbook/src/theme/book.js index d40440c72..e303ebb45 100644 --- a/vendor/mdbook/src/theme/book.js +++ b/vendor/mdbook/src/theme/book.js @@ -4,14 +4,16 @@ window.onunload = function () { }; // Global variable, shared between modules -function playground_text(playground) { +function playground_text(playground, hidden = true) { let code_block = playground.querySelector("code"); if (window.ace && code_block.classList.contains("editable")) { let editor = window.ace.edit(code_block); return editor.getValue(); - } else { + } else if (hidden) { return code_block.textContent; + } else { + return code_block.innerText; } } @@ -166,7 +168,6 @@ function playground_text(playground) { .filter(function (node) {return node.classList.contains("editable"); }) .forEach(function (block) { block.classList.remove('language-rust'); }); - Array code_nodes .filter(function (node) {return !node.classList.contains("editable"); }) .forEach(function (block) { hljs.highlightBlock(block); }); @@ -300,6 +301,13 @@ function playground_text(playground) { themePopup.querySelector("button#" + get_theme()).focus(); } + function updateThemeSelected() { + themePopup.querySelectorAll('.theme-selected').forEach(function (el) { + el.classList.remove('theme-selected'); + }); + themePopup.querySelector("button#" + get_theme()).classList.add('theme-selected'); + } + function hideThemes() { themePopup.style.display = 'none'; themeToggleButton.setAttribute('aria-expanded', false); @@ -355,6 +363,7 @@ function playground_text(playground) { html.classList.remove(previousTheme); html.classList.add(theme); + updateThemeSelected(); } // Set theme @@ -592,7 +601,7 @@ function playground_text(playground) { text: function (trigger) { hideTooltip(trigger); let playground = trigger.closest("pre"); - return playground_text(playground); + return playground_text(playground, false); } }); diff --git a/vendor/mdbook/src/theme/css/chrome.css b/vendor/mdbook/src/theme/css/chrome.css index 10fa4b365..59eae11fd 100644 --- a/vendor/mdbook/src/theme/css/chrome.css +++ b/vendor/mdbook/src/theme/css/chrome.css @@ -507,6 +507,8 @@ ul#searchresults span.teaser em { padding: 0; list-style: none; display: none; + /* Don't let the children's background extend past the rounded corners. */ + overflow: hidden; } .theme-popup .default { color: var(--icons); @@ -515,7 +517,7 @@ ul#searchresults span.teaser em { width: 100%; border: 0; margin: 0; - padding: 2px 10px; + padding: 2px 20px; line-height: 25px; white-space: nowrap; text-align: left; @@ -527,8 +529,10 @@ ul#searchresults span.teaser em { .theme-popup .theme:hover { background-color: var(--theme-hover); } -.theme-popup .theme:hover:first-child, -.theme-popup .theme:hover:last-child { - border-top-left-radius: inherit; - border-top-right-radius: inherit; + +.theme-selected::before { + display: inline-block; + content: "✓"; + margin-left: -14px; + width: 14px; } diff --git a/vendor/mdbook/src/theme/css/general.css b/vendor/mdbook/src/theme/css/general.css index 0e4f07a50..344b53eb7 100644 --- a/vendor/mdbook/src/theme/css/general.css +++ b/vendor/mdbook/src/theme/css/general.css @@ -22,8 +22,8 @@ body { } code { - font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace !important; - font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */ + font-family: var(--mono-font) !important; + font-size: var(--code-font-size); } /* make long words/inline code not x overflow */ @@ -148,6 +148,18 @@ blockquote { border-bottom: .1em solid var(--quote-border); } +kbd { + background-color: var(--table-border-color); + border-radius: 4px; + border: solid 1px var(--theme-popup-border); + box-shadow: inset 0 -1px 0 var(--theme-hover); + display: inline-block; + font-size: var(--code-font-size); + font-family: var(--mono-font); + line-height: 10px; + padding: 4px 5px; + vertical-align: middle; +} :not(.footnote-definition) + .footnote-definition, .footnote-definition + :not(.footnote-definition) { diff --git a/vendor/mdbook/src/theme/css/variables.css b/vendor/mdbook/src/theme/css/variables.css index 56b634bc3..21bf8e55e 100644 --- a/vendor/mdbook/src/theme/css/variables.css +++ b/vendor/mdbook/src/theme/css/variables.css @@ -6,6 +6,8 @@ --page-padding: 15px; --content-max-width: 750px; --menu-bar-height: 50px; + --mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace; + --code-font-size: 0.875em /* please adjust the ace font size accordingly in editor.js */ } /* Themes */ diff --git a/vendor/mdbook/src/theme/index.hbs b/vendor/mdbook/src/theme/index.hbs index 18d984a2b..147eb9af2 100644 --- a/vendor/mdbook/src/theme/index.hbs +++ b/vendor/mdbook/src/theme/index.hbs @@ -15,7 +15,6 @@ {{> head}} - @@ -51,18 +50,18 @@ {{#if mathjax_support}} - + {{/if}} - - - - {{/if}} {{#if playground_copyable}} - {{/if}} {{#if playground_js}} - - - - - + + + + + {{/if}} {{#if search_js}} - - - + + + {{/if}} - - - + + + {{#each additional_js}} - + {{/each}} {{#if is_print}} {{#if mathjax_support}} - {{else}} -