Skip to content

Revert: Remove the book.multilingual field and don't serialize it #2689

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

Merged
merged 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/nop-preprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ mod nop_lib {
"book": {
"authors": ["AUTHOR"],
"language": "en",
"multilingual": false,
"src": "src",
"title": "TITLE"
},
Expand Down
8 changes: 8 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ pub struct BookConfig {
pub description: Option<String>,
/// Location of the book source relative to the book's root directory.
pub src: PathBuf,
/// Does this book support more than one language?
// TODO: Remove this field in 0.5, it is unused:
// https://github.com/rust-lang/mdBook/issues/2636
#[serde(skip_serializing)]
pub multilingual: bool,
/// The main language of the book.
pub language: Option<String>,
/// The direction of text in the book: Left-to-right (LTR) or Right-to-left (RTL).
Expand All @@ -434,6 +439,7 @@ impl Default for BookConfig {
authors: Vec::new(),
description: None,
src: PathBuf::from("src"),
multilingual: false,
language: Some(String::from("en")),
text_direction: None,
}
Expand Down Expand Up @@ -817,6 +823,7 @@ mod tests {
title = "Some Book"
authors = ["Michael-F-Bryan <[email protected]>"]
description = "A completely useless book"
multilingual = true
src = "source"
language = "ja"

Expand Down Expand Up @@ -855,6 +862,7 @@ mod tests {
title: Some(String::from("Some Book")),
authors: vec![String::from("Michael-F-Bryan <[email protected]>")],
description: Some(String::from("A completely useless book")),
multilingual: true,
src: PathBuf::from("source"),
language: Some(String::from("ja")),
text_direction: None,
Expand Down