Press Ctrl-F (or whichever "search in page" shortcut)
The first result is about a quarter of the page in, but I don't see a match. Weird. Press enter again for the next match.
Still an invisible/hidden match. I have to press enter a few more times to get taken to the index, the visible result I want.
Another way to look at it is that the search on godoc.org results in 6 matches, but the same search results in 10 matches on pkgsite. The first four matches are hidden, which make up for the difference with godoc.org.
Can we get rid of those four hidden matches altogether? Especially since they somehow match before the index, which is very close to the top.
The text was updated successfully, but these errors were encountered:
There isn't a simple way to get rid of the hidden matches but I think the best solution here is to make the hidden content visible because it does contain the text from the search. For your particular use case using the jump to Identifier feature by pressing the 'F' key would get you to the function right away.
Hm. I can live with using F instead of ^F, though I admit that will be fairly painful as it's hard to retrain muscle memory. It's unfortunate that the plain page search is less useful in pkgsite compared to godoc - I'm surprised that there is no way to make hidden content not match page search, or to just not have the hidden text be present in the HTML at all.
I like being able to search through all the text without having to expand the readme but do see your point. I'd like to merge this for now so that the experience doesn't feel completely broken and add @Joanne881107 @fflewddur for product / UX input.
We could keep the hidden content out of text search by picking a split point within the readme (maybe the second heading for markdown files and N characters/words/lines for text files) then rendering the two sections in separate elements with the second hidden from the page. This would mean the collapsed section size will vary but it would create a cleaner break within the readme section.
The answer is under the Checker type, but because the expanded README also contains a heading/description for it, it's confusing.
Forcing all users to use the F shortcut to ignore the README is an option, but not a very good one. I still think that mixing in the entire README with the rendered docs isn't a very good idea. At minimum, if I'm looking at the README, it should be entirely clear that it's not rendered godoc. Ideally, the README should only render in full if I explicitly expand it.