Skip to content

Commit f692df7

Browse files
author
Jon Wayne Parrott
committed
bpo-30607: Use external python-doc-theme
1 parent 1bced56 commit f692df7

File tree

10 files changed

+84
-586
lines changed

10 files changed

+84
-586
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ matrix:
3737
- cd Doc
3838
# Sphinx is pinned so that new versions that introduce new warnings won't suddenly cause build failures.
3939
# (Updating the version is fine as long as no warnings are raised by doing so.)
40-
- python -m pip install sphinx~=1.6.1
40+
# The theme used by the docs is stored seperately, so we need to install that as well.
41+
- python -m pip install sphinx~=1.6.1 git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme
4142
script:
4243
- make check suspicious html SPHINXOPTS="-q -W -j4"
4344
- os: linux

Doc/README.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ developers guide.
1414
Building the docs
1515
=================
1616

17-
You need to have `Sphinx <http://sphinx-doc.org/>`_ installed; it is the toolset
18-
used to build the docs. It is not included in this tree, but maintained
19-
separately and `available from PyPI <https://pypi.python.org/pypi/Sphinx>`_.
20-
17+
You need to have `Sphinx <http://sphinx-doc.org/>`_ and the Sphinx theme for Python
18+
docs installed. Sphinx is the toolset used to build the docs, it is not
19+
included in this tree, but maintained separately and
20+
`available from PyPI <https://pypi.python.org/pypi/Sphinx>`_. The theme is
21+
likewise separately maintained and is
22+
`available from GitHub <https://github.com/python/python-docs-theme>`_. You
23+
can install both using ``pip``::
24+
25+
python -m pip install sphinx~=1.6.1 git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme
2126

2227
Using make
2328
----------

Doc/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@
4545
# -----------------------
4646

4747
# Use our custom theme.
48-
html_theme = 'pydoctheme'
48+
html_theme = 'python_docs_theme'
4949
html_theme_path = ['tools']
50-
html_theme_options = {'collapsiblesidebar': True}
50+
html_theme_options = {
51+
'collapsiblesidebar': True,
52+
'issues_url': 'https://docs.python.org/3/bugs.html',
53+
'root_include_title': False # We use the version switcher instead.
54+
}
5155

5256
# Short title used e.g. for <title> HTML tags.
5357
html_short_title = '%s Documentation' % release

Doc/tools/pydoctheme/static/pydoctheme.css

Lines changed: 0 additions & 194 deletions
This file was deleted.

Doc/tools/pydoctheme/theme.conf

Lines changed: 0 additions & 23 deletions
This file was deleted.

Doc/tools/static/changelog_search.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
$(document).ready(function() {
2+
// add the search form and bind the events
3+
$('h1').after([
4+
'<p>Filter entries by content:',
5+
'<input type="text" value="" id="searchbox" style="width: 50%">',
6+
'<input type="submit" id="searchbox-submit" value="Filter"></p>'
7+
].join('\n'));
8+
9+
function dofilter() {
10+
try {
11+
var query = new RegExp($('#searchbox').val(), 'i');
12+
}
13+
catch (e) {
14+
return; // not a valid regex (yet)
15+
}
16+
// find headers for the versions (What's new in Python X.Y.Z?)
17+
$('#changelog h2').each(function(index1, h2) {
18+
var h2_parent = $(h2).parent();
19+
var sections_found = 0;
20+
// find headers for the sections (Core, Library, etc.)
21+
h2_parent.find('h3').each(function(index2, h3) {
22+
var h3_parent = $(h3).parent();
23+
var entries_found = 0;
24+
// find all the entries
25+
h3_parent.find('li').each(function(index3, li) {
26+
var li = $(li);
27+
// check if the query matches the entry
28+
if (query.test(li.text())) {
29+
li.show();
30+
entries_found++;
31+
}
32+
else {
33+
li.hide();
34+
}
35+
});
36+
// if there are entries, show the section, otherwise hide it
37+
if (entries_found > 0) {
38+
h3_parent.show();
39+
sections_found++;
40+
}
41+
else {
42+
h3_parent.hide();
43+
}
44+
});
45+
if (sections_found > 0)
46+
h2_parent.show();
47+
else
48+
h2_parent.hide();
49+
});
50+
}
51+
$('#searchbox').keyup(dofilter);
52+
$('#searchbox-submit').click(dofilter);
53+
});

Doc/tools/static/copybutton.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

Doc/tools/static/py.png

-695 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)