copier icon indicating copy to clipboard operation
copier copied to clipboard

Remove source files in search on <https://copier.readthedocs.io>

Open InAnYan opened this issue 11 months ago • 4 comments

Actual Situation

I was searching in copier docs and found that source code of the copier is included.

I didn't expect that. I thought https://copier.readthedocs.io is just a website for showcasing the copier and documentation. Is this expected behavior?

I've read docs of many packages on readthedocs.io and I never found a package that would include source code in the search results.

Desired Situation

Either:

  1. Say that this is desired behavior -- I'm not pushing, it's totally your choice.
  2. Or remove source code from search results. As an alternative there is already GitHub

Proposed solution

No response

InAnYan avatar Mar 13 '25 10:03 InAnYan

Thanks for the report @InAnYan. It might be possible to exclude source code blocks from search by setting a data-search-exclude HTML attribute on the right elements: https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/#search-exclusion.

pawamoy avatar Mar 13 '25 10:03 pawamoy

Do you mean you literally searched for copier on the docs? Can you post a screenshot of the source code you saw in the search results? Just to make sure I understand correctly.

pawamoy avatar Mar 13 '25 10:03 pawamoy

Image

(Marks mean that I, as a user, expected this)

While my issue description contains subjective opinion, here is just in case an objective objection 😄 :

  • FULL source code of a file is included in the results. Every statement! Source file can be quite big. What if it hides some real and useful search result?

InAnYan avatar Mar 13 '25 10:03 InAnYan

Thanks!

FULL source code of a file is included in the results. Every statement! Source file can be quite big.

Yeah that's not good 😄 In this case it's a single (big) class, but yeah, it shouldn't appear there, especially since there are contents before it in the relevant page.

pawamoy avatar Mar 13 '25 11:03 pawamoy