Merge pull request #2646 from szabgab/remove-multilingual

Remove the book.multilingual field
This commit is contained in:
Eric Huss 2025-04-08 15:41:55 +00:00 committed by GitHub
commit c85c3eb292
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 8 deletions

View file

@ -117,7 +117,6 @@ mod nop_lib {
"book": { "book": {
"authors": ["AUTHOR"], "authors": ["AUTHOR"],
"language": "en", "language": "en",
"multilingual": false,
"src": "src", "src": "src",
"title": "TITLE" "title": "TITLE"
}, },

View file

@ -420,8 +420,6 @@ pub struct BookConfig {
pub description: Option<String>, pub description: Option<String>,
/// Location of the book source relative to the book's root directory. /// Location of the book source relative to the book's root directory.
pub src: PathBuf, pub src: PathBuf,
/// Does this book support more than one language?
pub multilingual: bool,
/// The main language of the book. /// The main language of the book.
pub language: Option<String>, pub language: Option<String>,
/// The direction of text in the book: Left-to-right (LTR) or Right-to-left (RTL). /// The direction of text in the book: Left-to-right (LTR) or Right-to-left (RTL).
@ -436,7 +434,6 @@ impl Default for BookConfig {
authors: Vec::new(), authors: Vec::new(),
description: None, description: None,
src: PathBuf::from("src"), src: PathBuf::from("src"),
multilingual: false,
language: Some(String::from("en")), language: Some(String::from("en")),
text_direction: None, text_direction: None,
} }
@ -820,7 +817,6 @@ mod tests {
title = "Some Book" title = "Some Book"
authors = ["Michael-F-Bryan <michaelfbryan@gmail.com>"] authors = ["Michael-F-Bryan <michaelfbryan@gmail.com>"]
description = "A completely useless book" description = "A completely useless book"
multilingual = true
src = "source" src = "source"
language = "ja" language = "ja"
@ -859,7 +855,6 @@ mod tests {
title: Some(String::from("Some Book")), title: Some(String::from("Some Book")),
authors: vec![String::from("Michael-F-Bryan <michaelfbryan@gmail.com>")], authors: vec![String::from("Michael-F-Bryan <michaelfbryan@gmail.com>")],
description: Some(String::from("A completely useless book")), description: Some(String::from("A completely useless book")),
multilingual: true,
src: PathBuf::from("source"), src: PathBuf::from("source"),
language: Some(String::from("ja")), language: Some(String::from("ja")),
text_direction: None, text_direction: None,

View file

@ -29,7 +29,7 @@ fn base_mdbook_init_should_create_default_content() {
let contents = fs::read_to_string(temp.path().join("book.toml")).unwrap(); let contents = fs::read_to_string(temp.path().join("book.toml")).unwrap();
assert_eq!( assert_eq!(
contents, contents,
"[book]\nauthors = []\nlanguage = \"en\"\nmultilingual = false\nsrc = \"src\"\n" "[book]\nauthors = []\nlanguage = \"en\"\nsrc = \"src\"\n"
); );
} }
@ -94,7 +94,7 @@ fn run_mdbook_init_with_custom_book_and_src_locations() {
let contents = fs::read_to_string(temp.path().join("book.toml")).unwrap(); let contents = fs::read_to_string(temp.path().join("book.toml")).unwrap();
assert_eq!( assert_eq!(
contents, contents,
"[book]\nauthors = []\nlanguage = \"en\"\nmultilingual = false\nsrc = \"in\"\n\n[build]\nbuild-dir = \"out\"\ncreate-missing = true\nextra-watch-dirs = []\nuse-default-preprocessors = true\n" "[book]\nauthors = []\nlanguage = \"en\"\nsrc = \"in\"\n\n[build]\nbuild-dir = \"out\"\ncreate-missing = true\nextra-watch-dirs = []\nuse-default-preprocessors = true\n"
); );
} }