-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
feat: simple filtering / searching on bibliography #2523
Conversation
I will try to test it this weekend. Question:
Why? |
In contrast to the Ctrl-k search, this one is a bit "hacky". It operates on the HTML DOM rather than on a pretty JSON structure. I was a bit scared that the search could slow down the browser while typing. Waiting 300ms before starting to search reduces unnecessary workload. Without that, the search would be triggered with every key up while typing the search term. E.g, typing "mechan" would trigger the filtering 6 times. With normal typing speed below 300ms, only one filtering is triggered. 300ms seems to be fast enough for me to not get bored. I do not even feel this delay. I'm open to change this if anyone thinks it is unnecessary.
This is something that I would also like to have. Unfortunately, I have no idea how to do this. Help is appreciated here. Or we leave it for a future PR. Also, the filter currently searches in "hidden" texts like abstract or bibtex. Should they be opened automatically? |
I found a very cool library that was easy to integrate and does exactly what we are looking for (ref: highlight-search-term). Pro:
Con:
What do you think? |
…ains more than a single text node. fixed.
Update. I integrated Also, I set the old non-highlighting filter function as a fallback in case the browser does not support the API. I'm pretty happy (=done) with the code now. One question left: Can we somehow enable ES6 support in Uglifier (that is the reason why the checks did not pass)? Or do we really want to stay with old ES5 syntax? |
I will try to take a proper look at this this weekend. |
Thank you, @george-gca. Looking forward to hear your opinion on this PR. About the failed check: We can change |
I changed ES6 syntax to ES5 compatible syntax so that Uglifier does not fail. In the future, it would be nice to allow ES6 Syntax, see #2548. @george-gca: is there anything else I can do to push this forward? |
I just need to make some time to look throught this PR. I'll do it this weekend for sure. |
Sorry for the delay on this. This is a very nice addition indeed.
I think so. Some code updates might be needed, but it would be nice to keep it as up-to-date as possible with the latest best practices. There was also a huge effort (#741) to update some of the dependencies of the template (aka bootstrap), but that was never finished. I hope someday I will have the time to tackle this before it gets more difficult to do it. Maybe you could help on some of these?
I believe it is a better idea to create a way to easily disable it, like a setting in |
Nice idea. Introduced with 07d6e61 |
Thanks for the contribution. It is always nice when a lot more people contribute to the project. |
This PR adds a simple filter/search functionality to the bibliography.
It can be used in two ways:
location.hash
, e.g., https://alshedivat.github.io/al-folio/publications/#mechanicsNotes:
hash
works without the search box. My idea is to use this functionality to index all BibTeX entries via thectrl-k
search and link them via their BibTeX key.hash
could also be used to set static links on the current page, e.g., to filter specific co-authors, venues, etc.bib.liquid
. E.g., it is possible to search for BibTeX keys, titles, authors, years, venues, abstracts, or whateverbib.liquid
prints.Screenshot
Looking for feedback.