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
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
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 sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
Interesting idea. I did try this but the textbuilder still creates
files with the section header text ("==========") included.
Thanks.
-jeff