2020-01-12 10:50:40 +00:00
|
|
|
|
<!---
|
|
|
|
|
SPDX-FileCopyrightText: 2020 Robin Krahl <robin.krahl@ireas.org>
|
|
|
|
|
SPDX-License-Identifier: MIT
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
# rusty-man
|
|
|
|
|
|
2020-07-24 10:36:49 +00:00
|
|
|
|
```
|
2020-07-28 12:57:52 +00:00
|
|
|
|
$ rusty-man rusty-man | head -5
|
|
|
|
|
rusty-man Module rusty-man rusty-man
|
2020-07-24 10:36:49 +00:00
|
|
|
|
|
|
|
|
|
DESCRIPTION
|
2020-07-28 12:57:52 +00:00
|
|
|
|
rusty-man is a command-line viewer for documentation generated by
|
|
|
|
|
`rustdoc`.
|
2020-07-24 10:36:49 +00:00
|
|
|
|
```
|
2020-01-12 10:50:40 +00:00
|
|
|
|
|
2020-07-19 23:34:56 +00:00
|
|
|
|
## Example Usage
|
|
|
|
|
|
2020-07-24 10:36:49 +00:00
|
|
|
|
Before running rusty-man, make sure that you generated the documentation with
|
|
|
|
|
`cargo doc`:
|
2020-07-19 23:34:56 +00:00
|
|
|
|
```
|
|
|
|
|
$ cd rusty-man && cargo doc
|
2020-07-24 10:36:49 +00:00
|
|
|
|
```
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
2020-07-24 10:36:49 +00:00
|
|
|
|
Then you can open the documentation for an item:
|
|
|
|
|
```
|
|
|
|
|
$ rusty-man kuchiki::NodeRef
|
|
|
|
|
```
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
2020-07-24 10:36:49 +00:00
|
|
|
|
You don’t have to specificy the full item name:
|
|
|
|
|
```
|
|
|
|
|
$ rusty-man NodeRef
|
|
|
|
|
```
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
2020-07-25 17:06:27 +00:00
|
|
|
|
If the documentation is not placed in `./target/doc` or the Rust installation
|
|
|
|
|
directory, you have to manually set the source path using the `-s`/`--source`
|
|
|
|
|
option:
|
2020-07-24 10:36:49 +00:00
|
|
|
|
```
|
2020-07-25 17:06:27 +00:00
|
|
|
|
$ rusty-man --source my/other/crate/target/doc io::Error
|
2020-07-24 10:36:49 +00:00
|
|
|
|
```
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
2020-07-24 10:36:49 +00:00
|
|
|
|
If there are multiple matches for the keyword, rusty-man will show you a list
|
|
|
|
|
of all matching items:
|
|
|
|
|
```
|
2020-07-25 17:06:27 +00:00
|
|
|
|
$ rusty-man --source my/other/crate/target/doc u8
|
2020-07-19 23:34:56 +00:00
|
|
|
|
Found mulitple matches for u8 – select one of:
|
|
|
|
|
|
|
|
|
|
[ 0 ] core::u8: The 8-bit unsigned integer type.
|
|
|
|
|
[ 1 ] std::u8: The 8-bit unsigned integer type.
|
|
|
|
|
|
|
|
|
|
> 1
|
|
|
|
|
```
|
|
|
|
|
|
2020-07-24 10:36:49 +00:00
|
|
|
|
For more usage information, run `rusty-man --help`.
|
|
|
|
|
|
2020-09-15 15:32:06 +00:00
|
|
|
|
## Viewers
|
|
|
|
|
|
|
|
|
|
rusty-man has three viewers (select one with the `--viewer` option) that
|
|
|
|
|
determine the output format:
|
|
|
|
|
- `plain` prints the documentation to the standard output without formatting.
|
|
|
|
|
This is the default for non-interactive use.
|
|
|
|
|
- `rich` prints the documentation to the standard output with formatting and
|
|
|
|
|
optional syntax highlighting. This is the default for interactive use.
|
|
|
|
|
- `tui` is an interactive terminal interface. You can read the documentation
|
|
|
|
|
and follow links.
|
|
|
|
|
|
2020-07-19 23:34:56 +00:00
|
|
|
|
## Installation
|
|
|
|
|
|
2020-08-11 07:59:43 +00:00
|
|
|
|
To install rusty-man from source, clone this repository and use cargo to build
|
|
|
|
|
the project, or use `cargo install`. See the [`INSTALL.md`][] file for more
|
|
|
|
|
information. rusty-man is also available as a package for these distributions:
|
|
|
|
|
- Arch Linux: [`rusty-man`][pkg-aur] in the Arch User Repository
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
2020-09-15 15:32:06 +00:00
|
|
|
|
rusty-man is developed for Unix-like systems. It should run on other platforms
|
2020-10-08 08:19:21 +00:00
|
|
|
|
too, but with some limitations: The `rich` and `tui` viewers uses ANSI escape
|
|
|
|
|
codes, which are not supported on older Windows versions. If you have trouble
|
|
|
|
|
running rusty-man on your platform or if you want to help porting rusty-man to
|
|
|
|
|
other platforms, please let me know.
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
2020-07-24 20:47:13 +00:00
|
|
|
|
## Integrations
|
|
|
|
|
|
|
|
|
|
### vim
|
|
|
|
|
|
|
|
|
|
You can set rusty-man as the keyword program with `set keywordprg=rusty-man`
|
|
|
|
|
and then use `K` to open the documentation for the item under the cursor. If
|
|
|
|
|
you want to apply this setting for all Rust files, add it to the
|
|
|
|
|
`ftplugin/rust.vim` file in your vim runtime directory (e. g. `~/.vim`).
|
|
|
|
|
|
2020-07-19 23:34:56 +00:00
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
|
|
Contributions to this project are very welcome! You can contribute by writing
|
2020-07-20 08:23:28 +00:00
|
|
|
|
code or documentation or by testing. See the [`CONTRIBUTING.md`][] file for
|
|
|
|
|
more information.
|
2020-07-19 23:34:56 +00:00
|
|
|
|
|
|
|
|
|
If you are looking for a good starting point, have a look at the [issues with
|
|
|
|
|
the label “good first issue”][issues] in rusty-man’s issue tracker.
|
|
|
|
|
|
2020-01-12 10:50:40 +00:00
|
|
|
|
## Minimum Supported Rust Version
|
|
|
|
|
|
2020-07-16 19:01:29 +00:00
|
|
|
|
This crate supports Rust 1.40 or later.
|
2020-01-12 10:50:40 +00:00
|
|
|
|
|
|
|
|
|
## Contact
|
|
|
|
|
|
|
|
|
|
For bug reports, patches, feature requests or other messages, please send a
|
2020-07-19 23:34:56 +00:00
|
|
|
|
mail to the mailing list [~ireas/rusty-man-dev@lists.sr.ht][] ([public
|
2020-07-20 08:23:28 +00:00
|
|
|
|
archive][]) or [contact me directly][]. You can also use the rusty-man [issue
|
|
|
|
|
tracker][] for bug reports or features requests.
|
2020-01-12 10:50:40 +00:00
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
2020-09-11 16:14:19 +00:00
|
|
|
|
This project is licensed under the [MIT License][]. For license information
|
|
|
|
|
for the data used by the test suite, see the [`.reuse/dep5`][] file.
|
2020-01-12 10:50:40 +00:00
|
|
|
|
|
|
|
|
|
`rusty-man` complies with [version 3.0 of the REUSE specification][reuse].
|
|
|
|
|
|
2020-07-24 11:18:35 +00:00
|
|
|
|
[`crossterm`]: https://lib.rs/crossterm
|
2020-07-24 12:21:37 +00:00
|
|
|
|
[`INSTALL.md`]: https://git.sr.ht/~ireas/rusty-man/tree/refs/heads/master/INSTALL.md
|
|
|
|
|
[`CONTRIBUTING.md`]: https://git.sr.ht/~ireas/rusty-man/tree/refs/heads/master/CONTRIBUTING.md
|
2020-07-19 23:34:56 +00:00
|
|
|
|
[issues]: https://todo.sr.ht/~ireas/rusty-man?search=label:%22good%20first%20issue%22%20status%3Aopen
|
|
|
|
|
[~ireas/rusty-man-dev@lists.sr.ht]: mailto:~ireas/rusty-man-dev@lists.sr.ht
|
2020-07-20 08:23:28 +00:00
|
|
|
|
[contact me directly]: mailto:robin.krahl@ireas.org
|
2020-07-19 23:34:56 +00:00
|
|
|
|
[public archive]: https://lists.sr.ht/~ireas/rusty-man-dev
|
|
|
|
|
[issue tracker]: https://todo.sr.ht/~ireas/rusty-man
|
2020-01-12 10:50:40 +00:00
|
|
|
|
[MIT license]: https://opensource.org/licenses/MIT
|
2020-09-11 16:14:19 +00:00
|
|
|
|
[`.reuse/dep5`]: https://git.sr.ht/~ireas/rusty-man/tree/refs/heads/master/.reuse/dep5
|
2020-01-12 10:50:40 +00:00
|
|
|
|
[reuse]: https://reuse.software/practices/3.0/
|
2020-08-11 07:59:43 +00:00
|
|
|
|
|
|
|
|
|
[pkg-aur]: https://aur.archlinux.org/packages/rusty-man/
|