20 Commits (ea183be56d02072f415c2c66bb950db0a0b3bcd8)

Author SHA1 Message Date
Robin Krahl d4971ba4ac
Add screenshot to readme 4 years ago
Robin Krahl 8db34e33b2
Use termion backend for cursive
With this patch, we replace cursive’s default ncurses backend with the
termion backend.  This has multiple reasons:
- The ncurses backend has safety issues, see [0].
- ncurses requires a pre-installed library and a C compiler, introducing
  additional build dependencies.  Termion is implemented in Rust only.
- ncurses does not work on Windows, while termion works in all terminals
  that support ANSI escape codes.

Per default, the termion backend does not buffer the output which may
cause flickering [1].  Therefore, we also use the
cursive_buffered_backend that buffers the output and fixes the
flickering problem.

[0] https://github.com/gyscos/cursive/issues/488
[1] https://github.com/gyscos/cursive/issues/142
4 years ago
Robin Krahl e222a1f443
Add TUI viewer using cursive
This patch adds a new viewer, tui, that provides an interactive
interface using cursive.  This viewer makes it possible to follow links
to other documentation items and to open external links in a web
browser.
4 years ago
Robin Krahl ecb3d40c59
Use ansi_term, atty, terminal_size
This patch replaces the crossterm dependency with ansi_term, atty and
terminal_size.  This allows us for an easier integration with the
text_style crate in an upcoming patch, and it reduces the total number
of dependencies from 166 to 160.

This means that we drop support for non-ANSI terminals, but as this only
affects old versions of cmd.exe/PowerShell, we don’t care about it.
4 years ago
Robin Krahl 628377c83b
Refactor test suite to check multiple versions
This patch refactors the test suite:
- Instead of always generating the documentation with the available
  rustdoc version, we now store generated documentation for all
  supported rustdoc versions in the test/html directory.
- Instead of using one snapshot per test case, we now use one snapshot
  per test case and rustdoc version.
4 years ago
Robin Krahl 3affe94234
Update installation instructions
This patch updates the installation instructions with information on the
AUR packgage and on the tarball downloads.
4 years ago
Robin Krahl 44fe71d5bb
Rewrap example in readme to 80 columns
This makes it easier to read the example e. g. on crates.io.
4 years ago
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).
4 years ago
Robin Krahl 1adeafe909
Add vim integration to readme
This patch adds information about calling rusty-man from vim to the
readme.
4 years ago
Robin Krahl 411b1834b1
Use absolute links in readme
This fixes missing links on crates.io.
4 years ago
Robin Krahl 0a1dd0838e
Update installation instructions
This patch adds information about installing from crates.io and suggests
checking out the latest release when installing from source.
4 years ago
Robin Krahl 41dd007390
Use crossterm instead of termion
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.
4 years ago
Robin Krahl 0d75176f59
Update readme
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>
4 years ago
Robin Krahl 1b8a2c23f6 Fix wrong command in example usage 4 years ago
Robin Krahl baef1a06b0
Extend contributing guide
This patch extends the CONTRIBUTING.md file with more information on
possible tasks, the test suite and the code checks.
4 years ago
Robin Krahl 1128919f1f
Add installation and contributing information
This patch extends the README.md file and adds the INSTALL.md and
CONTRIBUTING.md files with more detailed information.
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 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 3967de8bd2 Initial project scaffolding
This patch contains the initial project scaffolding, based on the files
generated by cargo new.
4 years ago