Show definition for type defs

As in the previous commit, we have to use the selector "pre.typedef"
instead of ".docblock.type-decl" to select the definition for type defs.
This commit is contained in:
Robin Krahl 2020-07-26 11:51:54 +02:00
parent f0245bada3
commit cbc4965902
No known key found for this signature in database
GPG Key ID: 8E9B0870524F69D8
2 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@ SPDX-License-Identifier: MIT
- Improve the documentation parser:
- Fix the definition of methods to only contain the actual definition.
- Remove spurious members in module documentation.
- Show the definition for constants.
- Show the definition for constants and typedefs.
## v0.1.2 (2020-07-25)

View File

@ -132,6 +132,7 @@ pub fn parse_item_doc(item: &doc::Item) -> anyhow::Result<doc::Doc> {
let definition_selector = match item.ty {
doc::ItemType::Constant => "pre.const",
doc::ItemType::Function => "pre.fn",
doc::ItemType::Typedef => "pre.typedef",
_ => ".docblock.type-decl",
};
let definition = select_first(&document, definition_selector)?;