@@ -251,10 +251,12 @@ impl Step for TheBook {
251
251
///
252
252
/// * Book (first edition)
253
253
/// * Book (second edition)
254
+ /// * Version info and CSS
254
255
/// * Index page
255
256
/// * Redirect pages
256
257
fn run ( self , builder : & Builder ) {
257
258
let build = builder. build ;
259
+ let compiler = self . compiler ;
258
260
let target = self . target ;
259
261
let name = self . name ;
260
262
// build book first edition
@@ -269,10 +271,16 @@ impl Step for TheBook {
269
271
name : INTERNER . intern_string ( format ! ( "{}/second-edition" , name) ) ,
270
272
} ) ;
271
273
274
+ // build the version info page and CSS
275
+ builder. ensure ( Standalone {
276
+ compiler,
277
+ target,
278
+ } ) ;
279
+
272
280
// build the index page
273
281
let index = format ! ( "{}/index.md" , name) ;
274
282
println ! ( "Documenting book index ({})" , target) ;
275
- invoke_rustdoc ( builder, self . compiler , target, & index) ;
283
+ invoke_rustdoc ( builder, compiler, target, & index) ;
276
284
277
285
// build the redirect pages
278
286
println ! ( "Documenting book redirect pages ({})" , target) ;
@@ -281,7 +289,7 @@ impl Step for TheBook {
281
289
let path = file. path ( ) ;
282
290
let path = path. to_str ( ) . unwrap ( ) ;
283
291
284
- invoke_rustdoc ( builder, self . compiler , target, path) ;
292
+ invoke_rustdoc ( builder, compiler, target, path) ;
285
293
}
286
294
}
287
295
}
@@ -294,25 +302,12 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned<String
294
302
295
303
let favicon = build. src . join ( "src/doc/favicon.inc" ) ;
296
304
let footer = build. src . join ( "src/doc/footer.inc" ) ;
297
-
298
- let version_input = build. src . join ( "src/doc/version_info.html.template" ) ;
299
305
let version_info = out. join ( "version_info.html" ) ;
300
306
301
- if !up_to_date ( & version_input, & version_info) {
302
- let mut info = String :: new ( ) ;
303
- t ! ( t!( File :: open( & version_input) ) . read_to_string( & mut info) ) ;
304
- let info = info. replace ( "VERSION" , & build. rust_release ( ) )
305
- . replace ( "SHORT_HASH" , build. rust_info . sha_short ( ) . unwrap_or ( "" ) )
306
- . replace ( "STAMP" , build. rust_info . sha ( ) . unwrap_or ( "" ) ) ;
307
- t ! ( t!( File :: create( & version_info) ) . write_all( info. as_bytes( ) ) ) ;
308
- }
309
-
310
307
let mut cmd = builder. rustdoc_cmd ( compiler. host ) ;
311
308
312
309
let out = out. join ( "book" ) ;
313
310
314
- t ! ( fs:: copy( build. src. join( "src/doc/rust.css" ) , out. join( "rust.css" ) ) ) ;
315
-
316
311
cmd. arg ( "--html-after-content" ) . arg ( & footer)
317
312
. arg ( "--html-before-content" ) . arg ( & version_info)
318
313
. arg ( "--html-in-header" ) . arg ( & favicon)
@@ -321,7 +316,7 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned<String
321
316
. arg ( "-o" ) . arg ( & out)
322
317
. arg ( & path)
323
318
. arg ( "--markdown-css" )
324
- . arg ( "rust.css" ) ;
319
+ . arg ( "../ rust.css" ) ;
325
320
326
321
build. run ( & mut cmd) ;
327
322
}
0 commit comments