rustdoc: Add index records to the doc tree
This commit is contained in:
parent
5df44bd066
commit
3cd8c57a54
|
@ -33,7 +33,8 @@ type itemdoc = {
|
|||
|
||||
type moddoc = {
|
||||
item: itemdoc,
|
||||
items: [itemtag]
|
||||
items: [itemtag],
|
||||
index: option<index>
|
||||
};
|
||||
|
||||
type nmoddoc = {
|
||||
|
@ -109,6 +110,29 @@ type tydoc = {
|
|||
sig: option<str>
|
||||
};
|
||||
|
||||
type index = {
|
||||
entries: [index_entry]
|
||||
};
|
||||
|
||||
#[doc = "
|
||||
|
||||
A single entry in an index
|
||||
|
||||
Fields:
|
||||
|
||||
* kind - The type of thing being indexed, e.g. 'Module'
|
||||
* name - The name of the thing
|
||||
* brief - A description
|
||||
* link - A format-specific string representing the link target
|
||||
|
||||
"]
|
||||
type index_entry = {
|
||||
kind: str,
|
||||
name: str,
|
||||
brief: str,
|
||||
link: str
|
||||
};
|
||||
|
||||
#[doc = "Some helper methods on moddoc, mostly for testing"]
|
||||
impl util for moddoc {
|
||||
|
||||
|
|
|
@ -102,7 +102,8 @@ fn moddoc_from_mod(
|
|||
none
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
index: none
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@ fn test_run_passes() {
|
|||
name: doc.topmod.name() + "two"
|
||||
with doc.topmod.item
|
||||
},
|
||||
items: []
|
||||
items: [],
|
||||
index: none
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +72,8 @@ fn test_run_passes() {
|
|||
name: doc.topmod.name() + "three"
|
||||
with doc.topmod.item
|
||||
},
|
||||
items: []
|
||||
items: [],
|
||||
index: none
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue