From 3c10b00096f811a720e6076ee0b4624c2a9f551c Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 5 May 2025 14:05:00 -0700 Subject: [PATCH] Skip serializing of the multilingual field This skips serializing of the multilingual field since it is unused, and we plan to remove it in the future. This helps avoid it showing up in `mdbook init`. --- src/config.rs | 3 +++ tests/testsuite/init.rs | 4 ---- tests/testsuite/renderer.rs | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/config.rs b/src/config.rs index db159a45..7ef8bcef 100644 --- a/src/config.rs +++ b/src/config.rs @@ -421,6 +421,9 @@ pub struct BookConfig { /// 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, diff --git a/tests/testsuite/init.rs b/tests/testsuite/init.rs index a5e1e28b..e5989eb6 100644 --- a/tests/testsuite/init.rs +++ b/tests/testsuite/init.rs @@ -28,7 +28,6 @@ All done, no errors... [book] authors = [] language = "en" -multilingual = false src = "src" "#]], @@ -95,7 +94,6 @@ All done, no errors... [book] authors = [] language = "en" -multilingual = false src = "src" "#]], @@ -129,7 +127,6 @@ All done, no errors... [book] authors = [] language = "en" -multilingual = false src = "src" title = "Example title" @@ -182,7 +179,6 @@ fn init_with_custom_book_and_src_locations() { [book] authors = [] language = "en" -multilingual = false src = "in" [build] diff --git a/tests/testsuite/renderer.rs b/tests/testsuite/renderer.rs index e893dd2f..1e162447 100644 --- a/tests/testsuite/renderer.rs +++ b/tests/testsuite/renderer.rs @@ -188,7 +188,6 @@ fn backends_receive_render_context_via_stdin() { "book": { "authors": [], "language": "en", - "multilingual": false, "src": "src" }, "output": {