Auto merge of #31715 - mitaa:rdoc-index-crate, r=alexcrichton
This allows to search for crates in documentation and simplifies the json serialization of the search-index. fixes #14077
This commit is contained in:
commit
37c6f2881c
3 changed files with 117 additions and 116 deletions
|
@ -580,6 +580,9 @@
|
|||
displayPath = "";
|
||||
href = rootPath + item.path.replace(/::/g, '/') +
|
||||
'/' + type + '.' + name + '.html';
|
||||
} else if (type === "externcrate") {
|
||||
displayPath = "";
|
||||
href = rootPath + name + '/index.html';
|
||||
} else if (item.parent !== undefined) {
|
||||
var myparent = item.parent;
|
||||
var anchor = '#' + type + '.' + name;
|
||||
|
@ -678,6 +681,16 @@
|
|||
for (var crate in rawSearchIndex) {
|
||||
if (!rawSearchIndex.hasOwnProperty(crate)) { continue; }
|
||||
|
||||
searchWords.push(crate);
|
||||
searchIndex.push({
|
||||
crate: crate,
|
||||
ty: 1, // == ExternCrate
|
||||
name: crate,
|
||||
path: "",
|
||||
desc: rawSearchIndex[crate].doc,
|
||||
type: null,
|
||||
});
|
||||
|
||||
// an array of [(Number) item type,
|
||||
// (String) name,
|
||||
// (String) full path or empty string for previous path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue