Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move encrypted search entries to a separate file (besides seach_index.json) #74

Open
GreggGreen opened this issue Oct 13, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@GreggGreen
Copy link

Screenshot 2024-10-13 at 2 51 10 PM
@GreggGreen
Copy link
Author

GreggGreen commented Oct 13, 2024

  - encryptcontent:
      title_prefix: ''
      password_file: 'pwd.yml'
      password_button: true
      password_button_text: continue
      hljs: False
      arithmatex: False
      mermaid2: False
      search_index: 'dynamically'

@unverbuggt
Copy link
Owner

see here:

The default is 'encrypted', which means all encrypted pages are removed from the search index. So just remove search_index or set it to the default.

@GreggGreen
Copy link
Author

But shouldn't the encrypted pages not show up in the search if you're not logged in, and decrypt when logged in so you can search them? It sounds hard to do so basically all encrypted pages are not searchable?

@unverbuggt
Copy link
Owner

On-the-fly search decryption in 'dynamically' mode works out of the box with the mkdocs theme and some others.

The material theme does include its own search plugin which cannot easily be controlled/modified by this plugin. There are some hacks which require to modify the source code of mkdocs-material and recompiling.

@GreggGreen
Copy link
Author

I was thinking of making the search only kick in after 3 characters, which filters out the encryption pretty good. Just a simple fix.

@unverbuggt
Copy link
Owner

unverbuggt commented Oct 16, 2024

Next time, please be more specific when describing the issue.

Yes, it is bad that the encrypted texts are showing up as search topics. We could modify the normal search plugin (as we are already replacing it) to not show encrypted entries. But as stated, our influence on material's search plugin is limited. You'd have to check the documentation if there is a way to require a minimum amount of characters before results are listed.

But maybe we should keep search entries of encrypted pages in a separate file (besides search/search_index.json) and mix the entries in only after decryption... Let's keep this issue open as a reminder or to discuss this idea.

@unverbuggt unverbuggt changed the title Encrypted Search shouldn't show up Move encrypted search entries to a separate file (besides seach_index.json) Oct 16, 2024
@unverbuggt unverbuggt self-assigned this Oct 16, 2024
@unverbuggt unverbuggt added the enhancement New feature or request label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants