I've done some research into this, so I'll reply to my own email:
To modify the search output, you can modify the _static/searchtools.js
file in your output directory. If you look at around line#483 of that
file in a text editor, you can see that it looks in the _source
directory and crawls the ".txt" files for the search term. You can
change that javascript so it crawls the .html files instead, but the
same problem will occur: raw html tags will be included in the result
summary.
You can remove the summary and just show the page name by commenting
line#486:
//listItem.append($.makeSearchSummary(data, searchterms, hlterms));
I hope this info helps someone else down the line.
Thanks!
-jeff
On 11-04-20 1:40 PM, Jeff McKenna wrote:
I was about to ask the same question as Chris: how to not show the raw
restructured text in Sphinx's search results. If an html snippet can't
be shown instead, can I customize the search results to only show the
page heading name? (I found one site that does not show the restructured
text, but shows the page's heading name instead:
http://docs.geoserver.org/stable/en/user/search.html?check_keywords=yes&area=default&q=install&x=0&y=0)
Any thoughts on this issue (showing html instead of rst in search
results, or, not showing the rst snippet at all, just the heading)?
-jeff
On 11-04-15 9:21 PM, Chris wrote:
I noticed that on the search result page, the snippets include the
markup used to identify various headings in the .rst files. shouldn't
these be hidden to the end user?
For example:
http://sphinx.pocoo.org/search.html?q=doctest+snippet
shows:
sphinx.ext.doctest – Test snippets in the documentation
.. highlight:: rest :mod:`sphinx.ext.doctest` -- Test snippets in the
documentation
=============================================================== ..
module:: sphinx.ext.doctest :synopsis: Test snippets in the
documentation. .. index...
and
Changes in Sphinx
:tocdepth: 2 .. _changes: Changes in Sphinx ***************** ..
include:: ../CHANGES...
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en.