diff --git a/.github/workflows/mdBook.yml b/.github/workflows/mdBook.yml new file mode 100644 index 0000000..528e986 --- /dev/null +++ b/.github/workflows/mdBook.yml @@ -0,0 +1,35 @@ +name: Build & deploy mdBook + +on: + workflow_run: + workflows: + - CI + types: + - completed + branches: + - main + +jobs: + rustdoc: + if: github.repository == 'Xithrius/twitch-tui' && github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: 'latest' + + - name: Build mdBook + run: | + cd book + mdbook build + + - name: Deploy mdBook + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book/book diff --git a/README.md b/README.md index 56672b3..de533e2 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ +## 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). diff --git a/book/.gitignore b/book/.gitignore new file mode 100644 index 0000000..7585238 --- /dev/null +++ b/book/.gitignore @@ -0,0 +1 @@ +book diff --git a/book/book.toml b/book/book.toml new file mode 100644 index 0000000..1b7d335 --- /dev/null +++ b/book/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["Nadhem"] +language = "en" +multilingual = false +src = "src" +title = "twitch-tui" diff --git a/book/src/README.md b/book/src/README.md new file mode 100644 index 0000000..b670d38 --- /dev/null +++ b/book/src/README.md @@ -0,0 +1,127 @@ +# Twitch chat in the terminal + +[![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) + +![image](https://user-images.githubusercontent.com/15021300/155114244-00704633-e852-49bb-9a5a-33c623f775f8.png) + +## Keybinds + +
+ Normal mode + + + + + + + + + + + + +
Key + Description +
c + Go to the chat window chat. +
i + Enter message input mode for sending messages. Exit this mode with `Esc`. +
? + Have the keybinds popup window appear. +
q + Quit out of the entire application once in the base chat view. +
s + Open a popup window to switch channels. +
Ctrl + f + Enter message search mode, which highlights messages in the main window which match the query. +
Ctrl + t + Toggle the filter. +
Ctrl + r + Reverse the filter. +
Ctrl + p + Manually trigger a panic, so the application crashes. +
Esc + Exits out of layered windows, such as going from the help window to normal view. +
+ +
+ +
+ Input mode (message sending/searching, channel swapping) + + + + + + + + + + + + + + + + + + + +
Key + Description +
Ctrl + w + Cuts a single word (from the cursor to the next whitespace). +
Ctrl + u + Cuts the entire line. +
Ctrl + f + Move cursor to the right. +
Ctrl + b + Move cursor to the left. +
Ctrl + a + Move cursor to the start. +
Ctrl + e + Move cursor to the end. +
Alt + f + Move to the end of the next word. +
Alt + b + Move to the start of the previous word. +
Ctrl + t + Swap previous character with current character. +
Alt + t + Swap previous word with current word. +
Ctrl + u + Remove everything before the cursor. +
Ctrl + k + Remove everything after the cursor. +
Ctrl + w + Remove the previous word. +
Ctrl + d + Remove character to the right. +
Tab + Fill in suggestion, if available. +
Enter + Confirm the current text to go through (doesn't do anything in message search mode). +
+ +
+ +## 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. diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md new file mode 100644 index 0000000..fc29470 --- /dev/null +++ b/book/src/SUMMARY.md @@ -0,0 +1,7 @@ +# Summary + +[Introduction](./README.md) + +# User Guide + +- [Installation](guide/installation.md) diff --git a/book/src/guide/installation.md b/book/src/guide/installation.md new file mode 100644 index 0000000..c7928aa --- /dev/null +++ b/book/src/guide/installation.md @@ -0,0 +1,45 @@ +# Installation + +Once you have installed Rust, the following command can be used to build and 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). + +To uninstall, run the command `cargo uninstall twitch-tui`. + +[rust installation page]: https://www.rust-lang.org/tools/install +[crates.io]: https://crates.io/ + +## Running twitch-tui + +#### Config + +Create the following config file `config.toml`. The full list of config is available in the [default-config.toml]. + +- 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 + +#### 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 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 +```