File tree Expand file tree Collapse file tree 4 files changed +21
-13
lines changed
theme/copy_fonts_false_no_theme Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -323,19 +323,6 @@ fn custom_fonts() {
323323 contents. contains ( "fonts/fonts.css" )
324324 } ;
325325
326- // copy-fonts=false, no theme
327- // This should generate a deprecation warning.
328- let temp = TempFileBuilder :: new ( ) . prefix ( "mdbook" ) . tempdir ( ) . unwrap ( ) ;
329- let p = temp. path ( ) ;
330- MDBook :: init ( p) . build ( ) . unwrap ( ) ;
331- let config = Config :: from_str ( "output.html.copy-fonts = false" ) . unwrap ( ) ;
332- MDBook :: load_with_config ( p, config)
333- . unwrap ( )
334- . build ( )
335- . unwrap ( ) ;
336- assert ! ( !has_fonts_css( p) ) ;
337- assert ! ( !p. join( "book/fonts" ) . exists( ) ) ;
338-
339326 // copy-fonts=false with empty fonts.css
340327 let temp = TempFileBuilder :: new ( ) . prefix ( "mdbook" ) . tempdir ( ) . unwrap ( ) ;
341328 let p = temp. path ( ) ;
Original file line number Diff line number Diff line change @@ -137,3 +137,21 @@ book/fonts/myfont.woff
137137"# ] ] ,
138138 ) ;
139139}
140+
141+ // copy-fonts=false, no theme, deprecated
142+ #[ test]
143+ fn copy_fonts_false_no_theme ( ) {
144+ BookTest :: from_dir ( "theme/copy_fonts_false_no_theme" )
145+ . run ( "build" , |cmd| {
146+ cmd. expect_stderr ( str![ [ r#"
147+ [TIMESTAMP] [INFO] (mdbook::book): Book building has started
148+ [TIMESTAMP] [INFO] (mdbook::book): Running the html backend
149+ [TIMESTAMP] [WARN] (mdbook::renderer::html_handlebars::static_files): output.html.copy-fonts is deprecated.
150+ This book appears to have copy-fonts=false in book.toml without a fonts.css file.
151+ Add an empty `theme/fonts/fonts.css` file to squelch this warning.
152+
153+ "# ] ] ) ;
154+ } )
155+ . check_file_doesnt_contain ( "book/index.html" , "fonts.css" )
156+ . check_file_list ( "book/fonts" , str![ [ "" ] ] ) ;
157+ }
Original file line number Diff line number Diff line change 1+ [output .html ]
2+ copy-fonts = false
Original file line number Diff line number Diff line change 1+ - [ Intro] ( index.md )
You can’t perform that action at this time.
0 commit comments