mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Replace Read the Docs Sphinx Theme with Furo
This commit is contained in:
parent
77f12cd473
commit
abd9eda499
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
th p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.rst-content tr .line-block {
|
||||
font-size: 1rem;
|
||||
margin-bottom: 0;
|
||||
}
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user