Commit Graph

17 Commits

Author SHA1 Message Date
Robin Krahl
ef8f6fa365
Fix trait implementation list for Rust 1.45
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.
2020-07-27 16:17:17 +02:00
Robin Krahl
3c06846a30
Sort implementations alphabetically
For consistency and easier testing, we sort the implementation items
alphabetically by their name and their definitions.
2020-07-27 16:16:56 +02:00
Robin Krahl
ae0a741d5a
Extract description of module items as HTML
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.
2020-07-26 12:14:08 +02:00
Robin Krahl
6ca9d90e46
Fix group and ID for typdef items
This patch fixes the group and ID stored in the ItemType enum for the
ItemType::Typedef variant so that typedefs show up in the module
summary.
2020-07-26 12:10:21 +02:00
Robin Krahl
cbc4965902
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.
2020-07-26 11:51:54 +02:00
Robin Krahl
f0245bada3
Show definition for constants
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".
2020-07-26 11:19:54 +02:00
Robin Krahl
19398e340c
Remove spurious members from module documentation
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.
2020-07-26 11:04:13 +02:00
Robin Krahl
bc3f1552ef
Fix definition for methods in documentation parser
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.
2020-07-26 11:03:19 +02:00
Robin Krahl
64dd5a55ae
Use rustc --print sysroot for default sources
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).
2020-07-25 19:06:27 +02:00
Robin Krahl
4d7c7d4eab
Release v0.1.2
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.
2020-07-25 13:29:14 +02:00
Robin Krahl
45a1a3d1f5
Add top-level heading to changelog 2020-07-25 13:24:11 +02:00
Robin Krahl
34857816e1
Add -e/--example option to only show examples
As requested here [0], this patch adds a new -e/--example option that
extracts the examples from the documentation string instead of printing
the full documentation for an item.  Syntax highlighting will be added
in the future.

[0] https://old.reddit.com/r/rust/comments/hx16j0/rustyman_a_commandline_viewer_for_rustdoc/fz3utjf/
2020-07-25 12:58:52 +02:00
Robin Krahl
1a242e5474
Fix definition selector for functions
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.
2020-07-25 12:23:29 +02:00
Robin Krahl
221c345e1c
Add changelog entry for logging functionality
We introduced basic logging in commit e69e4af but didn’t update the
changelog.  This patch adds the missing changelog entry.
2020-07-25 11:44:57 +02:00
Robin Krahl
c00a04b179
Fix v0.1.1 release date in changelog 2020-07-25 11:42:26 +02:00
Robin Krahl
af1b81dd57
Release v0.1.1
This patch release fixes some minor issues with the documentation
displayed on crates.io.
2020-07-24 14:26:25 +02:00
Robin Krahl
0c22a6d393
Release v0.1.0 2020-07-24 14:16:34 +02:00