Added more verbose documentation to the book

This commit is contained in:
Xithrius 2022-10-10 22:16:34 -07:00
parent 258b884339
commit 5f985cc322
No known key found for this signature in database
GPG Key ID: A867F27CC80B28C1
7 changed files with 129 additions and 262 deletions

117
README.md
View File

@ -7,122 +7,13 @@
![image](https://user-images.githubusercontent.com/15021300/155114244-00704633-e852-49bb-9a5a-33c623f775f8.png)
## Keybinds
<details>
<summary>Normal mode</summary>
<table>
<tr>
<td> <b>Key</b>
<td> <b> Description</b>
<tr>
<td> c
<td> Go to the chat window chat.
<tr>
<td> i
<td> Enter message input mode for sending messages. Exit this mode with `Esc`.
<tr>
<td> ?
<td> Have the keybinds popup window appear.
<tr>
<td> q
<td> Quit out of the entire application once in the base chat view.
<tr>
<td> s
<td> Open a popup window to switch channels.
<tr>
<td> Ctrl + f
<td> Enter message search mode, which highlights messages in the main window which match the query.
<tr>
<td> Ctrl + t
<td> Toggle the filter.
<tr>
<td> Ctrl + r
<td> Reverse the filter.
<tr>
<td> Ctrl + p
<td> Manually trigger a panic, so the application crashes.
<tr>
<td> Esc
<td> Exits out of layered windows, such as going from the help window to normal view.
</table>
</details>
<details>
<summary>Input mode (message sending/searching, channel swapping)</summary>
<table>
<tr>
<td> <b>Key</b>
<td> <b> Description</b>
<tr>
<td> Ctrl + w
<td> Cuts a single word (from the cursor to the next whitespace).
<tr>
<td> Ctrl + u
<td> Cuts the entire line.
<tr>
<td> Ctrl + f
<td> Move cursor to the right.
<tr>
<td> Ctrl + b
<td> Move cursor to the left.
<tr>
<td> Ctrl + a
<td> Move cursor to the start.
<tr>
<td> Ctrl + e
<td> Move cursor to the end.
<tr>
<td> Alt + f
<td> Move to the end of the next word.
<tr>
<td> Alt + b
<td> Move to the start of the previous word.
<tr>
<td> Ctrl + t
<td> Swap previous character with current character.
<tr>
<td> Alt + t
<td> Swap previous word with current word.
<tr>
<td> Ctrl + u
<td> Remove everything before the cursor.
<tr>
<td> Ctrl + k
<td> Remove everything after the cursor.
<tr>
<td> Ctrl + w
<td> Remove the previous word.
<tr>
<td> Ctrl + d
<td> Remove character to the right.
<tr>
<td> Tab
<td> Fill in suggestion, if available.
<tr>
<td> Enter
<td> Confirm the current text to go through (doesn't do anything in message search mode).
</table>
</details>
## Links
- Documentation: https://xithrius.github.io/twitch-tui/
- [Documentation](https://xithrius.github.io/twitch-tui/)
- [Setup](https://xithrius.github.io/twitch-tui/guide/installation)
## Setup
1. Install Rustup from the [rust-lang website](https://www.rust-lang.org/learn/get-started).
2. Install the program through `cargo install twitch-tui`. You can use this same command to update the program in the future. To install a specific version, use a version number from the [releases page](https://github.com/Xithrius/twitch-tui/releases) and the `--version` flag (ex. `cargo install twitch-tui --version "2.0.0-alpha.1"`).
3. Run the program with `twt` in the terminal to generate the default configuration at the paths below. If the directories don't exist, they will be created for you.
- Linux/MacOS: `~/.config/twt/config.toml`
- Windows: `%appdata%\twt\config.toml`
4. Get an OAuth token from [Twitch](https://twitchapps.com/tmi/), and place the value in the `token` variable in the `config.toml` that was previously generated.
5. Once you're done modifying the config file, run `twt` again, and enjoy! Run `twt --help` if you're looking for more options/arguments.
## Other information
If you have any problems, do not hesitate to [submit an issue](https://github.com/Xithrius/twitch-tui/issues/new/choose).
Along with this application, I recommend using [streamlink](https://github.com/streamlink/streamlink) so there's no more need for a browser.
Combine this application with [streamlink](https://github.com/streamlink/streamlink) to rid the need of a browser while watching streams.

View File

@ -1,127 +1,7 @@
# Twitch chat in the terminal
# Introduction
[![CI](https://github.com/Xithrius/twitch-tui/actions/workflows/ci.yml/badge.svg)](https://github.com/Xithrius/twitch-tui/actions/workflows/ci.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Xithrius/twitch-tui/main.svg)](https://results.pre-commit.ci/latest/github/Xithrius/twitch-tui/main)
[![Lines of code](https://tokei.rs/b1/github/Xithrius/twitch-tui?category=code)](https://github.com/Xithrius/twitch-tui)
[![Crate Status](https://img.shields.io/crates/v/twitch-tui.svg)](https://crates.io/crates/twitch-tui)
`twitch-tui` is a Terminal User Interface for reading and interacting with Twitch chat users.
![image](https://user-images.githubusercontent.com/15021300/155114244-00704633-e852-49bb-9a5a-33c623f775f8.png)
The ideal setup would be this application and [streamlink](https://github.com/streamlink/streamlink), to obliterate all need for a browser while watching streams.
## Keybinds
<details>
<summary>Normal mode</summary>
<table>
<tr>
<td> <b>Key</b>
<td> <b> Description</b>
<tr>
<td> c
<td> Go to the chat window chat.
<tr>
<td> i
<td> Enter message input mode for sending messages. Exit this mode with `Esc`.
<tr>
<td> ?
<td> Have the keybinds popup window appear.
<tr>
<td> q
<td> Quit out of the entire application once in the base chat view.
<tr>
<td> s
<td> Open a popup window to switch channels.
<tr>
<td> Ctrl + f
<td> Enter message search mode, which highlights messages in the main window which match the query.
<tr>
<td> Ctrl + t
<td> Toggle the filter.
<tr>
<td> Ctrl + r
<td> Reverse the filter.
<tr>
<td> Ctrl + p
<td> Manually trigger a panic, so the application crashes.
<tr>
<td> Esc
<td> Exits out of layered windows, such as going from the help window to normal view.
</table>
</details>
<details>
<summary>Input mode (message sending/searching, channel swapping)</summary>
<table>
<tr>
<td> <b>Key</b>
<td> <b> Description</b>
<tr>
<td> Ctrl + w
<td> Cuts a single word (from the cursor to the next whitespace).
<tr>
<td> Ctrl + u
<td> Cuts the entire line.
<tr>
<td> Ctrl + f
<td> Move cursor to the right.
<tr>
<td> Ctrl + b
<td> Move cursor to the left.
<tr>
<td> Ctrl + a
<td> Move cursor to the start.
<tr>
<td> Ctrl + e
<td> Move cursor to the end.
<tr>
<td> Alt + f
<td> Move to the end of the next word.
<tr>
<td> Alt + b
<td> Move to the start of the previous word.
<tr>
<td> Ctrl + t
<td> Swap previous character with current character.
<tr>
<td> Alt + t
<td> Swap previous word with current word.
<tr>
<td> Ctrl + u
<td> Remove everything before the cursor.
<tr>
<td> Ctrl + k
<td> Remove everything after the cursor.
<tr>
<td> Ctrl + w
<td> Remove the previous word.
<tr>
<td> Ctrl + d
<td> Remove character to the right.
<tr>
<td> Tab
<td> Fill in suggestion, if available.
<tr>
<td> Enter
<td> Confirm the current text to go through (doesn't do anything in message search mode).
</table>
</details>
## Links
- Documentation: https://xithrius.github.io/twitch-tui/
## Setup
1. Install Rustup from the [rust-lang website](https://www.rust-lang.org/learn/get-started).
2. Install the program through `cargo install twitch-tui`. You can use this same command to update the program in the future. To install a specific version, use a version number from the [releases page](https://github.com/Xithrius/twitch-tui/releases) and the `--version` flag (ex. `cargo install twitch-tui --version "2.0.0-alpha.1"`).
3. Run the program with `twt` in the terminal to generate the default configuration at the paths below. If the directories don't exist, they will be created for you.
- Linux/MacOS: `~/.config/twt/config.toml`
- Windows: `%appdata%\twt\config.toml`
4. Get an OAuth token from [Twitch](https://twitchapps.com/tmi/), and place the value in the `token` variable in the `config.toml` that was previously generated.
5. Once you're done modifying the config file, run `twt` again, and enjoy! Run `twt --help` if you're looking for more options/arguments.
If you have any problems, do not hesitate to [submit an issue](https://github.com/Xithrius/twitch-tui/issues/new/choose).
Along with this application, I recommend using [streamlink](https://github.com/streamlink/streamlink) so there's no more need for a browser.
This book is still under construction, so some sections might still be missing. Feel free to [submit an issue](https://github.com/Xithrius/twitch-tui/issues/new/choose) if you find that something needs improvement.

View File

@ -1,7 +1,10 @@
# Summary
[Introduction](./README.md)
[Introduction](README.md)
# User Guide
- [Installation](guide/installation.md)
- [Keybinds](keybinds/README.md)
- [Normal mode](keybinds/normal.md)
- [Insert mode](keybinds/insert.md)

View File

@ -1,45 +1,34 @@
# Installation
Once you have installed Rust, the following command can be used to build and install twitch-tui:
After [installing Rust](https://www.rust-lang.org/tools/install), use the following command to install twitch-tui:
```sh
cargo install twitch-tui
```
This will automatically download mdBook from [crates.io], build it, and install it in Cargo's global binary directory (`~/.cargo/bin/` by default).
For a specific version, head over to the [releases page](https://github.com/Xithrius/twitch-tui/releases) and select the release you want.
Installing a version such as `2.0.0-alpha.1` would be `cargo install twitch-tui --version "2.0.0-alpha.1"`.
(PPT and AUR repos coming soon)
To uninstall, run the command `cargo uninstall twitch-tui`.
[rust installation page]: https://www.rust-lang.org/tools/install
[crates.io]: https://crates.io/
## Configuration
## Running twitch-tui
### Config file
#### Config
Create the following config file `config.toml`. The full list of config is available in the [default-config.toml].
After running `twt` for the first time, a config file will be generated at the following locations, depending on your OS:
- Linux/MacOS: `~/.config/twt/config.toml`
- Windows: `%appdata%\twt\config.toml`
[default-config.toml]: https://github.com/Xithrius/twitch-tui/blob/main/default-config.toml
You can find the default configuration values [here](https://github.com/Xithrius/twitch-tui/blob/main/default-config.toml).
#### Auth
### Auth
Get an OAuth token from [Twitch](https://twitchapps.com/tmi/), and place the value in the `token` variable in the `config.toml` that was previously generated.
#### Run it
### Run it
Run the program with `twt` in the terminal to generate the default configuration at the paths below.
```sh
twt
```
#### Help and options
Run `twt --help` if you're looking for more options/arguments.
```sh
twt --help
```
Run `twt` in the terminal. For help, `twt --help`.

View File

@ -0,0 +1,6 @@
# Keybind guide
All of the keybinds are in this section.
- [Normal mode](normal.md)
- [Insert mode](insert.md)

View File

@ -0,0 +1,57 @@
# Insert mode keybinds
Message sending and searching, along with channel swapping keybinds are explained in this section.
<table>
<tr>
<td> <b>Key</b>
<td> <b> Description</b>
<tr>
<td> Ctrl + w
<td> Cuts a single word (from the cursor to the next whitespace).
<tr>
<td> Ctrl + u
<td> Cuts the entire line.
<tr>
<td> Ctrl + f
<td> Move cursor to the right.
<tr>
<td> Ctrl + b
<td> Move cursor to the left.
<tr>
<td> Ctrl + a
<td> Move cursor to the start.
<tr>
<td> Ctrl + e
<td> Move cursor to the end.
<tr>
<td> Alt + f
<td> Move to the end of the next word.
<tr>
<td> Alt + b
<td> Move to the start of the previous word.
<tr>
<td> Ctrl + t
<td> Swap previous character with current character.
<tr>
<td> Alt + t
<td> Swap previous word with current word.
<tr>
<td> Ctrl + u
<td> Remove everything before the cursor.
<tr>
<td> Ctrl + k
<td> Remove everything after the cursor.
<tr>
<td> Ctrl + w
<td> Remove the previous word.
<tr>
<td> Ctrl + d
<td> Remove character to the right.
<tr>
<td> Tab
<td> Fill in suggestion, if available.
<tr>
<td> Enter
<td> Confirm the current text to go through (doesn't do anything in message search mode).
</table>

View File

@ -0,0 +1,41 @@
# Normal mode keybinds
This is the mode you enter when the application first starts up.
Navigation to different modes are also explained here.
<table>
<tr>
<td> <b>Key</b>
<td> <b> Description</b>
<tr>
<td> c
<td> Go to the chat window chat.
<tr>
<td> i
<td> Enter message input mode for sending messages. Exit this mode with `Esc`.
<tr>
<td> ?
<td> Have the keybinds popup window appear.
<tr>
<td> q
<td> Quit out of the entire application once in the base chat view.
<tr>
<td> s
<td> Open a popup window to switch channels.
<tr>
<td> Ctrl + f
<td> Enter message search mode, which highlights messages in the main window which match the query.
<tr>
<td> Ctrl + t
<td> Toggle the filter.
<tr>
<td> Ctrl + r
<td> Reverse the filter.
<tr>
<td> Ctrl + p
<td> Manually trigger a panic, so the application crashes.
<tr>
<td> Esc
<td> Exits out of layered windows, such as going from the help window to normal view.
</table>