Improved modular JS for the docs (#813)

This commit is contained in:
trgwii
2018-05-24 11:22:52 +02:00
committed by Lonami
parent e5ff534e2e
commit c4c41645e7
2 changed files with 37 additions and 30 deletions

View File

@@ -48,20 +48,16 @@ class DocsWriter:
<link id="style" href="''')
self.write(relative_css_path)
self.write('/')
self.write('/docs.')
self.write(default_css)
self.write('''" rel="stylesheet">
self.write('''.css" rel="stylesheet">
<script>
try {
which = document.cookie.split('=')[1].split(';')[0];
if (which) {
document.getElementById("style").href = "''')
document.getElementById("style").href = "''')
self.write(relative_css_path)
self.write('''/" + which;
}
} catch (e) {
}
self.write('/docs.')
self.write('''" + (document.cookie
.split(";")[0].split("=")[1] || "light") + ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro" rel="stylesheet">
</head>