@@ -70,9 +70,11 @@ pub fn book(build: &Build, target: &str, name: &str) {
70
70
71
71
// build the index page
72
72
let index = format ! ( "{}/index.md" , name) ;
73
+ println ! ( "Documenting book index ({})" , target) ;
73
74
invoke_rustdoc ( build, target, & index) ;
74
75
75
76
// build the redirect pages
77
+ println ! ( "Documenting book redirect pages ({})" , target) ;
76
78
for file in t ! ( fs:: read_dir( build. src. join( "src/doc/book/redirects" ) ) ) {
77
79
let file = t ! ( file) ;
78
80
let path = file. path ( ) ;
@@ -93,16 +95,27 @@ fn invoke_rustdoc(build: &Build, target: &str, markdown: &str) {
93
95
94
96
let favicon = build. src . join ( "src/doc/favicon.inc" ) ;
95
97
let footer = build. src . join ( "src/doc/footer.inc" ) ;
96
- t ! ( fs:: copy( build. src. join( "src/doc/rust.css" ) , out. join( "rust.css" ) ) ) ;
97
98
99
+ let version_input = build. src . join ( "src/doc/version_info.html.template" ) ;
98
100
let version_info = out. join ( "version_info.html" ) ;
99
101
102
+ if !up_to_date ( & version_input, & version_info) {
103
+ let mut info = String :: new ( ) ;
104
+ t ! ( t!( File :: open( & version_input) ) . read_to_string( & mut info) ) ;
105
+ let info = info. replace ( "VERSION" , & build. rust_release ( ) )
106
+ . replace ( "SHORT_HASH" , build. rust_info . sha_short ( ) . unwrap_or ( "" ) )
107
+ . replace ( "STAMP" , build. rust_info . sha ( ) . unwrap_or ( "" ) ) ;
108
+ t ! ( t!( File :: create( & version_info) ) . write_all( info. as_bytes( ) ) ) ;
109
+ }
110
+
100
111
let mut cmd = Command :: new ( & rustdoc) ;
101
112
102
113
build. add_rustc_lib_path ( & compiler, & mut cmd) ;
103
114
104
115
let out = out. join ( "book" ) ;
105
116
117
+ t ! ( fs:: copy( build. src. join( "src/doc/rust.css" ) , out. join( "rust.css" ) ) ) ;
118
+
106
119
cmd. arg ( "--html-after-content" ) . arg ( & footer)
107
120
. arg ( "--html-before-content" ) . arg ( & version_info)
108
121
. arg ( "--html-in-header" ) . arg ( & favicon)
0 commit comments