Include page name in links to sections in search results
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
- Markdown syntax(section)
- Markdown(page)
- Markdown(section)
- Markdown Syntax Extensions(section)
- InteractiveUtils.varinfo(Function)
- Advanced Usage(section)
- Tables(section)
- Links(section)
- Documentation(section)
- Unicode Input(section)
- Language changes(section)
- Deprecated or removed(section)
Instead, I'd find something like the following more helpful:
Number of results: 12
- Documentation § Markdown syntax(section)
- Markdown(page)
- Markdown § Markdown(section)
- Documentation § Markdown Syntax Extensions(section)
- InteractiveUtils.varinfo(Function)
- Documentation § Advanced Usage(section)
- Documentation § Tables(section)
- Documentation § Links(section)
- Documentation § Documentation(section)
- Unicode Input § Unicode Input(section)
- Julia v0.7.0 Release Notes § Language changes(section)
- Julia v0.7.0 Release Notes § Deprecated or removed(section)
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?
:+1: to all the points, thanks for writing them up! Implementing them is up for grabs though.
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.
+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:
- Base.repeat (method on Strings)
- Base.repeat (method on Strings)
- Base.repeat (function in Array Functions on Arrays)
- Base.:^ (method on Strings)
- Iteration utilities (page)
x-ref so a similar suggestion: https://github.com/JuliaDocs/Documenter.jl/issues/1038