Skip to content

Commit

Permalink
0.8.0 - wrote some docs, fixed up some minor things so check commit u…
Browse files Browse the repository at this point in the history
…rself
  • Loading branch information
Siriusmart committed Aug 25, 2023
1 parent e2ab565 commit f321f7c
Show file tree
Hide file tree
Showing 23 changed files with 354 additions and 219 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ viuer = {version = "0.6", default-features = false, optional = true}
home = "0.5"
chrono = {version = "0.4", default-features = false, features = ["clock"]}
typemap = {version = "0.3", default-features = false}
# tui-additions = {version = "0.2.1", default-features = false, features = ["framework", "widgets"]}
tui-additions = {version = "0.2.1", default-features = false, features = ["framework", "widgets"]}
invidious = {version = "0.5"}
serde_yaml = {version = "0.9", default-features = false}
dyn-clone = {version = "1.0", default-features = false}
Expand All @@ -40,7 +40,7 @@ ratatui = {version = "0.21", default-features = false, features = ["serde"]}
libmpv = { git = "https://github.com/sudipghimire533/libmpv-rs", optional = true }
unicode-segmentation = "1"

tui-additions = {path = "../../Rust/Packages/tui-additions", default-features = false, features = ["framework", "widgets"]}
# tui-additions = {path = "../../Rust/Packages/tui-additions", default-features = false, features = ["framework", "widgets"]}
# invidious = {path = "../../Rust/Packages/invidious"}

[package.metadata.docs.rs]
Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,16 @@

***Read more in the [user manual](https://siriusmart.github.io/youtube-tui) (including installation guide and documentation).***

> "May Invidious live and prosper, with, or without us."
>
> ~ The Invidious team on [YouTube trying to take them down](https://github.com/iv-org/invidious/issues/3872).
Go show them some support by [donating](https://invidious.io/donate/) and starring their
[GitHub repos](https://github.com/iv-org)!

# Overview

Written in Rust, the **YouTube TUI** is a lightweight and user friendly TUI for browsing YouTube content from the terminal.
Written in Rust, the **YouTube TUI** is a lightweight and user friendly TUI for browsing YouTube content from the terminal. Works out of the box and easily to configurable.

![](./docs/src/images/search-showcase.png)

It is like an _app launcher_, it launches other programs to do the heavy lifting (for example, `mpv` for playing videos).

<sub>It also have an embedded mpv music player, but that can be disabled in compile time.</sub>

> Consider regenerating config files on updates to allow new features.
## Customisable
Expand Down Expand Up @@ -61,10 +56,10 @@ However, the programs to launch can be changed, and therefore the YouTube TUI <u

The YouTube TUI allows you to browse YouTube with (almost) all of it's features, functions including:

- View popular/trending videos
- View information about channels, playlists and videos
- Use search filters to sort and filter search results
- Save browsing history
- Embedded audio/music player

It also includes features like:

Expand All @@ -77,9 +72,9 @@ It also includes features like:
### What it doesn't have

- [URGENT] Replace the no-longer-going-to-compile `typemap` dependency with either a self implementation of it or a useable crate.
- Strip down some libraries to reduce compile speed, specifically removing.
- Strip down some libraries to reduce compile speed.
- Add command section for channel main page (first priority)
- Add NewPipe as a source alongside Invidious
- Git like command line to improve on `yt-dlp` - make changes to existing downloaded playlists instead of redownloading the entire thing.

## How to contribute

Expand Down
8 changes: 5 additions & 3 deletions docs/src/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Overview

Written in Rust, the **YouTube TUI** is a lightweight and user friendly TUI for browsing YouTube content from the terminal.
Written in Rust, the **YouTube TUI** is a lightweight and user friendly TUI for browsing YouTube content from the terminal. Works out of the box and easily to configurable.

![](./images/search-showcase.png)

It is like an _app launcher_, it launches other programs to do the heavy lifting (for example, `mpv` for playing videos).

<sub>It also have an embedded mpv music player, but that can be disabled in compile time.</sub>

> Consider regenerating config files on updates to allow new features.
## Customisable
Expand Down Expand Up @@ -45,10 +47,10 @@ However, the programs to launch can be changed, and therefore the YouTube TUI <u

The YouTube TUI allows you to browse YouTube with (almost) all of it's features, functions including:

- View popular/trending videos
- View information about channels, playlists and videos
- Use search filters to sort and filter search results
- Save browsing history
- Embedded audio/music player

It also includes features like:

Expand All @@ -63,7 +65,7 @@ It also includes features like:
- [URGENT] Replace the no-longer-going-to-compile `typemap` dependency with either a self implementation of it or a useable crate.
- Strip down some libraries to reduce compile speed.
- Add command section for channel main page (first priority)
- Up arrow command history + Ctrl arrow keys move between words
- Git like command line to improve on `yt-dlp` - make changes to existing downloaded playlists instead of redownloading the entire thing.

## How to contribute

Expand Down
5 changes: 4 additions & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
- [Overview](README.md)
- [Installation](installation.md)
- [Basic usage](basic_usage.md)
- [Invidious](invidious.md)
<!-- - [Invidious](invidious.md) -->
<!-- Will add it back in when it's relevant again -->
- [Commands](commands.md)

# Customisation guide
Expand All @@ -16,6 +17,8 @@
- [pages](config/pages.md)
- [appearance](config/appearance.md)
- [search](config/search.md)
- [cmdefine](config/cmdefine.md)
- [remap](config/remap.md)

# Contributing

Expand Down
22 changes: 20 additions & 2 deletions docs/src/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ The item with the cursor hovering will have a <u>red outline</u>.
|First page history|Home|
|Clear page history|End|
|Paste from clipboard|`Ctrl` + `V`|
|Next/previous entry on search and command|`Ctrl` + up/down arrow|
|Next song|`Ctrl` + `Shift` + Right arrow|
|Seek audio|`Ctrl` + left/right arrow|
|Pause/resume audio|Space|
|Enter command mode|`:`|
|Quit|`q`|

Expand All @@ -41,13 +45,27 @@ To apply search filters, select the button with 3 dots (`...`) to the right of t

![](./images/search-filters-showcase.png)

## Playing videos and playlists
> You may use `Ctrl + Up/Down arrow` to cycle through previously searched queries (when focused on the search bar).
## Playing media with embedded player

By default, running any "play video" options in video or playlist view will open a new mpv player window.

While any "play audio" options will start playing the audio in the embedded audio player,

- seek and rewind using `Ctrl + Left/Right arrow`
- skip with `Ctrl + Shift + Right arrow`
- pause and resume with space

## Playing videos and playlists externally

You can also play audio and videos externally.

> This part assumes that you use `mpv` as your video player, `konsole` as your terminal emulator, `yt-dlp` as your YouTube video downloader, and `firefox` as your browser.
>
> If that is not the case, you can learn how to change that in the *custom commands* section.
Press `Enter` to select a video or playlist from any lists, then move the cursor to the *bottom item* where you can play, download and open the webpage in browser.
You can press keybindings like `Shift` + `A` to run a command which opens a new terminal screen, and in that terminal screen it runs an mpv command to play the media.

## Feeds

Expand Down
26 changes: 17 additions & 9 deletions docs/src/changelogs.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
# Changelogs

### v0.8.0 (latest unstable on Github)
## v0.8.0 (latest)

#### Added
### Added

- Build in MPV player, controlled by command `mpv [libmpv command] [args...]`
- Built in MPV player, controlled by command `mpv [libmpv command] [args...]`
- Command/search histories.
- Keys remapping, custom commands.

## v0.7.4 (latest stable on crates.io)
### Fixed

### Added
- Some keys captured in search bar and are not working [#37](https://github.com/Siriusmart/youtube-tui/issues/37).

---

### v0.7.4

#### Added

- `Ctrl + w` and `Ctrl + u` in search bar and command mode.
- Keybindings works even when an item is selected (`legacy_input_handling: false` in `main.yml`).
- Creating fake key input using `:key`

### Fixed
#### Fixed

- Search filters popup closing when you click on it.
- Configured keybindings in all items.
Expand Down Expand Up @@ -66,7 +74,7 @@

- Empty ItemList crash (<a href="https://github.com/Siriusmart/youtube-tui/issues/26" target=_blank>issue 26</a>)

<hr>
---

## v0.6.2

Expand Down Expand Up @@ -98,7 +106,7 @@
- Vim-like commands
- Pasting with `Ctrl + V` in search bar and command mode

<hr>
---

## v0.5.3

Expand Down Expand Up @@ -132,7 +140,7 @@
- Sixels image support
- Improved config files

<hr>
---

## v0.4.4

Expand Down
38 changes: 26 additions & 12 deletions docs/src/commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Commands

Commands can be entered to the TUI by pressing the `:` key, the same as in Vim. Some commands have shorter *alternatives* that can be used instead.
Commands can be entered to the TUI by pressing the `:` key, the same as in Vim.

Run the help command to view more detailed help.

```sh
youtube-tui help
```

> Env variables can be used by passing in as `${key}`, such as `:channel ${channel-id}` when in a video or playlist page.
Expand All @@ -15,34 +21,29 @@ Below are the avaliable commands:
`loadpage` can be used to load a specific page.

```vim
loadpage popular (alt: `popular`)
loadpage trending (alt: `trending`)
loadpage watchhistory (alt: `watchhistory`)
loadpage search [search query] (alt: `search [search query]`)
loadpage video [id or url] (alt: `video [id or url]`)
loadpage playlist [id or url] (alt: `playlist [id or url] `)
loadpage channel [id or url] (alt: `channel [id or url] `)
loadpage [page]
```

## History

`history` is used to manage page history (`Backspace` equivalent).

```vim
history back (alt: `back`)
history back
history clear
```

## Utility

```vim
reload (alt `r`)
reload configs (alt `reload/r config/configs`)
reload // reloads the page
reload configs // reload config files in ~/.config/youtube-tui/
flush
quit (alt `q`, `exit`, `x`)
quit
run [command]
parrun [command]
key [keycode] [keymodifier]
echo [mode] (message) # run youtube-tui help to learn more about modes
```

> The `flush` command is used to run all tasks in queue immediately, this is usually done automatically.
Expand All @@ -66,6 +67,19 @@ unsub [id or url] Remove channel from subscription
syncall Sync all subscriptions
```

## MPV commands

<sub>Only with the [`mpv`](installation.md#mpv-default) feature.</sub>

```vim
mpv prop [label] Gets mpv property
mpv sprop [label] [value] Set mpv property
mpv tprop [label] [value] Toggle a yes/no property
mpv [command] Runs a libmpv command
```

> Note that properties and commands are **libmpv** commands, *not* mpv commands. Please refer to [mpv reference](https://mpv.io/manual/master/).
## Text commands

Text commands generates a *text only response* without launching the TUI.
Expand Down
2 changes: 2 additions & 0 deletions docs/src/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ In the following sections we will go through all config files including:
- [`pages.yml`](./pages.md)
- [`appearance.yml`](./appearance.md)
- [`search.yml`](./search.md)
- [`cmdefine.yml`](./cmdefine.md)
- [`remap.yml`](./remap.md)
28 changes: 28 additions & 0 deletions docs/src/config/cmdefine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Custom commands

Define custom commands. It can be found in `~/.config/youtube-tui/cmdefine.yml`.

> This is still a work in progress, perhaps in the future scripting will be allowed to control and interact with elements within the TUI.
```yml
print: echo
pause: mpv sprop pause yes ;; echo mpv Player paused
next: mpv playlist-next ;; echo mpv Skipped
resume: mpv sprop pause no ;; echo mpv Player resumed
search: loadpage search
rc: reload configs
```
---
General format:
```yml
new command: original command
```
This allows for alternative shorthand commands.
<sub>More about commands run `youtube-tui help` or check out [commands](commands.md).</sub>

> Try not to use self referencing commands, it'll make a mess.
Loading

0 comments on commit f321f7c

Please sign in to comment.