1

From this thread I understood how search in sphinx is built up when the doc is built.

However, I am wondering if:

  1. is there a way to show all the searched keywords within the same page (not only the first one), and
  2. if the searched keyword is inside a subsection, is it possible to have a direct link to it rather than to the main chapter in the search results?

Particularly, as for point 2., it is hard to find the keyword if the page is lengthy and the keyword is far from the top.

EDIT1

Just to clarify what I have now...

Take this search for instance. The seached term ("widget") is only returned once per page (i.e. chapter), while there are plenty of this same term repeated in the same page. I wish the search could give all of them. And possibly, a link to the subsection where they occur, rather than only the link to the chapter.

I am using the "sphinx_rtd_theme" theme if that makes any difference.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
umbe1987
  • 2,894
  • 6
  • 35
  • 63
  • Do you mean something like this, where the keywords are "cookiecutter" and "project", which is the default search in Sphinx? https://docs.pylonsproject.org/projects/pyramid/en/latest/search.html?q=cookiecutter+project&check_keywords=yes&area=default – Steve Piercy Dec 14 '17 at 19:20
  • @StevePiercy I meant something different. Take [this search](http://geomaster.it/help4/search.html?q=widget&check_keywords=yes&area=default) for instance. The seached term ("widget") is only returned once per page, while there are plenty of this same terms repeated in the same page. I wish the search could give all of them. And possibly, a link to the subsection where they occur, rather than only the link to the chapther. I'll edit the question with these info. – umbe1987 Dec 18 '17 at 14:15
  • 1
    Similar to what you are describing: https://github.com/sphinx-doc/sphinx/issues/2930#issuecomment-244133686 – mzjn Dec 18 '17 at 15:11

0 Answers0