@@ -205,10 +205,12 @@ impl Step for TheBook {
205
205
///
206
206
/// * Book (first edition)
207
207
/// * Book (second edition)
208
+ /// * Version info and CSS
208
209
/// * Index page
209
210
/// * Redirect pages
210
211
fn run ( self , builder : & Builder ) {
211
212
let build = builder. build ;
213
+ let compiler = self . compiler ;
212
214
let target = self . target ;
213
215
let name = self . name ;
214
216
// build book first edition
@@ -223,10 +225,16 @@ impl Step for TheBook {
223
225
name : INTERNER . intern_string ( format ! ( "{}/second-edition" , name) ) ,
224
226
} ) ;
225
227
228
+ // build the version info page and CSS
229
+ builder. ensure ( Standalone {
230
+ compiler,
231
+ target,
232
+ } ) ;
233
+
226
234
// build the index page
227
235
let index = format ! ( "{}/index.md" , name) ;
228
236
println ! ( "Documenting book index ({})" , target) ;
229
- invoke_rustdoc ( builder, self . compiler , target, & index) ;
237
+ invoke_rustdoc ( builder, compiler, target, & index) ;
230
238
231
239
// build the redirect pages
232
240
println ! ( "Documenting book redirect pages ({})" , target) ;
@@ -235,7 +243,7 @@ impl Step for TheBook {
235
243
let path = file. path ( ) ;
236
244
let path = path. to_str ( ) . unwrap ( ) ;
237
245
238
- invoke_rustdoc ( builder, self . compiler , target, path) ;
246
+ invoke_rustdoc ( builder, compiler, target, path) ;
239
247
}
240
248
}
241
249
}
@@ -293,25 +301,12 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned<String
293
301
294
302
let favicon = build. src . join ( "src/doc/favicon.inc" ) ;
295
303
let footer = build. src . join ( "src/doc/footer.inc" ) ;
296
-
297
- let version_input = build. src . join ( "src/doc/version_info.html.template" ) ;
298
304
let version_info = out. join ( "version_info.html" ) ;
299
305
300
- if !up_to_date ( & version_input, & version_info) {
301
- let mut info = String :: new ( ) ;
302
- t ! ( t!( File :: open( & version_input) ) . read_to_string( & mut info) ) ;
303
- let info = info. replace ( "VERSION" , & build. rust_release ( ) )
304
- . replace ( "SHORT_HASH" , build. rust_info . sha_short ( ) . unwrap_or ( "" ) )
305
- . replace ( "STAMP" , build. rust_info . sha ( ) . unwrap_or ( "" ) ) ;
306
- t ! ( t!( File :: create( & version_info) ) . write_all( info. as_bytes( ) ) ) ;
307
- }
308
-
309
306
let mut cmd = builder. rustdoc_cmd ( compiler. host ) ;
310
307
311
308
let out = out. join ( "book" ) ;
312
309
313
- t ! ( fs:: copy( build. src. join( "src/doc/rust.css" ) , out. join( "rust.css" ) ) ) ;
314
-
315
310
cmd. arg ( "--html-after-content" ) . arg ( & footer)
316
311
. arg ( "--html-before-content" ) . arg ( & version_info)
317
312
. arg ( "--html-in-header" ) . arg ( & favicon)
@@ -320,7 +315,7 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned<String
320
315
. arg ( "-o" ) . arg ( & out)
321
316
. arg ( & path)
322
317
. arg ( "--markdown-css" )
323
- . arg ( "rust.css" ) ;
318
+ . arg ( "../ rust.css" ) ;
324
319
325
320
build. run ( & mut cmd) ;
326
321
}
0 commit comments