@@ -7,6 +7,7 @@ use std::io::Read;
7
7
use errors:: * ;
8
8
9
9
pub static INDEX : & ' static [ u8 ] = include_bytes ! ( "index.hbs" ) ;
10
+ pub static HEADER : & ' static [ u8 ] = include_bytes ! ( "header.hbs" ) ;
10
11
pub static CSS : & ' static [ u8 ] = include_bytes ! ( "book.css" ) ;
11
12
pub static FAVICON : & ' static [ u8 ] = include_bytes ! ( "favicon.png" ) ;
12
13
pub static JS : & ' static [ u8 ] = include_bytes ! ( "book.js" ) ;
@@ -40,6 +41,7 @@ pub static FONT_AWESOME_OTF: &'static [u8] = include_bytes!("_FontAwesome/fonts/
40
41
#[ derive( Debug , PartialEq ) ]
41
42
pub struct Theme {
42
43
pub index : Vec < u8 > ,
44
+ pub header : Vec < u8 > ,
43
45
pub css : Vec < u8 > ,
44
46
pub favicon : Vec < u8 > ,
45
47
pub js : Vec < u8 > ,
@@ -64,17 +66,20 @@ impl Theme {
64
66
65
67
// Check for individual files, if they exist copy them across
66
68
{
67
- let files = vec ! [ ( theme_dir. join( "index.hbs" ) , & mut theme. index) ,
68
- ( theme_dir. join( "book.js" ) , & mut theme. js) ,
69
- ( theme_dir. join( "book.css" ) , & mut theme. css) ,
70
- ( theme_dir. join( "favicon.png" ) , & mut theme. favicon) ,
71
- ( theme_dir. join( "highlight.js" ) , & mut theme. highlight_js) ,
72
- ( theme_dir. join( "clipboard.min.js" ) , & mut theme. clipboard_js) ,
73
- ( theme_dir. join( "store.js" ) , & mut theme. store_js) ,
74
- ( theme_dir. join( "highlight.css" ) , & mut theme. highlight_css) ,
75
- ( theme_dir. join( "tomorrow-night.css" ) , & mut theme. tomorrow_night_css) ,
76
- ( theme_dir. join( "ayu-highlight.css" ) , & mut theme. ayu_highlight_css) ,
77
- ( theme_dir. join( "jquery.js" ) , & mut theme. jquery) ] ;
69
+ let files = vec ! [
70
+ ( theme_dir. join( "index.hbs" ) , & mut theme. index) ,
71
+ ( theme_dir. join( "header.hbs" ) , & mut theme. header) ,
72
+ ( theme_dir. join( "book.js" ) , & mut theme. js) ,
73
+ ( theme_dir. join( "book.css" ) , & mut theme. css) ,
74
+ ( theme_dir. join( "favicon.png" ) , & mut theme. favicon) ,
75
+ ( theme_dir. join( "highlight.js" ) , & mut theme. highlight_js) ,
76
+ ( theme_dir. join( "clipboard.min.js" ) , & mut theme. clipboard_js) ,
77
+ ( theme_dir. join( "store.js" ) , & mut theme. store_js) ,
78
+ ( theme_dir. join( "highlight.css" ) , & mut theme. highlight_css) ,
79
+ ( theme_dir. join( "tomorrow-night.css" ) , & mut theme. tomorrow_night_css) ,
80
+ ( theme_dir. join( "ayu-highlight.css" ) , & mut theme. ayu_highlight_css) ,
81
+ ( theme_dir. join( "jquery.js" ) , & mut theme. jquery) ,
82
+ ] ;
78
83
79
84
for ( filename, dest) in files {
80
85
if !filename. exists ( ) {
@@ -95,6 +100,7 @@ impl Default for Theme {
95
100
fn default ( ) -> Theme {
96
101
Theme {
97
102
index : INDEX . to_owned ( ) ,
103
+ header : HEADER . to_owned ( ) ,
98
104
css : CSS . to_owned ( ) ,
99
105
favicon : FAVICON . to_owned ( ) ,
100
106
js : JS . to_owned ( ) ,
@@ -166,6 +172,7 @@ mod tests {
166
172
167
173
let empty = Theme {
168
174
index : Vec :: new ( ) ,
175
+ header : Vec :: new ( ) ,
169
176
css : Vec :: new ( ) ,
170
177
favicon : Vec :: new ( ) ,
171
178
js : Vec :: new ( ) ,
0 commit comments