Hello,
I am trying to manipulate the documentation of a crate via syn. One problem I have is that I want to group together the documentation of structure and its methods, but this require some (potentially complicated) analysis of item paths. For example :
/// Struct documentation
pub struct MyStruct;
type Alias = MyStruct;
mod implementation {
impl super::Alias { // refers to `MyStruct`
/// Method documentation
pub fn method(&self) {
// ...
}
}
}
So I think my options here are :
- Use some
rustdoc
internal mechanism (how ?) - Use a crate that could resolve
super::Alias
toMyStruct
; to my knowledge, no such crate exists yet... - Use some
rustc
option to print a 'resolved' version of this file ? (in whichimpl super::Alias
would becomeimpl crate::MyStruct
, or something like that... I haven't found one)
- Parse all
use ...
andtype ...
myself... I would rather use a pre-existing tool
For now, I haven't found anything and I am stuck to option 4... Is there some crate, or an obvious answer I am missing ?