mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
Move search JS into search-index.js
Export a few variables and functions into the global scope because they are needed both by main.js and search-index.js.
This commit is contained in:
parent
d4d7ebf142
commit
276ee6f542
@ -408,9 +408,8 @@ pub(super) fn write_shared(
|
||||
// with rustdoc running in parallel.
|
||||
all_indexes.sort();
|
||||
write_crate("search-index.js", &|| {
|
||||
let mut v = String::from("var searchIndex = JSON.parse('{\\\n");
|
||||
v.push_str(&all_indexes.join(",\\\n"));
|
||||
v.push_str("\\\n}');\ninitSearch(searchIndex);");
|
||||
let v = static_files::SEARCH_JS
|
||||
.replace(r#""SEARCH_INDEX_PLACEHOLDER": {}"#, &all_indexes.join(",\\\n"));
|
||||
Ok(v.into_bytes())
|
||||
})?;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1512
src/librustdoc/html/static/search.js
Normal file
1512
src/librustdoc/html/static/search.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -24,6 +24,10 @@ crate static NORMALIZE_CSS: &str = include_str!("static/normalize.css");
|
||||
/// including search behavior and docblock folding, among others.
|
||||
crate static MAIN_JS: &str = include_str!("static/main.js");
|
||||
|
||||
/// The file contents of `search-index.js`, which contains the search behavior,
|
||||
/// and into which is interpolated the search index.
|
||||
crate static SEARCH_JS: &str = include_str!("static/search.js");
|
||||
|
||||
/// The file contents of `settings.js`, which contains the JavaScript used to handle the settings
|
||||
/// page.
|
||||
crate static SETTINGS_JS: &str = include_str!("static/settings.js");
|
||||
|
Loading…
Reference in New Issue
Block a user