Skip to content

Commit 27463f5

Browse files
committed
Update mdbook
Signed-off-by: Isaac Marovitz <[email protected]>
1 parent 10d5a4a commit 27463f5

File tree

3 files changed

+47
-65
lines changed

3 files changed

+47
-65
lines changed

.github/workflows/mdbook.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
env:
21-
MDBOOK_VERSION: 0.4.37
21+
MDBOOK_VERSION: 0.4.48
2222
CARGO_TERM_COLOR: always
2323
GITHUB_ACTIONS: true
2424
steps:

src/steam.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ quit or restart steam), follow these instructions:
2626

2727
2. In your Whisky Steam configuration, add the following arguments:
2828

29-
> [!NOTE]
30-
> The link will not open in a browser, however, it is still active.
31-
29+
**The link will not open in a browser, however, it is still active.**
30+
3231
```
3332
-forcesteamupdate -forcepackagedownload -overridepackageurl http://web.archive.org/web/20250306194830if_/media.steampowered.com/client -exitsteam
3433
```

theme/index.hbs

+44-61
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,54 @@
2020
<meta name="theme-color" content="#251e17">
2121

2222
{{#if favicon_svg}}
23-
<link rel="icon" href="{{ path_to_root }}favicon.svg">
23+
<link rel="icon" href="{{ resource "favicon.svg" }}">
2424
{{/if}}
2525
{{#if favicon_png}}
26-
<link rel="shortcut icon" href="{{ path_to_root }}favicon.png">
26+
<link rel="shortcut icon" href="{{ resource "favicon.png" }}">
2727
{{/if}}
28-
<link rel="stylesheet" href="{{ path_to_root }}css/variables.css">
29-
<link rel="stylesheet" href="{{ path_to_root }}css/general.css">
30-
<link rel="stylesheet" href="{{ path_to_root }}css/chrome.css">
28+
<link rel="stylesheet" href="{{ resource "css/variables.css" }}">
29+
<link rel="stylesheet" href="{{ resource "css/general.css" }}">
30+
<link rel="stylesheet" href="{{ resource "css/chrome.css" }}">
3131
{{#if print_enable}}
32-
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
32+
<link rel="stylesheet" href="{{ resource "css/print.css" }}" media="print">
3333
{{/if}}
3434

3535
<!-- Fonts -->
36-
<link rel="stylesheet" href="{{ path_to_root }}FontAwesome/css/font-awesome.css">
36+
<link rel="stylesheet" href="{{ resource "FontAwesome/css/font-awesome.css" }}">
3737
{{#if copy_fonts}}
38-
<link rel="stylesheet" href="{{ path_to_root }}fonts/fonts.css">
38+
<link rel="stylesheet" href="{{ resource "fonts/fonts.css" }}">
3939
{{/if}}
4040

4141
<!-- Highlight.js Stylesheets -->
42-
<link rel="stylesheet" href="{{ path_to_root }}highlight.css">
43-
<link rel="stylesheet" href="{{ path_to_root }}tomorrow-night.css">
44-
<link rel="stylesheet" href="{{ path_to_root }}ayu-highlight.css">
42+
<link rel="stylesheet" id="highlight-css" href="{{ resource "highlight.css" }}">
43+
<link rel="stylesheet" id="tomorrow-night-css" href="{{ resource "tomorrow-night.css" }}">
44+
<link rel="stylesheet" id="ayu-highlight-css" href="{{ resource "ayu-highlight.css" }}">
4545

4646
<!-- Custom theme stylesheets -->
4747
{{#each additional_css}}
48-
<link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
48+
<link rel="stylesheet" href="{{ resource this }}">
4949
{{/each}}
5050

5151
{{#if mathjax_support}}
5252
<!-- MathJax -->
5353
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
5454
{{/if}}
55-
</head>
56-
<body class="sidebar-visible no-js">
57-
<div id="body-container">
58-
<!-- Provide site root to javascript -->
55+
56+
<!-- Provide site root and default themes to javascript -->
5957
<script>
60-
var path_to_root = "{{ path_to_root }}";
58+
const path_to_root = "{{ path_to_root }}";
59+
const default_light_theme = "{{ default_theme }}";
60+
const default_dark_theme = "{{ preferred_dark_theme }}";
6161
</script>
62-
62+
<!-- Start loading toc.js asap -->
63+
<script src="{{ resource "toc.js" }}"></script>
64+
</head>
65+
<body>
66+
<div id="body-container">
6367
<!-- Work around some values being stored in localStorage wrapped in quotes -->
6468
<script>
6569
try {
66-
var sidebar = localStorage.getItem('mdbook-sidebar');
70+
let sidebar = localStorage.getItem('mdbook-sidebar');
6771
6872
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
6973
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
@@ -82,48 +86,27 @@
8286

8387
<!-- Hide / unhide sidebar before it is displayed -->
8488
<script>
85-
var body = document.querySelector('body');
86-
var sidebar = null;
87-
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
89+
let sidebar = null;
90+
const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
8891
if (document.body.clientWidth >= 1080) {
8992
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
9093
sidebar = sidebar || 'visible';
9194
} else {
9295
sidebar = 'hidden';
9396
}
9497
sidebar_toggle.checked = sidebar === 'visible';
95-
body.classList.remove('sidebar-visible');
96-
body.classList.add("sidebar-" + sidebar);
98+
html.classList.remove('sidebar-visible');
99+
html.classList.add("sidebar-" + sidebar);
97100
</script>
98101

99102
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
100-
<div class="sidebar-scrollbox">
101-
{{#toc}}{{/toc}}
102-
</div>
103+
<!-- populated by js -->
104+
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
105+
<noscript>
106+
<iframe class="sidebar-iframe-outer" src="{{ path_to_root }}toc.html"></iframe>
107+
</noscript>
103108
</nav>
104109

105-
<!-- Track and set sidebar scroll position -->
106-
<script>
107-
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
108-
sidebarScrollbox.addEventListener('click', function(e) {
109-
if (e.target.tagName === 'A') {
110-
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
111-
}
112-
}, { passive: true });
113-
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
114-
sessionStorage.removeItem('sidebar-scroll');
115-
if (sidebarScrollTop) {
116-
// preserve sidebar scroll position when navigating via links within sidebar
117-
sidebarScrollbox.scrollTop = sidebarScrollTop;
118-
} else {
119-
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
120-
var activeSection = document.querySelector('#sidebar .active');
121-
if (activeSection) {
122-
activeSection.scrollIntoView({ block: 'center' });
123-
}
124-
}
125-
</script>
126-
127110
<div id="page-wrapper" class="page-wrapper">
128111

129112
<div class="page">
@@ -220,26 +203,26 @@
220203
{{/if}}
221204

222205
{{#if playground_js}}
223-
<script src="{{ path_to_root }}ace.js"></script>
224-
<script src="{{ path_to_root }}editor.js"></script>
225-
<script src="{{ path_to_root }}mode-rust.js"></script>
226-
<script src="{{ path_to_root }}theme-dawn.js"></script>
227-
<script src="{{ path_to_root }}theme-tomorrow_night.js"></script>
206+
<script src="{{ resource "ace.js" }}"></script>
207+
<script src="{{ resource "editor.js" }}"></script>
208+
<script src="{{ resource "mode-rust.js" }}"></script>
209+
<script src="{{ resource "theme-dawn.js" }}"></script>
210+
<script src="{{ resource "theme-tomorrow_night.js" }}"></script>
228211
{{/if}}
229212

230213
{{#if search_js}}
231-
<script src="{{ path_to_root }}elasticlunr.min.js"></script>
232-
<script src="{{ path_to_root }}mark.min.js"></script>
233-
<script src="{{ path_to_root }}searcher.js"></script>
214+
<script src="{{ resource "elasticlunr.min.js" }}"></script>
215+
<script src="{{ resource "mark.min.js" }}"></script>
216+
<script src="{{ resource "searcher.js" }}"></script>
234217
{{/if}}
235218

236-
<script src="{{ path_to_root }}clipboard.min.js"></script>
237-
<script src="{{ path_to_root }}highlight.js"></script>
238-
<script src="{{ path_to_root }}book.js"></script>
219+
<script src="{{ resource "clipboard.min.js" }}"></script>
220+
<script src="{{ resource "highlight.js" }}"></script>
221+
<script src="{{ resource "book.js" }}"></script>
239222

240223
<!-- Custom JS scripts -->
241224
{{#each additional_js}}
242-
<script src="{{ ../path_to_root }}{{this}}"></script>
225+
<script src="{{ resource this}}"></script>
243226
{{/each}}
244227

245228
{{#if is_print}}

0 commit comments

Comments
 (0)