More robust pydoctor parsing
mthuurne opened this issue · 5 comments
Hi, I'm the current maintainer of pydoctor. When working on pydoctor's code, I came across a comment saying that data-type
attributes are added to links to help doc2dash
. While that is good solution for now, I was wondering if in the future we could move to a more robust solution than soup-parsing the name index.
One possible approach would be for doc2dash
to use the Intersphinx inventory produced by pydoctor. I think all the required information is in there, although it's not identical to what is put in data-type
. For example, in the inventory there are only methods, while data-type
has separate values for "Method", "Class Method" and "Static Method". Another difference is that properties are grouped together with attributes in the Intersphinx inventory but treated as their own category in data-type
.
I think finding a method would be easier if the reader didn't have to consider in advance whether it's a regular, class or static method. And whether an attribute is a simple member variable or implemented by a property should be irrelevant to most readers. So I think using the Intersphinx inventory instead of parsing the name index would result in an easier to use docset.
Is there a reason why isn't doc2dash
isn't using the Intersphinx inventory that pydoctor produces? Perhaps it's simply a case of that feature not being implemented yet in pydoctor when the parser was written.
If necessary we could also consider having pydoctor produce some kind of JSON index for tools like doc2dash
to consume, but Intersphinx is an established format and I'd prefer to use that if possible.
By the way, the page footer has changed in pydoctor 20.12.0: it now includes the version of pydoctor as well. So the parser will need an update in any case.
I'm in the process of rewriting doc2dash from the ground up so the information that pydoctor is creating an objects.inv is a very welcome one. I shall use that from now on. The should simplify things for everyone involved!
I'm in the process of rewriting doc2dash from the ground
Thanks for working on this! Is there an ETA for the v3 release?
I'm afraid there isn't. I'm making continuously progress but it's just bit by bit when other FOSS duties don't press.
So um I've totally changed my mind, because I'm lazy. Would you like to help to improve the pydoctor parser? Sorry for the misdirection.
I have just realized that I just had to make the intersphinx loader a bit more tolerant. This should be fixed now.