Skip to content

Commit c9ddb4d

Browse files
committed
Revert: Remove the book.multilingual field
This reverts #2646 because I overlooked that this is a public field in a public struct, which would be a breaking API change.
1 parent 17b1976 commit c9ddb4d

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

examples/nop-preprocessor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ mod nop_lib {
117117
"book": {
118118
"authors": ["AUTHOR"],
119119
"language": "en",
120+
"multilingual": false,
120121
"src": "src",
121122
"title": "TITLE"
122123
},

src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ pub struct BookConfig {
420420
pub description: Option<String>,
421421
/// Location of the book source relative to the book's root directory.
422422
pub src: PathBuf,
423+
/// Does this book support more than one language?
424+
pub multilingual: bool,
423425
/// The main language of the book.
424426
pub language: Option<String>,
425427
/// The direction of text in the book: Left-to-right (LTR) or Right-to-left (RTL).
@@ -434,6 +436,7 @@ impl Default for BookConfig {
434436
authors: Vec::new(),
435437
description: None,
436438
src: PathBuf::from("src"),
439+
multilingual: false,
437440
language: Some(String::from("en")),
438441
text_direction: None,
439442
}
@@ -817,6 +820,7 @@ mod tests {
817820
title = "Some Book"
818821
authors = ["Michael-F-Bryan <[email protected]>"]
819822
description = "A completely useless book"
823+
multilingual = true
820824
src = "source"
821825
language = "ja"
822826
@@ -855,6 +859,7 @@ mod tests {
855859
title: Some(String::from("Some Book")),
856860
authors: vec![String::from("Michael-F-Bryan <[email protected]>")],
857861
description: Some(String::from("A completely useless book")),
862+
multilingual: true,
858863
src: PathBuf::from("source"),
859864
language: Some(String::from("ja")),
860865
text_direction: None,

tests/testsuite/init.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ All done, no errors...
2828
[book]
2929
authors = []
3030
language = "en"
31+
multilingual = false
3132
src = "src"
3233
3334
"#]],
@@ -94,6 +95,7 @@ All done, no errors...
9495
[book]
9596
authors = []
9697
language = "en"
98+
multilingual = false
9799
src = "src"
98100
99101
"#]],
@@ -127,6 +129,7 @@ All done, no errors...
127129
[book]
128130
authors = []
129131
language = "en"
132+
multilingual = false
130133
src = "src"
131134
title = "Example title"
132135
@@ -179,6 +182,7 @@ fn init_with_custom_book_and_src_locations() {
179182
[book]
180183
authors = []
181184
language = "en"
185+
multilingual = false
182186
src = "in"
183187
184188
[build]

tests/testsuite/renderer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ fn backends_receive_render_context_via_stdin() {
188188
"book": {
189189
"authors": [],
190190
"language": "en",
191+
"multilingual": false,
191192
"src": "src"
192193
},
193194
"output": {

0 commit comments

Comments
 (0)