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

Add non-English search support #2392

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Sunshine40
Copy link

@Sunshine40 Sunshine40 commented May 20, 2024

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).

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 20, 2024
@Sunshine40 Sunshine40 mentioned this pull request May 20, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants