cpython: 274b25cd501f (original) (raw)
Mercurial > cpython
changeset 103456:274b25cd501f 3.5
Issue #19489: Move the search box from sidebar to header and footer. [#19489]
Zachary Ware zachary.ware@gmail.com | |
---|---|
date | Fri, 09 Sep 2016 13:11:27 -0700 |
parents | ab1e10e3dc35 |
children | 0f94a8fa5445 8927417c5e88 |
files | Doc/conf.py Doc/tools/pydoctheme/static/pydoctheme.css Doc/tools/templates/customsourcelink.html Doc/tools/templates/layout.html |
diffstat | 4 files changed, 45 insertions(+), 11 deletions(-)[+] [-] Doc/conf.py 5 Doc/tools/pydoctheme/static/pydoctheme.css 11 Doc/tools/templates/customsourcelink.html 10 Doc/tools/templates/layout.html 30 |
line wrap: on
line diff
--- a/Doc/conf.py +++ b/Doc/conf.py @@ -60,7 +60,10 @@ templates_path = ['tools/templates']
Custom sidebar templates, filenames relative to this file.
http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars[](#l1.8)
Defaults taken fromRemoves the quick search block
- '**': ['localtoc.html', 'relations.html', 'customsourcelink.html'],
- 'index': ['indexsidebar.html'],
Additional templates that should be rendered to pages.
--- a/Doc/tools/pydoctheme/static/pydoctheme.css +++ b/Doc/tools/pydoctheme/static/pydoctheme.css @@ -22,6 +22,16 @@ div.related:first-child { border-bottom: 1px solid #ccc; } +.inline-search {
+} +form.inline-search input {
+} +form.inline-search input[type="submit"] {
+} + div.sphinxsidebar { background-color: #eeeeee; border-radius: 5px; @@ -45,6 +55,7 @@ div.sphinxsidebar a:hover { color: #0095C4; } +form.inline-search input, div.sphinxsidebar input { font-family: 'Lucida Grande',Arial,sans-serif; border: 1px solid #999999;
new file mode 100644 --- /dev/null +++ b/Doc/tools/templates/customsourcelink.html @@ -0,0 +1,10 @@ +{%- if show_source and has_source and sourcename %}
- [](#l3.6)
{{ _('This Page') }}
[](#l3.7)- [](#l3.8)
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li>[](#l3.9)
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"[](#l3.10)
rel="nofollow">{{ _('Show Source') }}</a></li>[](#l3.11)
--- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -12,8 +12,28 @@ {%- endif %} {% endblock %} +{%- macro searchbox() %} +{# modified from sphinx/themes/basic/searchbox.html #}
- [](#l4.9)
<form class="inline-search" action="{{ pathto('search') }}" method="get">[](#l4.10)
<input placeholder="{{ _('Quick search') }}" type="text" name="q" />[](#l4.11)
<input type="submit" value="{{ _('Go') }}" />[](#l4.12)
<input type="hidden" name="check_keywords" value="yes" />[](#l4.13)
<input type="hidden" name="area" value="default" />[](#l4.14)
</form>[](#l4.15)
- [](#l4.16)
- [](#l4.17)
+{%- endmacro %} {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} +{% block relbaritems %}
- {%- if pagename != "search" and builder != "singlehtml" %}
- [](#l4.23)
{{ searchbox() }}[](#l4.24)
{{ reldelim2 }}[](#l4.25)
[](#l4.26)
- {%- endif %}
+{% endblock %} {% block extrahead %} {% if not embedded %}{% endif %} @@ -90,13 +110,3 @@ {% trans sphinx_version=sphinx_version|e %}Created using Sphinx {{ sphinx_version }}.{% endtrans %} {% endblock %} -{% block sidebarsourcelink %} -{%- if show_source and has_source and sourcename %} -