9 Commits (958019449d108769669b8b181d4fa395ce0e0a72)

Author SHA1 Message Date
Robin Krahl f799d860ca
Import item types from librustdoc
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.
4 years ago
Robin Krahl 61fdf31c0a
Read search index from search-index.js
With this patch, we read the search index generated by rustdoc.  It
allows us to suggest matching items if we don’t find an exact match.
4 years ago
Robin Krahl 646b36708b
Replace “interface” with “viewer” in description
Previously, we called rusty-man a command-line interface for rustdoc
documentation, but “viewer” is a more appropriate term.
4 years ago
Robin Krahl 02b3116ecd Adapt text output to terminal size
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.
4 years ago
Robin Krahl 96df0924ba Add rich viewer
This patch adds a new viewer with rich text output using html2text’s
from_read_rich function.  We then use termion to format the generated
rich text.
4 years ago
Robin Krahl 5ce0365c7f Add --viewer option and plain text viewer
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.
4 years ago
Robin Krahl 6993df9cb6 Extract documentation from HTML files
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.
4 years ago
Robin Krahl 11b6d27b8a Implement command-line interface using structopt
This patch adds the structopt dependency and implements a simple
command-line interface for rusty-man.
4 years ago
Robin Krahl 3967de8bd2 Initial project scaffolding
This patch contains the initial project scaffolding, based on the files
generated by cargo new.
4 years ago