Better doc for ReadTheDocs

This commit is contained in:
2022-06-14 09:25:43 +02:00
parent bc3c5dc932
commit bb83384d62
7 changed files with 559 additions and 44 deletions

View File

@@ -1,41 +1,48 @@
function addSmileLogo() {
let logo = document.createElement("img");
const logo = document.createElement("img");
logo.src = "/statics/Logo_Smile.png";
logo.classList.add("smile-logo");
logo.alt = "Smile logo";
let link = document.createElement("a");
const link = document.createElement("a");
link.href = "https://www.smile.eu";
link.target = "_blank";
link.title = "Smile website";
link.classList.add("smile-logo");
link.appendChild(logo);
const text = document.createElement("p");
text.innerHTML = "Sponsored by Smile";
const div = document.createElement("div");
div.classList.add("smile-logo");
div.appendChild(text);
div.appendChild(link);
logo.addEventListener("load", () => {
let side = document.querySelector(".wy-menu");
side.appendChild(link);
let side = document.querySelector(".md-footer-meta__inner");
side.appendChild(div);
});
}
function addKatenaryLogo() {
let logo = document.createElement("img");
logo.src = "/statics/logo.png";
logo.classList.add("logo");
logo.alt = "Katenary logo";
function hljsInstall() {
const version = "11.5.1";
const theme = "github-dark";
let link = document.createElement("a");
link.href = "/";
link.title = "Index page";
const script = document.createElement("script");
script.src = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/highlight.min.js`;
script.onload = () => {
const style = document.createElement("link");
style.rel = "stylesheet";
style.href = `//cdnjs.cloudflare.com/ajax/libs/highlight.js/${version}/styles/${theme}.min.css`;
document.head.appendChild(style);
hljs.initHighlightingOnLoad();
};
link.appendChild(logo);
logo.addEventListener("load", () => {
let side = document.querySelector(".wy-nav-side");
side.insertBefore(link, side.firstChild);
});
document.head.appendChild(script);
}
document.addEventListener("DOMContentLoaded", () => {
//addKatenaryLogo();
//addSmileLogo();
addSmileLogo();
hljsInstall();
});