Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #925 from swryan/work
improved doc search
- Loading branch information
Showing
4 changed files
with
710 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{# | ||
basic/searchbox.html | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Sphinx sidebar template: quick search box. | ||
|
||
:copyright: Copyright 2007-2019 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"> | ||
<h3>{{ _('Search OpenMDAO') }}</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="{{ pathto('search') }}" method="get"> | ||
<input type="text" name="q" /> | ||
<input type="submit" value="{{ _('Go') }}" /> | ||
<input type="checkbox" name="search_source" /> Include Source Docs | ||
</form> | ||
</div> | ||
</div> | ||
<script type="text/javascript">$('#searchbox').show(0);</script> | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{# | ||
basic/search.html | ||
~~~~~~~~~~~~~~~~~ | ||
|
||
Template for the search page. | ||
|
||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. | ||
:license: BSD, see LICENSE for details. | ||
#} | ||
{%- extends "layout.html" %} | ||
{% set title = _('Search') %} | ||
{%- block scripts %} | ||
{{ super() }} | ||
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script> | ||
{%- endblock %} | ||
{% block extrahead %} | ||
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}" defer></script> | ||
{{ super() }} | ||
{% endblock %} | ||
{% block body %} | ||
<h1 id="search-documentation">{{ _('Search') }}</h1> | ||
<div id="fallback" class="admonition warning"> | ||
<script type="text/javascript">$('#fallback').hide();</script> | ||
<p> | ||
{% trans %}Please activate JavaScript to enable the search | ||
functionality.{% endtrans %} | ||
</p> | ||
</div> | ||
<p> | ||
{% trans %}From here you can search these documents. Enter your search | ||
words into the box below and click "search". Note that the search | ||
function will automatically search for all of the words. Pages | ||
containing fewer words won't appear in the result list.{% endtrans %} | ||
</p> | ||
<form action="" method="get"> | ||
<input type="text" name="q" value="" /> | ||
<input type="submit" value="{{ _('search') }}" /> | ||
<input type="checkbox" name="search_source" /> Include Source Docs | ||
<span id="search-progress" style="padding-left: 10px"></span> | ||
</form> | ||
{% if search_performed %} | ||
<h2>{{ _('Search Results') }}</h2> | ||
{% if not search_results %} | ||
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p> | ||
{% endif %} | ||
{% endif %} | ||
<div id="search-results"> | ||
{% if search_results %} | ||
<ul> | ||
{% for href, caption, context in search_results %} | ||
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a> | ||
<div class="context">{{ context|e }}</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.