Skip to content

Commit ba3d574

Browse files
committed
ci: generate pages at 604c194 [ci skip]
1 parent 604c194 commit ba3d574

30 files changed

+330
-1275
lines changed

docs/404.html

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,35 @@
44
<!-- Book generated using mdBook -->
55
<meta charset="UTF-8">
66
<title></title>
7-
8-
97
<base href="/">
10-
118

129

1310
<!-- Custom HTML head -->
14-
15-
1611

1712
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
1813
<meta name="description" content="">
1914
<meta name="viewport" content="width=device-width, initial-scale=1">
2015
<meta name="theme-color" content="#ffffff" />
2116

22-
2317
<link rel="icon" href="favicon.svg">
24-
25-
2618
<link rel="shortcut icon" href="favicon.png">
27-
2819
<link rel="stylesheet" href="css/variables.css">
2920
<link rel="stylesheet" href="css/general.css">
3021
<link rel="stylesheet" href="css/chrome.css">
31-
3222
<link rel="stylesheet" href="css/print.css" media="print">
33-
3423

3524
<!-- Fonts -->
3625
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
37-
3826
<link rel="stylesheet" href="fonts/fonts.css">
39-
4027

4128
<!-- Highlight.js Stylesheets -->
4229
<link rel="stylesheet" href="highlight.css">
4330
<link rel="stylesheet" href="tomorrow-night.css">
4431
<link rel="stylesheet" href="ayu-highlight.css">
4532

4633
<!-- Custom theme stylesheets -->
47-
4834
<link rel="stylesheet" href="theme/em-to-bold.css">
49-
5035

51-
5236
</head>
5337
<body>
5438
<!-- Provide site root to javascript -->
@@ -107,7 +91,6 @@
10791
<div id="page-wrapper" class="page-wrapper">
10892

10993
<div class="page">
110-
11194
<div id="menu-bar-hover-placeholder"></div>
11295
<div id="menu-bar" class="menu-bar sticky bordered">
11396
<div class="left-buttons">
@@ -124,41 +107,34 @@
124107
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
125108
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
126109
</ul>
127-
128110
<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">
129111
<i class="fa fa-search"></i>
130112
</button>
131-
132113
</div>
133114

134115
<h1 class="menu-title">エディションガイド</h1>
135116

136117
<div class="right-buttons">
137-
138118
<a href="print.html" title="Print this book" aria-label="Print this book">
139119
<i id="print-button" class="fa fa-print"></i>
140120
</a>
141-
142-
143121
<a href="https://github.com/rust-lang-ja/edition-guide" title="Git repository" aria-label="Git repository">
144122
<i id="git-repository-button" class="fa fa-github"></i>
145123
</a>
146-
124+
147125
</div>
148126
</div>
149127

150-
151128
<div id="search-wrapper" class="hidden">
152129
<form id="searchbar-outer" class="searchbar-outer">
153-
<input type="search" name="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
130+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
154131
</form>
155132
<div id="searchresults-outer" class="searchresults-outer hidden">
156133
<div id="searchresults-header" class="searchresults-header"></div>
157134
<ul id="searchresults">
158135
</ul>
159136
</div>
160137
</div>
161-
162138

163139
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
164140
<script type="text/javascript">
@@ -171,58 +147,44 @@ <h1 class="menu-title">エディションガイド</h1>
171147

172148
<div id="content" class="content">
173149
<main>
174-
<h1><a class="header" href="#document-not-found-404" id="document-not-found-404">Document not found (404)</a></h1>
150+
<h1 id="document-not-found-404"><a class="header" href="#document-not-found-404">Document not found (404)</a></h1>
175151
<p>This URL is invalid, sorry. Please use the navigation bar or search to continue.</p>
176152

177153
</main>
178154

179155
<nav class="nav-wrapper" aria-label="Page navigation">
180156
<!-- Mobile navigation buttons -->
181-
182157

183-
184158

185159
<div style="clear: both"></div>
186160
</nav>
187161
</div>
188162
</div>
189163

190164
<nav class="nav-wide-wrapper" aria-label="Page navigation">
191-
192165

193-
194166
</nav>
195167

196168
</div>
197169

198-
199170

200-
201171

202-
203172

204-
205173
<script type="text/javascript">
206174
window.playground_copyable = true;
207175
</script>
208-
209176

210-
211177

212-
213178
<script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
214179
<script src="mark.min.js" type="text/javascript" charset="utf-8"></script>
215180
<script src="searcher.js" type="text/javascript" charset="utf-8"></script>
216-
217181

218182
<script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script>
219183
<script src="highlight.js" type="text/javascript" charset="utf-8"></script>
220184
<script src="book.js" type="text/javascript" charset="utf-8"></script>
221185

222186
<!-- Custom JS scripts -->
223-
224187

225-
226188

227189
</body>
228190
</html>

docs/book.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ function playground_text(playground) {
108108

109109
let text = playground_text(code_block);
110110
let classes = code_block.querySelector('code').classList;
111-
let has_2018 = classes.contains("edition2018");
112-
let edition = has_2018 ? "2018" : "2015";
113-
111+
let edition = "2015";
112+
if(classes.contains("edition2018")) {
113+
edition = "2018";
114+
} else if(classes.contains("edition2021")) {
115+
edition = "2021";
116+
}
114117
var params = {
115118
version: "stable",
116119
optimize: "0",
@@ -133,7 +136,15 @@ function playground_text(playground) {
133136
body: JSON.stringify(params)
134137
})
135138
.then(response => response.json())
136-
.then(response => result_block.innerText = response.result)
139+
.then(response => {
140+
if (response.result.trim() === '') {
141+
result_block.innerText = "No output";
142+
result_block.classList.add("result-no-output");
143+
} else {
144+
result_block.innerText = response.result;
145+
result_block.classList.remove("result-no-output");
146+
}
147+
})
137148
.catch(error => result_block.innerText = "Playground Communication: " + error.message);
138149
}
139150

@@ -151,12 +162,13 @@ function playground_text(playground) {
151162
if (window.ace) {
152163
// language-rust class needs to be removed for editable
153164
// blocks or highlightjs will capture events
154-
Array
155-
.from(document.querySelectorAll('code.editable'))
165+
code_nodes
166+
.filter(function (node) {return node.classList.contains("editable"); })
156167
.forEach(function (block) { block.classList.remove('language-rust'); });
157168

158169
Array
159-
.from(document.querySelectorAll('code:not(.editable)'))
170+
code_nodes
171+
.filter(function (node) {return !node.classList.contains("editable"); })
160172
.forEach(function (block) { hljs.highlightBlock(block); });
161173
} else {
162174
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });
@@ -359,7 +371,14 @@ function playground_text(playground) {
359371
});
360372

361373
themePopup.addEventListener('click', function (e) {
362-
var theme = e.target.id || e.target.parentElement.id;
374+
var theme;
375+
if (e.target.className === "theme") {
376+
theme = e.target.id;
377+
} else if (e.target.parentElement.className === "theme") {
378+
theme = e.target.parentElement.id;
379+
} else {
380+
return;
381+
}
363382
set_theme(theme);
364383
});
365384

docs/css/chrome.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ a > .hljs {
9393
.menu-title {
9494
display: inline-block;
9595
font-weight: 200;
96-
font-size: 2rem;
96+
font-size: 2.4rem;
9797
line-height: var(--menu-bar-height);
9898
text-align: center;
9999
margin: 0;

docs/css/general.css

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,23 @@ h4, h5 { margin-top: 2em; }
4545
margin-top: 1em;
4646
}
4747

48-
h1 a.header:target::before,
49-
h2 a.header:target::before,
50-
h3 a.header:target::before,
51-
h4 a.header:target::before {
48+
h1:target::before,
49+
h2:target::before,
50+
h3:target::before,
51+
h4:target::before,
52+
h5:target::before,
53+
h6:target::before {
5254
display: inline-block;
5355
content: "»";
5456
margin-left: -30px;
5557
width: 30px;
5658
}
5759

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

@@ -89,7 +92,7 @@ h4 a.header:target {
8992
.content ul { line-height: 1.45em; }
9093
.content a { text-decoration: none; }
9194
.content a:hover { text-decoration: underline; }
92-
.content img { max-width: 100%; }
95+
.content img, .content video { max-width: 100%; }
9396
.content .header:link,
9497
.content .header:visited {
9598
color: var(--fg);
@@ -172,3 +175,7 @@ blockquote {
172175
margin: 5px 0px;
173176
font-weight: bold;
174177
}
178+
179+
.result-no-output {
180+
font-style: italic;
181+
}

docs/css/variables.css

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
--links: #2b79a2;
6969

70-
--inline-code-color: #c5c8c6;;
70+
--inline-code-color: #c5c8c6;
7171

7272
--theme-popup-bg: #141617;
7373
--theme-popup-border: #43484d;
@@ -92,22 +92,22 @@
9292

9393
.light {
9494
--bg: hsl(0, 0%, 100%);
95-
--fg: #333333;
95+
--fg: hsl(0, 0%, 0%);
9696

9797
--sidebar-bg: #fafafa;
98-
--sidebar-fg: #364149;
98+
--sidebar-fg: hsl(0, 0%, 0%);
9999
--sidebar-non-existant: #aaaaaa;
100-
--sidebar-active: #008cff;
100+
--sidebar-active: #1f1fff;
101101
--sidebar-spacer: #f4f4f4;
102102

103-
--scrollbar: #cccccc;
103+
--scrollbar: #8F8F8F;
104104

105-
--icons: #cccccc;
106-
--icons-hover: #333333;
105+
--icons: #747474;
106+
--icons-hover: #000000;
107107

108-
--links: #4183c4;
108+
--links: #20609f;
109109

110-
--inline-code-color: #6e6b5e;
110+
--inline-code-color: #301900;
111111

112112
--theme-popup-bg: #fafafa;
113113
--theme-popup-border: #cccccc;
@@ -147,7 +147,7 @@
147147

148148
--links: #2b79a2;
149149

150-
--inline-code-color: #c5c8c6;;
150+
--inline-code-color: #c5c8c6;
151151

152152
--theme-popup-bg: #161923;
153153
--theme-popup-border: #737480;
@@ -228,7 +228,7 @@
228228

229229
--links: #2b79a2;
230230

231-
--inline-code-color: #c5c8c6;;
231+
--inline-code-color: #c5c8c6;
232232

233233
--theme-popup-bg: #141617;
234234
--theme-popup-border: #43484d;

0 commit comments

Comments
 (0)