New doc design: Sphinx Bootstrap 4 Theme

Now we use an own, mobile-first, responsive sphinx theme based on Bootstrap 4.
It makes navigation on the very long "Python module instaloader" page a lot
easier. Also, it looks better.

This solves all the problems we had with sphinx-bootstrap-theme.
This commit is contained in:
Alexander Graf
2018-12-31 19:30:19 +01:00
parent 2e7835850a
commit ac4cd9f595
11 changed files with 318 additions and 126 deletions

File diff suppressed because one or more lines are too long

7
docs/_static/bootstrap-4.1.3.min.css vendored Normal file

File diff suppressed because one or more lines are too long

74
docs/_static/instaloader.css vendored Normal file
View File

@@ -0,0 +1,74 @@
@import url(bootstrap-4.1.3.min.css);
a {
color: #008d06; }
a:hover {
color: #f48400; }
code {
color: #212529; }
.highlight {
border-radius: 0.3em; }
.highlight pre {
padding: 0.7em;
color: #fff; }
.highlight .c1 {
color: #008d06; }
.highlight .kn {
color: #f48400; }
.highlight .s1, .highlight .s2, .highlight .mi {
color: #ff7efd; }
.doc-content {
top: 4.0625em;
position: relative;
height: calc(100vh - 4.0625em);
overflow-y: auto; }
.doc-sidebar {
position: fixed;
padding-top: 0.5em;
top: 3.5625em;
bottom: 0;
right: 0;
overflow-y: auto; }
.doc-sidebar ul {
padding-left: 1em; }
.doc-sidebar ul.current {
list-style-type: none;
padding-left: 0; }
.doc-sidebar li {
padding-top: 0.2em;
padding-bottom: 0.2em; }
.doc-sidebar li a {
color: #008d06; }
.doc-sidebar li a.current, .doc-sidebar li a.active {
color: #f48400;
font-weight: 500; }
.doc-sidebar li a:hover {
color: #f48400;
text-decoration: none; }
.admonition {
border-radius: 0.3em;
border: 1px solid #ccc;
background-color: #f8f9fa; }
.admonition .admonition-title {
color: #ff7efd; }
.topic {
border-radius: 0.3em;
background-color: #f8f9fa; }
.nav-link {
padding-top: 0;
padding-bottom: 0; }
.btn-success {
background-color: #008d06;
border-color: #008d06; }
.btn-success:hover {
background-color: #f48400;
border-color: #f48400; }
/*# sourceMappingURL=instaloader.css.map */

22
docs/_static/instaloader.js vendored Normal file
View File

@@ -0,0 +1,22 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip();
$('.doc-sidebar > ul > li.current').attr("id", "localtoc");
$('#localtoc ul').addClass("nav flex-column");
$('#localtoc ul li').addClass("nav-item");
$('#localtoc ul li a').addClass("nav-link");
$('.doc-content').scrollspy({target: '#localtoc'});
const top_href = '#' + $('.section:first').attr("id");
$('#localtoc > a.current').attr("href", top_href);
$('#navbarToc a').on("click", function () {
const href = $(this).attr("href");
if (href === '#') {
window.location.href = top_href;
} else {
window.location.href = href;
}
$('#navbarToc').modal('hide');
});
});

114
docs/_static/instaloader.scss vendored Normal file
View File

@@ -0,0 +1,114 @@
@import 'bootstrap-4.1.3.min.css';
$color_instaloader_main: #008d06;
$color_instaloader_accent: #f48400;
$color_instaloader_hyper: #ff7efd;
$color_normal_text: #212529;
$color_light_bg: #f8f9fa;
a {
color: $color_instaloader_main;
&:hover {
color: $color_instaloader_accent;
}
}
code {
color: $color_normal_text;
}
.highlight {
border-radius: 0.3em;
pre {
padding: 0.7em;
color: #fff;
}
.c1 {
color: $color_instaloader_main
}
.kn {
color: $color_instaloader_accent
}
.s1, .s2, .mi {
color: $color_instaloader_hyper
}
}
.doc-content {
top: 4.0625em;
position: relative;
height: calc(100vh - 4.0625em);
overflow-y: auto;
}
.doc-sidebar {
position: fixed;
padding-top: 0.5em;
top: 3.5625em;
bottom: 0;
right: 0;
overflow-y: auto;
ul {
padding-left: 1em;
&.current {
list-style-type: none;
padding-left: 0;
}
}
li {
padding-top: 0.2em;
padding-bottom: 0.2em;
a {
color: $color_instaloader_main;
&.current, &.active {
color: $color_instaloader_accent;
font-weight: 500;
}
&:hover {
color: $color_instaloader_accent;
text-decoration: none;
}
}
}
}
.admonition {
border-radius: 0.3em;
border: 1px solid #ccc;
background-color: $color_light_bg;
.admonition-title {
color: $color_instaloader_hyper;
}
}
.topic {
border-radius: 0.3em;
background-color: $color_light_bg;
}
.nav-link {
padding-top: 0;
padding-bottom: 0;
}
.btn-success {
background-color: $color_instaloader_main;
border-color: $color_instaloader_main;
&:hover {
background-color: $color_instaloader_accent;
border-color: $color_instaloader_accent;
}
}

View File

@@ -1,28 +0,0 @@
code {
color: #222;
background-color: #f5f5f5;
}
dd {
padding-left: 8px;
}
dl.option dd {
padding-left: 12px;
}
a {
color: #008d06;
}
a:hover {
color: #f48400;
}
body {
font-size: 16px;
}
.versionmodified {
font-size: 14px;
}