rustdoc: Add index records to the doc tree
This commit is contained in:
parent
5df44bd066
commit
3cd8c57a54
3 changed files with 31 additions and 4 deletions
|
@ -33,7 +33,8 @@ type itemdoc = {
|
||||||
|
|
||||||
type moddoc = {
|
type moddoc = {
|
||||||
item: itemdoc,
|
item: itemdoc,
|
||||||
items: [itemtag]
|
items: [itemtag],
|
||||||
|
index: option<index>
|
||||||
};
|
};
|
||||||
|
|
||||||
type nmoddoc = {
|
type nmoddoc = {
|
||||||
|
@ -109,6 +110,29 @@ type tydoc = {
|
||||||
sig: option<str>
|
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"]
|
#[doc = "Some helper methods on moddoc, mostly for testing"]
|
||||||
impl util for moddoc {
|
impl util for moddoc {
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,8 @@ fn moddoc_from_mod(
|
||||||
none
|
none
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
index: none
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,8 @@ fn test_run_passes() {
|
||||||
name: doc.topmod.name() + "two"
|
name: doc.topmod.name() + "two"
|
||||||
with doc.topmod.item
|
with doc.topmod.item
|
||||||
},
|
},
|
||||||
items: []
|
items: [],
|
||||||
|
index: none
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +72,8 @@ fn test_run_passes() {
|
||||||
name: doc.topmod.name() + "three"
|
name: doc.topmod.name() + "three"
|
||||||
with doc.topmod.item
|
with doc.topmod.item
|
||||||
},
|
},
|
||||||
items: []
|
items: [],
|
||||||
|
index: none
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue