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).
With this patch, we replace the termion dependency with crossterm. This
should make it possible to compile and run rusty-man on other platforms
than Unix.
This patch updates the readme with better usage examples and with the
documentation for rusty-man itself.
Signed-off-by: Robin Krahl <robin.krahl@ireas.org>
This patch adds a new --viewer command line option that lets the user
select a viewer that displays the documentation. It also adds a default
viewer implementation that uses html2text to generate plain text from
the HTML documentation.
html2text requires the ptr_cast feature and we use the Option::as_deref
method in the viewer implementation, so we have to update the minimum
supported Rust version to 1.40.
This patch adds the parser module that uses kuchiki and html5ever to
parse the HTML documentation.
As kuchiki requires std::mem::MaybeUninit, we have to bump the minimum
supported Rust version to 1.36.