Fix main site search to show sphinx domain docstrings
{% endfor %}
{% elif 'page' in result.meta.index %}
+ {% with "100" as MAX_SUBSTRING_LIMIT %}
<a href="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }}">
{{ result.project }} - {% if result.meta.highlight.title %} {{ result.meta.highlight.title.0|safe }} {% else %} {{ result.title }} {% endif %}
</a>
{% for inner_hit in result.meta.inner_hits %}
{% if inner_hit.type == 'domains' %}
<p>
- <a href="{% doc_url result.project|get_project result.version inner_hit.source.doc_name %}?highlight= {{ query }}#{{ inner_hit.source.anchor }}">
-
- {% if inner_hit.source.display_name|length >= 1 %}
- ({{ inner_hit.source.role_name }}) {{ inner_hit.source.display_name}}
+ <a href="{% doc_url result.project|get_project result.version result.full_path %}?highlight= {{ query }}#{{ inner_hit.source.anchor }}">
+ {% if inner_hit.highlight|get_key_or_none:"domains.name" %}
+ {% with domain_name=inner_hit.highlight|get_key_or_none:"domains.name" %}
+ [{{ inner_hit.source.role_name }}]: {{ domain_name.0|safe }}
+ {% endwith %}
{% else %}
- {{ inner_hit.source.role_name }}
+ [{{ inner_hit.source.role_name }}]: {{ inner_hit.source.name }}
{% endif %}
</a>
</p>
<p class="fragment">
- {% if inner_hit.highlight|get_key_or_none:"domains.name" %}
- {% with domain_name=inner_hit.highlight|get_key_or_none:"domains.name" %}
- {{ inner_hit.source.type_display }} -- {{ domain_name.0|safe }} -- in {{ inner_hit.source.doc_display }}
+ {% if inner_hit.highlight|get_key_or_none:"domains.docstrings" %}
+ {% with domain_docstrings=inner_hit.highlight|get_key_or_none:"domains.docstrings" %}
+ {{ domain_docstrings.0|safe }}
{% endwith %}
{% else %}
- {{ inner_hit.source.type_display }} -- {{ inner_hit.source.name }} -- {{ inner_hit.source.doc_display }}
+ {% if inner_hit.source.docstrings %}
+ {{ inner_hit.source.docstrings|slice:MAX_SUBSTRING_LIMIT }} ...
+ {% endif %}
{% endif %}
</p>
{% endwith %}
{% else %}
<p class="fragment">
- {% with "100" as MAX_SUBSTRING_LIMIT %}
{{ inner_hit.source.content|slice:MAX_SUBSTRING_LIMIT }} ...
- {% endwith %}
</p>
{% endif %}
{% endif %}
{% endfor %}
+ {% endwith %}
{% endif %}
</p>
</li>
