diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /vendor/mdbook/src/theme/index.hbs | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/mdbook/src/theme/index.hbs')
-rw-r--r-- | vendor/mdbook/src/theme/index.hbs | 59 |
1 files changed, 29 insertions, 30 deletions
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 @@ <!-- Custom HTML head --> {{> head}} - <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta name="description" content="{{ description }}"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#ffffff" /> @@ -51,18 +50,18 @@ {{#if mathjax_support}} <!-- MathJax --> - <script async type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> + <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> {{/if}} </head> <body> <!-- Provide site root to javascript --> - <script type="text/javascript"> + <script> var path_to_root = "{{ path_to_root }}"; var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}"; </script> <!-- Work around some values being stored in localStorage wrapped in quotes --> - <script type="text/javascript"> + <script> try { var theme = localStorage.getItem('mdbook-theme'); var sidebar = localStorage.getItem('mdbook-sidebar'); @@ -78,7 +77,7 @@ </script> <!-- Set the theme before any content is loaded, prevents flash --> - <script type="text/javascript"> + <script> var theme; try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { } if (theme === null || theme === undefined) { theme = default_theme; } @@ -90,7 +89,7 @@ </script> <!-- Hide / unhide sidebar before it is displayed --> - <script type="text/javascript"> + <script> var html = document.querySelector('html'); var sidebar = 'hidden'; if (document.body.clientWidth >= 1080) { @@ -122,11 +121,11 @@ <i class="fa fa-paint-brush"></i> </button> <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu"> - <li role="none"><button role="menuitem" class="theme" id="light">{{ theme_option "Light" }}</button></li> - <li role="none"><button role="menuitem" class="theme" id="rust">{{ theme_option "Rust" }}</button></li> - <li role="none"><button role="menuitem" class="theme" id="coal">{{ theme_option "Coal" }}</button></li> - <li role="none"><button role="menuitem" class="theme" id="navy">{{ theme_option "Navy" }}</button></li> - <li role="none"><button role="menuitem" class="theme" id="ayu">{{ theme_option "Ayu" }}</button></li> + <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> + <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> + <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> + <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li> + <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li> </ul> {{#if search_enabled}} <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar"> @@ -171,7 +170,7 @@ {{/if}} <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM --> - <script type="text/javascript"> + <script> document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible'); document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible'); Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) { @@ -221,7 +220,7 @@ {{#if live_reload_endpoint}} <!-- Livereload script (if served using the cli tool) --> - <script type="text/javascript"> + <script> const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:'; const wsAddress = wsProtocol + "//" + location.host + "/" + "{{{live_reload_endpoint}}}"; const socket = new WebSocket(wsAddress); @@ -240,7 +239,7 @@ {{#if google_analytics}} <!-- Google Analytics Tag --> - <script type="text/javascript"> + <script> var localAddrs = ["localhost", "127.0.0.1", ""]; // make sure we don't activate google analytics if the developer is @@ -258,43 +257,43 @@ {{/if}} {{#if playground_line_numbers}} - <script type="text/javascript"> + <script> window.playground_line_numbers = true; </script> {{/if}} {{#if playground_copyable}} - <script type="text/javascript"> + <script> window.playground_copyable = true; </script> {{/if}} {{#if playground_js}} - <script src="{{ path_to_root }}ace.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}editor.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}mode-rust.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}theme-dawn.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}theme-tomorrow_night.js" type="text/javascript" charset="utf-8"></script> + <script src="{{ path_to_root }}ace.js"></script> + <script src="{{ path_to_root }}editor.js"></script> + <script src="{{ path_to_root }}mode-rust.js"></script> + <script src="{{ path_to_root }}theme-dawn.js"></script> + <script src="{{ path_to_root }}theme-tomorrow_night.js"></script> {{/if}} {{#if search_js}} - <script src="{{ path_to_root }}elasticlunr.min.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}mark.min.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}searcher.js" type="text/javascript" charset="utf-8"></script> + <script src="{{ path_to_root }}elasticlunr.min.js"></script> + <script src="{{ path_to_root }}mark.min.js"></script> + <script src="{{ path_to_root }}searcher.js"></script> {{/if}} - <script src="{{ path_to_root }}clipboard.min.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}highlight.js" type="text/javascript" charset="utf-8"></script> - <script src="{{ path_to_root }}book.js" type="text/javascript" charset="utf-8"></script> + <script src="{{ path_to_root }}clipboard.min.js"></script> + <script src="{{ path_to_root }}highlight.js"></script> + <script src="{{ path_to_root }}book.js"></script> <!-- Custom JS scripts --> {{#each additional_js}} - <script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script> + <script src="{{ ../path_to_root }}{{this}}"></script> {{/each}} {{#if is_print}} {{#if mathjax_support}} - <script type="text/javascript"> + <script> window.addEventListener('load', function() { MathJax.Hub.Register.StartupHook('End', function() { window.setTimeout(window.print, 100); @@ -302,7 +301,7 @@ }); </script> {{else}} - <script type="text/javascript"> + <script> window.addEventListener('load', function() { window.setTimeout(window.print, 100); }); |