Skip to content

Commit 18bae9c

Browse files
authored
Update readthedocs.js to latest zensical example (#1558)
Also: - Remove use of readthedocs.css since that isn't included in the Zensical example
1 parent be4a177 commit 18bae9c

File tree

3 files changed

+3
-40
lines changed

3 files changed

+3
-40
lines changed

docs/javascripts/readthedocs.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,8 @@
11
document.addEventListener("DOMContentLoaded", function (event) {
22
// Trigger Read the Docs' search addon instead of Zensical default
3-
document.querySelector(".md-search__input").addEventListener("focus", (e) => {
3+
document.querySelector(".md-search").addEventListener("click", (e) => {
4+
e.preventDefault();
45
const event = new CustomEvent("readthedocs-search-show");
56
document.dispatchEvent(event);
67
});
78
});
8-
9-
// Use CustomEvent to generate the version selector
10-
document.addEventListener("readthedocs-addons-data-ready", function (event) {
11-
const config = event.detail.data();
12-
const versioning = `
13-
<div class="md-version">
14-
<button class="md-version__current" aria-label="Select version">
15-
${config.versions.current.slug}
16-
</button>
17-
18-
<ul class="md-version__list">
19-
${config.versions.active
20-
.map(
21-
(version) => `
22-
<li class="md-version__item">
23-
<a href="${version.urls.documentation}" class="md-version__link">
24-
${version.slug}
25-
</a>
26-
</li>`,
27-
)
28-
.join("\n")}
29-
</ul>
30-
</div>`;
31-
32-
document.querySelector(".md-header__topic").insertAdjacentHTML("beforeend", versioning);
33-
});

docs/stylesheets/readthedocs.css

Lines changed: 0 additions & 11 deletions
This file was deleted.

mkdocs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,9 @@ nav:
217217
- Meta:
218218
- doc_conventions.md
219219

220-
# Include extra CSS to make some style adjustments for ReadTheDocs
220+
# Include extra CSS to make some style adjustments for visible width
221221
extra_css:
222222
- stylesheets/cmd2.css
223-
- stylesheets/readthedocs.css
224223

225224
# Include extra JS to setup Read the Docs addons integrations
226225
extra_javascript:

0 commit comments

Comments
 (0)