From e46f577e321b025e5a0ab49da47b24f27cbff67f Mon Sep 17 00:00:00 2001 From: ctron Date: Tue, 4 Mar 2025 13:23:32 +0000 Subject: [PATCH] deploy: 042bed7518780934a27cd737aa66cb4b613fbe4c --- guide/advanced/javascript_interop.html | 2 +- guide/book.js | 13 ++++--------- guide/css/chrome.css | 7 +++++-- guide/css/general.css | 6 ++++-- guide/css/variables.css | 2 +- guide/mdbook-admonish.css | 3 +++ guide/print.html | 2 +- guide/toc.js | 2 +- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/guide/advanced/javascript_interop.html b/guide/advanced/javascript_interop.html index 931fc838..a373e666 100644 --- a/guide/advanced/javascript_interop.html +++ b/guide/advanced/javascript_interop.html @@ -165,7 +165,7 @@

rust asset type.

+see the rust asset type.

Order of initialization

The bindings will only be available and working when the application initialization has been completed.

If your WebAssembly application renders code into the web page/DOM tree, which then calls from JavaScript into the diff --git a/guide/book.js b/guide/book.js index 178f1e90..a5c25550 100644 --- a/guide/book.js +++ b/guide/book.js @@ -449,6 +449,7 @@ function playground_text(playground, hidden = true) { var sidebar = document.getElementById("sidebar"); var sidebarLinks = document.querySelectorAll('#sidebar a'); var sidebarToggleButton = document.getElementById("sidebar-toggle"); + var sidebarToggleAnchor = document.getElementById("sidebar-toggle-anchor"); var sidebarResizeHandle = document.getElementById("sidebar-resize-handle"); var firstContact = null; @@ -475,22 +476,16 @@ function playground_text(playground, hidden = true) { } // Toggle sidebar - sidebarToggleButton.addEventListener('click', function sidebarToggle() { - if (body.classList.contains("sidebar-hidden")) { + sidebarToggleAnchor.addEventListener('change', function sidebarToggle() { + if (sidebarToggleAnchor.checked) { 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 (body.classList.contains("sidebar-visible")) { - hideSidebar(); } else { - if (getComputedStyle(sidebar)['transform'] === 'none') { - hideSidebar(); - } else { - showSidebar(); - } + hideSidebar(); } }); diff --git a/guide/css/chrome.css b/guide/css/chrome.css index 4cd73086..7a95c244 100644 --- a/guide/css/chrome.css +++ b/guide/css/chrome.css @@ -421,11 +421,14 @@ ul#searchresults span.teaser em { color: var(--sidebar-fg); } .sidebar-iframe-inner { + --padding: 10px; + background-color: var(--sidebar-bg); - color: var(--sidebar-fg); - padding: 10px 10px; + padding: var(--padding); margin: 0; font-size: 1.4rem; + color: var(--sidebar-fg); + min-height: calc(100vh - var(--padding) * 2); } .sidebar-iframe-outer { border: none; diff --git a/guide/css/general.css b/guide/css/general.css index 0862b516..49e72673 100644 --- a/guide/css/general.css +++ b/guide/css/general.css @@ -200,10 +200,12 @@ sup { line-height: 0; } -:not(.footnote-definition) + .footnote-definition, -.footnote-definition + :not(.footnote-definition) { +:not(.footnote-definition) + .footnote-definition { margin-block-start: 2em; } +.footnote-definition:not(:has(+ .footnote-definition)) { + margin-block-end: 2em; +} .footnote-definition { font-size: 0.9em; margin: 0.5em 0; diff --git a/guide/css/variables.css b/guide/css/variables.css index 12d1db7a..57977155 100644 --- a/guide/css/variables.css +++ b/guide/css/variables.css @@ -9,7 +9,7 @@ --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 */ + --code-font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */ } /* Themes */ diff --git a/guide/mdbook-admonish.css b/guide/mdbook-admonish.css index 45aeff05..88dd2b15 100644 --- a/guide/mdbook-admonish.css +++ b/guide/mdbook-admonish.css @@ -106,6 +106,9 @@ details.admonition > summary.admonition-title::after { details[open].admonition > summary.admonition-title::after { transform: rotate(90deg); } +summary.admonition-title::-webkit-details-marker { + display: none; +} :root { --md-details-icon: url("data:image/svg+xml;charset=utf-8,"); diff --git a/guide/print.html b/guide/print.html index 598ca3db..3fca4338 100644 --- a/guide/print.html +++ b/guide/print.html @@ -677,7 +677,7 @@

Directives

include all JavaScript snippets generated by wasm-bindgen for interfacing with JavaScript functionality.

By default, functions exported from Rust, using wasm-bingen, can be accessed in the JavaScript code through the global variable window.wasmBindings. This behavior can be disabled, and the name can be customized. For more information -see the rust asset type.

+see the rust asset type.

Order of initialization

The bindings will only be available and working when the application initialization has been completed.

If your WebAssembly application renders code into the web page/DOM tree, which then calls from JavaScript into the diff --git a/guide/toc.js b/guide/toc.js index 99539dd9..131ee920 100644 --- a/guide/toc.js +++ b/guide/toc.js @@ -10,7 +10,7 @@ class MDBookSidebarScrollbox extends HTMLElement { connectedCallback() { this.innerHTML = '

  1. Introduction
  2. Getting started
    1. Pre-requisites
    2. Installation
    3. First project
  3. Commands
  4. Configuration
    1. Schema
  5. Hooks
  6. Assets
    1. Minification
    2. Sub-resource integrity
  7. Advanced
    1. JavaScript interoperability
    2. Startup event
    3. Application initializer
    4. Library crate
    5. Base URLs, public URLs, paths & reverse proxies
    6. Backend Proxy
  8. Contributing
'; // Set the current, active page, and reveal it if it's hidden - let current_page = document.location.href.toString(); + let current_page = document.location.href.toString().split("#")[0]; if (current_page.endsWith("/")) { current_page += "index.html"; }