Add o command for opening items to tui viewer
This patch adds the o command to the tui viewer that can be used to open
items. The command uses the same lookup logic as the rusty-man program:
First, it tries to find a direct match. If none is found, it uses the
search index to find partial matches.
Move item lookup logic into Sources struct
This match adds the Sources struct that is a wrapper for a vector of
Source structs. It now contains the lookup logic that was previously
contained in functions in main.rs.
This patch release fixes an issue with the pager configuration.
Add --pager option to set the pager
This patch adds the --pager command-line option to set the pager used by
the plain and rich viewers.
Use LESS environment variables for less options
Previously, we would either use the pager set in the PAGER environment
variable or "less -cr" for the rich and plain viewer. This caused
problems if, for example, the PAGER environment variable was set to
"less", see ticket #22:
To fix this issue, we now use the LESS environment variable to set the
less options. This makes sure that setting PAGER does not override the
This minor release introduces a new interactive viewer, tui. It also
adds syntax highlighting for code in the documentation and support for
Ignore match_like_matches_macro clippy lint
This lint tells us to use the std::matches! macro instead of a match or
if let expression that yields a bool. But the matches! macro was added
in Rust 1.42, and our MSRV is 1.40. I don’t want to bump the MSRV only
for this change, so we ignore the lint.
Update documentaion for tui viewer
Remove Notable Traits section from definitions
Rust 1.47.0 introduced the Notable Traits section that lists information
about types used in code block. As we only want to display the code
block itself without meta-information, this patch ignores the
notable-traits class when extracting the text from nodes.
Add tests for Rust 1.47.0
This patch adds unit tests for the new Rust 1.47.0 release. Except for
the new Notable Traits section, we’re already parsing the output
Add vim-like keybindings to tui viewer
This patch adds vim-like keybindings to the tui viewer: hjkl for
navigation, G and g (instead of gg) for End and Home, and Ctrl+F and
Ctrl+B for Page Down and Up.
Remove textwrap dependency
The textwrap dependency was added mistakenly.
Replace ansi_term, atty, terminal_size with termion
In the last patch, we added the termion dependency for the tui viewer.
With this patch, we remove the ansi_term, atty and terminal_size
dependencies and use termion instead.
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 .
- 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 . Therefore, we also use the
cursive_buffered_backend that buffers the output and fixes the
Use cursive-markup to replace HtmlView
We’ve moved the HtmlView into a separate crate, so we can replace our
own HtmlView with cursive_markup::MarkupView. We only have to implement
a custom Renderer that applies the syntax highlighting to code snippets.
Add links to module items
This patch adds links to the items in the module member list. This only
applies for the tui viewer, as the links wouldn’t provide any additional
information for the plain and rich viewers.
Replace Option::zip with custom function
In the previous commit, we used the Option::zip method to make querying
the focus and the links in the HtmlView struct easier. But Option::zip
has only been added in Rust 1.46, so we replace it with a custom utility
function to keep compatibility with Rust 1.40.
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
Display link targets in rich viewer
Previously, we only used the underline effect to highlight links in the
rich viewer, but we did not provide any information about their target.
With this patch, we print a list of link at the end of a block, similar
to the plain text viewer.
Remove Decorator::show_links field
We are currently always listing the links in the plain text viewer when
rendering HTML, so we no longer need the show_links field that could be
used to disable link listing.