In older Rust versions, trait implementations were listed under the
heading with the id "implementations" and in the div with the id
"implementations-list". Since Rust 1.45, the method heading has the id
"implementations" and the trait implementations have the ids
"trait-implementations" and "trait-implementations-list".
This patch updates the parser with these new IDs while also checking the
old IDs for older documentation.
Previously, we only showed plain text versions of the item descriptions
in the module overview due to a formatting issue. As this issue
disappeared, we can now use the HTML version of the description.
Similar to the fix for functions in 1a242e5, we have to use a different
selector to query the definition for constants, "pre.const" instead of
".docblock.type-decl".
With this patch, we require that the identifier element for a member in
the module documentation is a direct child of the table cell. This
fixes problems with spurious member elements if there are more elements
in the table cell, e. g. stability annotations.
This patch changes the documentation parser for methods to use the first
code child of the subheading as the definition instead of the first
child. This fixes a problems when there is additional information in
the subheading, for example about the relevant traits.
Previously, we were used /usr/share/doc/rust{,-doc}/html as a default
source, assuming that it would contain the standard library
documentation. This is true if the user installed the Rust
documentation manually or using a package manager. If they use rustup
instead, the documentation is placed in a subdirectory of ~/.rustup.
With this patch, we call `rustc --print sysroot` to determine the
installation directory of the currently activated Rust toolchain –
either the system Rust installation or a Rust installation managed by
rustup. We then use `$(sysroot)/share/doc/…` as a default path for the
standard library documentation (with /usr as a fallback if the call to
rustc does not return a valid path).
This patch release adds basic logging output and a new `-e`/`--examples`
option to extract only the examples from the documentation. It also
fixes a bug when displaying the documentation for a function.
Previosuly, we always used the selector ".docblock.type-decl" to select
the definition for an item. But this did not work for functions.
Therefore we change the selector to "pre.fn" for functions.