mdBook
mdBook copied to clipboard
Add non-English search support
This PR implements the search-non-english
feature, inspired by #1496.
Configure book.language
like this:
[book]
author = ["The Rust Project Developers", "Pure White."]
title = "Rust 秘典(死灵书)"
description = "Unsafe Rust 的黑魔法指南"
language = "zh-Hans"
and with search-non-english
feature enabled, mdBook would choose the search indexing implementation based on the language config.
You can use this repo to try it out, or preview the search functionality online!
language
config should follow lang - HTML: HyperText Markup Language | MDN > Language tag syntax.
Currently supported languages can be found in the languages
section of elasticlunr-rs
's feature flag list
~Note: teaser is still buggy (at least for Chinese).~