Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

Include page name in links to sections in search results

Open waldyrious opened this issue 7 years ago • 4 comments

When I make a search for a given term, the results are pretty complete, but since the links are aliased to the title of the target block (page, section, function, etc.), there are often several entries in the search results list that have the same name. This means that the only way to distinguish them is to hover the links and see where they point to.

As an example, the search https://docs.julialang.org/en/latest/search/?q=markdown outputs the following list:

Number of results: 12

Instead, I'd find something like the following more helpful:

Number of results: 12

This would be consistent with how functions are already namespaced with their corresponding module name. Would this change be desirable?


Some unrelated notes (I might open separate issues to track them):

  • Why wasn't the "Markdown" page ranked as the first result?
  • Shouldn't the links to the title "sections" in the pages of the same name be omitted? E.g. Markdown § Markdown and Documentation § Documentation
  • The lack of a space between the link and the tag saying "section", "page", etc. makes the rendered page inappropriate for copy-pasting. It's a very minor issue, for sure, but I don't see why one wouldn't render an actual typographical space there.
  • Shouldn't the "function" tag be lowercase, like the other ones?

waldyrious avatar Feb 02 '18 12:02 waldyrious

:+1: to all the points, thanks for writing them up! Implementing them is up for grabs though.

mortenpi avatar Feb 03 '18 22:02 mortenpi

Thanks for confirming. I'll open separate issues for the items at the bottom, and will look at whether I can submit fixes to some of them.

edit: I also rephrased the title of this issue to make it clearer what action is being proposed.

waldyrious avatar Feb 04 '18 09:02 waldyrious

+1 to this. Perhaps an apt example is the repeated identical results for repeat, from different sections: https://docs.julialang.org/en/v1/search/?q=repeat

For formatting, I'd go with something like this:

IanButterworth avatar Dec 05 '19 15:12 IanButterworth

x-ref so a similar suggestion: https://github.com/JuliaDocs/Documenter.jl/issues/1038

IanButterworth avatar Dec 08 '19 20:12 IanButterworth