mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #6158 from hugovk/furo
Replace Read the Docs Sphinx Theme with Furo
This commit is contained in:
commit
986ae73562
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
|
||||
|
|
15
docs/conf.py
15
docs/conf.py
|
@ -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,13 +124,15 @@ 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
|
||||
# documentation.
|
||||
# html_theme_options = {}
|
||||
html_theme_options = {
|
||||
"light_logo": "pillow-logo-dark-text.png",
|
||||
"dark_logo": "pillow-logo.png",
|
||||
}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
# html_theme_path = []
|
||||
|
@ -146,7 +146,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
|||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
html_logo = "resources/pillow-logo.png"
|
||||
# html_logo = "resources/pillow-logo.png"
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
|
@ -311,10 +311,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
|
||||
|
|
|
@ -24,8 +24,6 @@ attribute will be ``None``.
|
|||
Fully supported formats
|
||||
-----------------------
|
||||
|
||||
.. contents::
|
||||
|
||||
BLP
|
||||
^^^
|
||||
|
||||
|
|
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');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
BIN
docs/resources/pillow-logo-dark-text.png
Normal file
BIN
docs/resources/pillow-logo-dark-text.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Loading…
Reference in New Issue
Block a user