Replace Read the Docs Sphinx Theme with Furo

This commit is contained in:
Hugo van Kemenade 2022-03-26 20:17:44 +02:00
parent 77f12cd473
commit abd9eda499
7 changed files with 3 additions and 2073 deletions

View File

@ -93,7 +93,7 @@ jobs:
- name: Docs
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.10
run: |
python3 -m pip install sphinx-copybutton sphinx-issues sphinx-removed-in sphinx-rtd-theme sphinxext-opengraph
python3 -m pip install furo sphinx-copybutton sphinx-issues sphinx-removed-in sphinxext-opengraph
make doccheck
- name: After success

View File

@ -16,8 +16,6 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
import PIL
# -- General configuration ------------------------------------------------
@ -126,8 +124,7 @@ nitpicky = True
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "furo"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -311,10 +308,7 @@ texinfo_documents = [
def setup(app):
app.add_js_file("js/script.js")
app.add_css_file("css/styles.css")
app.add_css_file("css/dark.css")
app.add_css_file("css/light.css")
# GitHub repo for sphinx-issues

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
@media (prefers-color-scheme: light) {
.wy-menu-vertical li.toctree-l2.current a,
.wy-menu-vertical li.toctree-l3.current a {
background-color: #c9c9c9;
}
}

View File

@ -1,8 +0,0 @@
th p {
margin-bottom: 0;
}
.rst-content tr .line-block {
font-size: 1rem;
margin-bottom: 0;
}

View File

@ -1,58 +0,0 @@
jQuery(document).ready(function ($) {
setTimeout(function () {
var sectionID = 'base';
var search = function ($section, $sidebarItem) {
$section.children('.section, .function, .method').each(function () {
if ($(this).hasClass('section')) {
sectionID = $(this).attr('id');
search($(this), $sidebarItem.parent().find('[href="#'+sectionID+'"]'));
} else {
var $dt = $(this).children('dt');
var id = $dt.attr('id');
if (id === undefined) {
return;
}
var $functionsUL = $sidebarItem.siblings('[data-sectionID='+sectionID+']');
if (!$functionsUL.length) {
$functionsUL = $('<ul />').attr('data-sectionID', sectionID);
$functionsUL.insertAfter($sidebarItem);
}
var $li = $('<li />');
var $a = $('<a />').css('font-size', '11.5px');
var $upperA = $sidebarItem.parent().children('a');
var $upperAParent = $upperA.parent();
if ($upperAParent.hasClass('toctree-l2')) {
$a.css('padding-left', '4em');
} else if ($upperAParent.hasClass('toctree-l3')) {
if (!$upperA.find('.toctree-expand').length) {
$upperA.prepend($('<span />').addClass('toctree-expand'));
}
$a.css('padding-left', '5em');
} else {
$a.css('background-color', '#bdbdbd');
$a.css('padding-left', '6.25em');
}
$a.attr('href', '#'+id);
$a.text('- '+$dt.find('code').text());
$a.click(function () {
setTimeout(function () {
$a.css('font-weight', 'bold');
}, 0);
});
$li.append($a);
$functionsUL.append($li);
}
});
};
search($('[itemprop=articleBody] > .section'), $('.wy-nav-side a[href="#"]'));
}, 0);
$(window).on('hashchange', function () {
$('ul[data-sectionID]').each(function () {
$(this).find('a').each(function () {
$(this).css('font-weight', 'normal');
});
});
});
});

View File

@ -37,12 +37,12 @@ python_requires = >=3.7
[options.extras_require]
docs =
furo
olefile
sphinx>=2.4
sphinx-copybutton
sphinx-issues>=3.0.1
sphinx-removed-in
sphinx-rtd-theme>=1.0
sphinxext-opengraph
tests =
check-manifest