mdBook
mdBook copied to clipboard
Non-English search support
#1081 has been stuck for a while, so I tried implementing my own version.
Preview the search functionality online
Inspired by #1496.
Major implementation steps:
- [ ] Land #2392
- [x] Fix buggy teaser (preview) ^1
- [x] Keyword highlighting doesn't work as expected for Chinese
- [x] The selected range displayed as teaser sometimes contains no keywords at all (the target chapter does contain the keyword though)
- [ ] Enhance mixed multi language search support
- [x] Implement a "fallback" strategy for text in mixed languages (detail)
- [x] Fix buggy teaser (preview) ^1
- [ ] Support Emoji search
- [ ] Fix
elasticlunr-rs
's indexing implemantation (detail)
- [ ] Fix
- [ ] Localize UI rendered by HTML renderer
Unresolved questions:
- ~~Should
search-non-english
feature be enabled by default?~~ (Not likely, since it causes severe binary size bloat)- Should each supported language have an individual feature flag? Would it make the feature flag list too noisy?
- Should we consider other search solutions than elasticlunr.js & lunr-languages?
- Should the new "fallback" search implementation apply to English books as well?