-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.html
More file actions
242 lines (199 loc) · 9.54 KB
/
search.html
File metadata and controls
242 lines (199 loc) · 9.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE html>
<html class="writer-html5" lang="ru" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="./img/favicon.ico" />
<title>scmRTOS</title>
<link rel="stylesheet" href="./css/theme.css" />
<link rel="stylesheet" href="./css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />
<link href="./extra.css" rel="stylesheet" />
<!--[if lt IE 9]>
<script src="./js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const selectorDiv = document.createElement("div");
selectorDiv.style.padding = "0.7em 0";
selectorDiv.style.textAlign = "center";
selectorDiv.style.borderBottom = "1px solid #ddd";
selectorDiv.style.marginBottom = "0.7em";
selectorDiv.style.display = "flex";
selectorDiv.style.alignItems = "center";
selectorDiv.style.gap = "10px";
selectorDiv.style.justifyContent = "center";
const select = document.createElement("select");
select.id = "lang-switcher";
select.style.width = "30%";
select.style.padding = "0.1em";
select.style.fontSize = "0.7em";
select.style.borderRadius = "10px";
select.style.textAlign = "center";
select.style.background = "#fff";
//select.style.border = "1px solid #ccc";
const currentLang = "en";
const languages = [
{ code: 'en', name: 'English', prefix: '/' },
{ code: 'ru', name: 'Русский', prefix: '/ru/' }
];
// get the page path and remove the leading slash
let pagePath = "".replace(/^\//, '');
// remove current lang prefix from the path
const currentLangObj = languages.find(lang => lang.code === currentLang);
if (currentLangObj && currentLangObj.prefix !== '/') {
// remove the leading slash from the prefix for comparison
const langPrefixWithoutSlash = currentLangObj.prefix.replace(/^\//, '');
// if the path starts with the lang prefix, delete it
if (pagePath.startsWith(langPrefixWithoutSlash)) {
pagePath = pagePath.substring(langPrefixWithoutSlash.length);
// remove the possible remaining leading slash
pagePath = pagePath.replace(/^\//, '');
}
}
console.log("Current lang:", currentLang, "page.url raw:", "", "normalized path:", pagePath);
languages.forEach(lang => {
const option = document.createElement("option");
let targetUrl;
// build target URL
if (pagePath === '') {
// main page
targetUrl = lang.prefix === '/' ? '/' : lang.prefix;
// make sure the path ended with a slash
if (!targetUrl.endsWith('/')) {
targetUrl += '/';
}
} else {
// all remaining pages - just combine the prefix and the path
targetUrl = lang.prefix + pagePath;
}
option.value = targetUrl;
option.text = lang.name;
if (lang.code === currentLang) option.selected = true;
select.appendChild(option);
});
const label = document.createElement("div");
label.style.fontSize = "0.8em";
label.style.color = "#fff";
label.style.marginTop = "0.3em";
label.textContent = "Language / Язык";
selectorDiv.appendChild(label);
selectorDiv.appendChild(select);
// Insert at top of sidebar
const target = document.querySelector(".wy-side-nav-search");
if (target) {
target.insertBefore(selectorDiv, target.firstChild);
} else {
console.warn("Could not find .wy-side-nav-search for lang selector");
}
select.addEventListener("change", function() {
if (this.value) window.location.href = this.value;
});
});
</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="./ru/" class="icon icon-home"> scmRTOS
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="./search.html" method="get">
<input type="text" name="q" placeholder="Поиск в документации" aria-label="Поиск в документации" title="Введите поисковый запрос" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Навигационное меню">
<p class="caption"><span class="caption-text">Введение</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="./ru/">О проекте</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/preface/">Предисловие</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/overview/">Общие сведения</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Компоненты</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="./ru/kernel/">Ядро</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/processes/">Процессы</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/ipcs/">Межпроцессное взаимодействие</a>
</li>
</ul>
<p class="caption"><span class="caption-text">Приложения</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="./ru/porting/">Портирование</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/debug/">Отладка</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/profiler/">Профилировка процессов</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/example-job-queue/">Пример: очередь заданий</a>
</li>
<li class="toctree-l1"><a class="reference internal" href="./ru/glossary/">Термины и сокращения</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Мобильная версия навигации">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="./ru/">scmRTOS</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="./ru/" class="icon icon-home" aria-label="Документация"></a></li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">
<h1 id="search">Результаты поиска</h1>
<form id="content_search" action="search.html">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<input name="q" id="mkdocs-search-query" type="text" class="search_input search-query ui-autocomplete-input" placeholder="Поиск в документах" aria-label="Поиск в документах" autocomplete="off" autofocus title="Введите поисковый запрос">
</form>
<div id="mkdocs-search-results" class="search-results" data-no-results-text="Ничего не найдено">
Поиск...
</div>
</div>
</div><footer>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Собрано в <a href="https://www.mkdocs.org/">MkDocs</a> с использованием <a href="https://github.com/readthedocs/sphinx_rtd_theme">темы</a> от <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="Версии">
<span class="rst-current-version" data-toggle="rst-current-version">
</span>
</div>
<script src="./js/jquery-3.6.0.min.js"></script>
<script>var base_url = ".";</script>
<script src="./js/theme_extra.js"></script>
<script src="./js/theme.js"></script>
<script src="./extra_js/mathjax.js"></script>
<script src="./extra_js/mathjax/tex-mml-chtml.js"></script>
<script src="./extra_js/color-symbols.js"></script>
<script src="./search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>