Skip to content

Commit

Permalink
docs: add new bulk kind docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Apr 25, 2024
1 parent 1a8d6ac commit 4415b7d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
43 changes: 31 additions & 12 deletions docs/dds.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,7 @@ hover,0,200,{"tab":0,"url":"/root/foo.txt"}

### `rename` - rename a file {#rename}

`sub()` callback body:

```lua
{
tab = 0,
from = Url("/root/foo.txt"),
to = Url("/root/bar.txt"),
}
```

`sub_remote()` callback body:
`sub()` / `sub_remote()` callback body:

```lua
{
Expand All @@ -189,7 +179,36 @@ rename,0,1711957878076791,{"tab":0,"from":"/root/foo.txt","to":"/root/bar.txt"}

### `bulk` - bulk rename files {#bulk}

TODO
:::note
This kind currently requires the nightly version of Yazi.
:::

`sub()` / `sub_remote()` callback body:

```lua
-- Since `Iterator` implementing `__pairs()`,
-- you can iterate over all URL pairs using `pairs(body)`
Iterator {
__len = function(self)
-- Returns the number of files changed
end,
__pairs = function(self)
-- Returns (Url("/path/from.txt"), Url("/path/to.txt"))
end
}
```

`--local-events` stdout payload:

```sh
bulk,1711957542289249,1711957542289249,{"changes":{"/path/from.txt":"/path/to.txt"}}
```

`--remote-events` stdout payload:

```sh
bulk,0,1711957542289249,{"changes":{"/path/from.txt":"/path/to.txt"}}
```

### `yank` - yank files {#yank}

Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update
```

Now you can install `yazi-fm` from [crates.io](https://crates.io/crates/yazi-fm):
Now you can install Yazi from crates.io:

```sh
cargo install --locked yazi-fm
cargo install --locked yazi-fm yazi-cli
```

Or install the latest git version:
Expand Down

0 comments on commit 4415b7d

Please sign in to comment.