File tree 5 files changed +19
-0
lines changed
5 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Contributors
Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ impl Renderer for HtmlHandlebars {
156
156
let mut css_file = try!( File :: create ( book. get_dest ( ) . join ( "book.css" ) ) ) ;
157
157
try!( css_file. write_all ( & theme. css ) ) ;
158
158
159
+ // JQuery
160
+ let mut jquery = try!( File :: create ( book. get_dest ( ) . join ( "jquery.js" ) ) ) ;
161
+ try!( jquery. write_all ( & theme. jquery ) ) ;
162
+
159
163
// syntax highlighting
160
164
let mut highlight_css = try!( File :: create ( book. get_dest ( ) . join ( "highlight.css" ) ) ) ;
161
165
try!( highlight_css. write_all ( & theme. highlight_css ) ) ;
Original file line number Diff line number Diff line change 71
71
72
72
</div >
73
73
74
+ <!-- Fetch JQuery from CDN but have a local fallback -->
74
75
<script src =" http://code.jquery.com/jquery-2.1.4.min.js" ></script >
76
+ <script >
77
+ if (typeof jQuery == ' undefined' ) {
78
+ document .write (unescape (" %3Cscript src='jquery.js'%3E%3C/script%3E" ));
79
+ }
80
+ </script >
81
+
75
82
<script src =" highlight.js" ></script >
76
83
<script src =" book.js" ></script >
77
84
</body >
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ pub static CSS: &'static [u8] = include_bytes!("book.css");
9
9
pub static JS : & ' static [ u8 ] = include_bytes ! ( "book.js" ) ;
10
10
pub static HIGHLIGHT_JS : & ' static [ u8 ] = include_bytes ! ( "highlight.js" ) ;
11
11
pub static HIGHLIGHT_CSS : & ' static [ u8 ] = include_bytes ! ( "highlight.css" ) ;
12
+ pub static JQUERY : & ' static [ u8 ] = include_bytes ! ( "jquery-2.1.4.min.js" ) ;
12
13
13
14
/// The `Theme` struct should be used instead of the static variables because the `new()` method
14
15
/// will look if the user has a theme directory in his source folder and use the users theme instead
@@ -22,6 +23,7 @@ pub struct Theme {
22
23
pub js : Vec < u8 > ,
23
24
pub highlight_css : Vec < u8 > ,
24
25
pub highlight_js : Vec < u8 > ,
26
+ pub jquery : Vec < u8 > ,
25
27
}
26
28
27
29
impl Theme {
@@ -34,6 +36,7 @@ impl Theme {
34
36
js : JS . to_owned ( ) ,
35
37
highlight_css : HIGHLIGHT_CSS . to_owned ( ) ,
36
38
highlight_js : HIGHLIGHT_JS . to_owned ( ) ,
39
+ jquery : JQUERY . to_owned ( ) ,
37
40
} ;
38
41
39
42
// Check if the given path exists
You can’t perform that action at this time.
0 commit comments