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

search not working #18

Closed
jrappen opened this issue Feb 18, 2019 · 5 comments
Closed

search not working #18

jrappen opened this issue Feb 18, 2019 · 5 comments

Comments

@jrappen
Copy link

jrappen commented Feb 18, 2019

Search didn't work for me. Reverting commit linked below:

jrappen/sublime-wkhtmltopdf@9fcc5b1

Any suggestions?

@jhildenbiddle
Copy link
Owner

Hi @jrappen.

Based on what I see at https://jrappen.github.io/sublime-wkhtmltopdf/ I assume "didn't work for me" means the search box is visible but no results are returned. Yes?

If this is the case, the explanation is that docsify's search plugin is designed to return search results for multi-page sites only. I assume the logic behind that decision is that if all site data is contained on the page the user is looking at, the browser's built-in page search can be used instead via CMD/CTRL+F.

If you would like the search plugin to work on single-page sites consider creating a docsify issue.

Thanks!

@jrappen
Copy link
Author

jrappen commented Feb 21, 2019

Interesting, it used to work (even across translations).

For example a search for "installation" would return both matches, one each from the German and English translation.

@jrappen
Copy link
Author

jrappen commented Feb 21, 2019

thanks for the input

@jhildenbiddle
Copy link
Owner

That is interesting. I didn't realize it worked in the past.

After doing a little more digging, it looks like single-page search functionality was broken in the 4.8.0 release. The easiest way to verify:

  1. Load a single-page docsify site with docsify v4.8 or above
  2. Notice the absence of docsify.search keys in the browser's local storage
  3. Load the same single-page docsify site with docsify v4.7.x
  4. Notice the docsify.search.expires and docsify.search.index entries have been added to the browser's local storage.

@timaschew
Copy link

I guess this is the reason: docsifyjs/docsify#706

Another reason to add tests and merge new features and changes only with tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants