rustdoc: Add index records to the doc tree

This commit is contained in:
Brian Anderson 2012-03-01 16:33:58 -08:00
parent 5df44bd066
commit 3cd8c57a54
3 changed files with 31 additions and 4 deletions

View File

@ -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 {

View File

@ -102,7 +102,8 @@ fn moddoc_from_mod(
none
}
}
}
},
index: none
}
}

View File

@ -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
}
}
}