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.
Previously, our ItemType enum only had three values: Module, Item and
Member. With this patch we import the ItemType variants from librustdoc
(see html/item_type.rs) for better compatibility and easier parsing.
Previously, we wrapped all lines at 100 characters and just printed to
stdout. With this patch, we use the pager crate to spawn a pager
(typically less) before printing the text. Also, we try to use the
terminal size to determine the line length: The default line length is
still 100 characters but can be reduced to fit the terminal.
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.