diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-04-21 10:33:45 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 10:33:45 -0600 |
commit | 45ee22fa2fdd2bace756ed62685a346da91c4cb2 (patch) | |
tree | 5f910fd945373cdee9d1902771dc5b3289197eb1 | |
parent | 76aa47df078ca4f546487642635b12baca34d775 (diff) | |
parent | 3c6e8e1293f42d100755a9a24161d3511d5bc28b (diff) | |
download | numpy-45ee22fa2fdd2bace756ed62685a346da91c4cb2.tar.gz |
Merge pull request #10943 from alexthomas93/master
ENH: Add a search box to the sidebar in the docs
-rw-r--r-- | doc/source/_templates/searchbox.html | 23 | ||||
-rw-r--r-- | doc/source/conf.py | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/doc/source/_templates/searchbox.html b/doc/source/_templates/searchbox.html new file mode 100644 index 000000000..d5ac2db5e --- /dev/null +++ b/doc/source/_templates/searchbox.html @@ -0,0 +1,23 @@ +{# + basic/searchbox.html + ~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: quick search box. + + :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- if pagename != "search" and builder != "singlehtml" %} +<div id="searchbox" style="display: none" role="search"> + <h4>{{ _('Quick search') }}</h4> + <div> + <form class="search" action="{{ pathto('search') }}" method="get"> + <input type="text" style="width: inherit;" name="q" /> + <input type="submit" value="{{ _('search') }}" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + </div> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> +{%- endif %} diff --git a/doc/source/conf.py b/doc/source/conf.py index fd8a8e551..1472f5155 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -115,7 +115,7 @@ else: "scipy_org_logo": False, "rootlinks": [] } - html_sidebars = {'index': 'indexsidebar.html'} + html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']} html_additional_pages = { 'index': 'indexcontent.html', |