summaryrefslogtreecommitdiff
path: root/Doc/tools/sphinxext/layout.html
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-09-30 15:10:06 +0200
committerGeorg Brandl <georg@python.org>2012-09-30 15:10:06 +0200
commit2cac28b37ef1dfdfc90481cad780c1555c713b04 (patch)
tree1a5db1992453e0af603b453d63ec1b365553a59c /Doc/tools/sphinxext/layout.html
parenteea74276cc1f1478f3d3efc47ddc17db72393287 (diff)
downloadcpython-git-2cac28b37ef1dfdfc90481cad780c1555c713b04.tar.gz
Add a filterable HTML version of Misc/NEWS to the docs "whatsnew" section.
Diffstat (limited to 'Doc/tools/sphinxext/layout.html')
-rw-r--r--Doc/tools/sphinxext/layout.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/tools/sphinxext/layout.html b/Doc/tools/sphinxext/layout.html
index db4a386e89..df728aa16f 100644
--- a/Doc/tools/sphinxext/layout.html
+++ b/Doc/tools/sphinxext/layout.html
@@ -8,6 +8,23 @@
{% block extrahead %}
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" />
{% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
+ {% if pagename == 'whatsnew/news' %}
+ <script type="text/javascript">
+ function dofilter() {
+ var el = document.getElementById('searchbox');
+ var string = el.value.toLowerCase();
+ var litags = document.getElementsByTagName('li')
+ for (var idx = 0; idx < litags.length; idx++) {
+ var li = litags[idx];
+ if (li.innerHTML.toLowerCase().indexOf(string) >= 0) {
+ li.style.display = '';
+ } else {
+ li.style.display = 'none';
+ }
+ }
+ }
+ </script>
+ {% endif %}
{{ super() }}
{% endblock %}
{% block footer %}