mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-06 05:00:23 +03:00
Port good code to autogenerated pages
This commit is contained in:
parent
77a4e83204
commit
2797130324
|
@ -7,14 +7,10 @@
|
|||
<link id="style" href="css/docs.light.css" rel="stylesheet">
|
||||
<script>
|
||||
(function () {
|
||||
var themes = [ 'light', 'dark' ];
|
||||
var style = document.getElementById('style');
|
||||
|
||||
// setTheme(<link />, 'light' / 'dark')
|
||||
function setTheme(theme) {
|
||||
if (themes.indexOf(theme) === -1) {
|
||||
return console.warn('Invalid theme');
|
||||
}
|
||||
document.cookie = 'css=' + theme + '; path=/';
|
||||
return style.href = 'css/docs.' + theme + '.css';
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user