Skip to content

Commit

Permalink
docs: update docs for v0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Beastwick18 committed Jun 25, 2024
1 parent 9c7caa2 commit ad2626c
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Command-line options
There are a few command line options that can be supplied when running nyaa. They are:
| Option | Description |
| -------------------------- | ---------------------------------------------------------- |
| `-V/-v/--version` | Print the current version of `nyaa` |
| `--config=/path/to/config` | Override the path to the config folder (not `config.toml`) |
11 changes: 11 additions & 0 deletions docs/clients/download_torrent_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,15 @@ download_client = "DownloadTorrentFile"

[client.download]
save_dir = "~/Downloads" # required
filename = "{file}" # The name to save the file as
overwrite = true # Whether to overwrite the file if it already exists
create_root_dir = true # Whether to create parent directories if they do not exist
```

## Filename
The format of the filename to save can use substitutions to add information. The allowed substitutions are:
| Pattern | Substitute |
| ------------ | ------------------------------------------------------------------------------------- |
| `{file}` | The file name stored in the source webpage (like `123456.torrent` or `Title.torrent`) |
| `{basename}` | The basename of the file stored in the source webpage (like `123456` or `Title`) |
| `{hash}` | The torrent's hash |
9 changes: 5 additions & 4 deletions docs/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ You can configure the way copying works in nyaa using several options. The confi
```toml
[clipboard]
osc52 = true
selection = "..."
cmd = "..."
shell_cmd = "..."
selection = ["..."] # optional
cmd = "..." # optional
shell_cmd = "..." # optional
```

They are prioritized in the order `cmd` $\rightarrow$ `osc52` $\rightarrow$ `selection`
Expand Down Expand Up @@ -34,6 +34,7 @@ By default, `cmd` is undefined so nyaa uses [OSC52](https://www.reddit.com/r/vim
| [windows terminal](https://github.com/microsoft/terminal) | **yes** |
| [xterm.js](https://xtermjs.org/) (Hyper terminal) | **yes** |
| [zellij](https://github.com/zellij-org/zellij/) | **yes** |

<sub>Source: [vim-oscyank](https://github.com/ojroques/vim-oscyank)</sub>

If your terminal is not supported, you should disable OSC52 by adding
Expand All @@ -47,7 +48,7 @@ to your `config.toml`. This will make nyaa use an alternative method for copying
For those using X11, you can change the option `x11_selection` to either `Clipboard`, `Primary`, or `Secondary` to change which selection X11 will copy the content into. This would look like:
```toml
[clipboard]
selection = "Primary"
selection = "Primary" # can also be a list, like ["Primary", "Clipboard"]
```

## cmd
Expand Down
2 changes: 2 additions & 0 deletions docs/general_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ theme = "Dracula" # the theme to use by default
default_source = "Nyaa" # the source to use by default
download_client = "qBittorrent" # the download client to use by default
timeout = 30 # request timeout for sources and clients (measured in seconds)
cursor_padding = 4 # cursor padding for input fields
scroll_padding = 6 # scroll padding for results table
save_config_on_change = true # save config when changing sources/themes
hot_reload_config = true # hot-reload config on change

# ...
```
Expand Down
34 changes: 34 additions & 0 deletions docs/home-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Home-manager
When using home-manager, you can import a custom module to configure nyaa.

First, add to `inputs` in `flake.nix`:
```nix
nyaa = {
url = "github:Beastwick18/nyaa";
inputs.nixpkgs.follows = "nixpkgs";
};
```

Then, add to `home.nix` imports and enable nyaa:
```nix
imports = [
inputs.nyaa.homeManagerModule
]
programs.nyaa.enable = true;
```

## Options
Most options available in the `config.toml` file can be configured through home-manager. The only option not available is
`save_config_on_change`. This is because the value should always be `false` since the config will be saved to the nix store,
which is read-only.

For global options (not in a table), you can modify them with `programs.nyaa.*`. So to change the timeout, you could write:
```nix
programs.nyaa.timeout = 45;
```

For tables, such as `client.qBittorrent`, you would access it like `programs.nyaa.client.qBittorrent.*`
and add the property you want to change in the attribute set. So to change the base_url, you would write:
```nix
programs.nyaa.client.qBittorrent.base_url = "...";
```
4 changes: 2 additions & 2 deletions docs/keybinds.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ This mode is entered when the results table is focused.
| P, H | First Page |
| r | Reload |
| o | Open in browser |
| yt, ym, yp, yi | Copy torrent link/magnet link/post link/imdb id |
| yt, ym, yp, yi, yn | Copy torrent/magnet/post link/imdb id/name |
| Space | Toggle item for batch download |
| Ctrl-Space | Multi-line select torrents |
| v/V/Ctrl-Space | Enter visual add/remove/toggle mode |
| Tab/Shift-Tab | Switch to Batches|
| /, i | Search |
| c | Categories |
Expand Down

0 comments on commit ad2626c

Please sign in to comment.