You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
3.4 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!---
SPDX-FileCopyrightText: 2020 Robin Krahl <robin.krahl@ireas.org>
SPDX-License-Identifier: MIT
-->
# rusty-man
```
$ rusty-man rusty-man | head -4
rusty-man Module rusty-man rusty-man
DESCRIPTION
rusty-man is a command-line viewer for documentation generated by `rustdoc`.
```
## Example Usage
Before running rusty-man, make sure that you generated the documentation with
`cargo doc`:
```
$ cd rusty-man && cargo doc
```
Then you can open the documentation for an item:
```
$ rusty-man kuchiki::NodeRef
```
You dont have to specificy the full item name:
```
$ rusty-man NodeRef
```
If the documentation is not placed in `./target/doc` or
`/usr/share/doc/rust{,-doc}/html`, you have to manually set the source path
using the `-s`/`--source` option:
```
$ rusty-man --source ~/.rustup/toolchains/stable-*/share/doc/html io::Error
```
If there are multiple matches for the keyword, rusty-man will show you a list
of all matching items:
```
$ rusty-man --source ~/.rustup/toolchains/stable-*/share/doc/rust/html u8
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
```
For more usage information, run `rusty-man --help`.
## Installation
To install rusty-man, clone this repository and use cargo to build the project,
or use `cargo install`. See the [`INSTALL.md`][] file for more information.
rusty-man should run on all platforms supported by [`crossterm`][]. 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.
## 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`).
## Contributing
Contributions to this project are very welcome! You can contribute by writing
code or documentation or by testing. See the [`CONTRIBUTING.md`][] file for
more information.
If you are looking for a good starting point, have a look at the [issues with
the label “good first issue”][issues] in rusty-mans issue tracker.
## Minimum Supported Rust Version
This crate supports Rust 1.40 or later.
## Contact
For bug reports, patches, feature requests or other messages, please send a
mail to the mailing list [~ireas/rusty-man-dev@lists.sr.ht][] ([public
archive][]) or [contact me directly][]. You can also use the rusty-man [issue
tracker][] for bug reports or features requests.
## License
This project is licensed under the [MIT License][].
`rusty-man` complies with [version 3.0 of the REUSE specification][reuse].
[`crossterm`]: https://lib.rs/crossterm
[`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
[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
[contact me directly]: mailto:robin.krahl@ireas.org
[public archive]: https://lists.sr.ht/~ireas/rusty-man-dev
[issue tracker]: https://todo.sr.ht/~ireas/rusty-man
[MIT license]: https://opensource.org/licenses/MIT
[reuse]: https://reuse.software/practices/3.0/