Skip to content

Commit

Permalink
docs: added keybinding documentation to all list type prompts. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
kazhala committed Nov 29, 2021
1 parent 745fb15 commit e748d21
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 13 deletions.
17 changes: 15 additions & 2 deletions docs/pages/prompts/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,23 @@ choices = [
## Keybindings

```{seealso}
{ref}`pages/prompts/list:Keybindings`
{ref}`pages/kb:Keybindings`
```

This prompt shares the same keybindings as {ref}`select prompt <pages/prompts/list:keybindings>`.
```{include} ../kb.md
:start-after: <!-- start kb -->
:end-before: <!-- end kb -->
```

```{include} ./list.md
:start-after: <!-- start list kb -->
:end-before: <!-- end list kb -->
```

```{include} ./list.md
:start-after: <!-- start list vi kb -->
:end-before: <!-- end list vi kb -->
```

## Default Value

Expand Down
23 changes: 20 additions & 3 deletions docs/pages/prompts/expand.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,28 @@ choices = [
## Keybindings

```{seealso}
{ref}`pages/prompts/list:keybindings`
{ref}`pages/kb:Keybindings`
```

In addition to the keybindings mentioned in {ref}`select prompt <pages/prompts/list:keybindings>`, keybindings are created for all the
`key` specified for each choice which you can use to jump the target choice.
```{hint}
In addition to the keybindings mentioned below, keybindings are created for all the `key` specified for each choice which you can
use to jump to the target choce.
```

```{include} ../kb.md
:start-after: <!-- start kb -->
:end-before: <!-- end kb -->
```

```{include} ./list.md
:start-after: <!-- start list kb -->
:end-before: <!-- end list kb -->
```

```{include} ./list.md
:start-after: <!-- start list vi kb -->
:end-before: <!-- end list vi kb -->
```

## Multiple Selection

Expand Down
20 changes: 15 additions & 5 deletions docs/pages/prompts/fuzzy.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,25 @@ This prompt does not accepts choices containing {ref}`pages/separator:Separator`
## Keybindings

```{seealso}
{ref}`pages/prompts/list:keybindings`
{ref}`pages/kb:Keybindings`
```

This prompt shares the same keybindings as {ref}`select prompt <pages/prompts/list:keybindings>`.

However it does not enable `j/k` navigation when `vi_mode` is True.
When `vi_mode` is True in fuzzy prompt, the input buffer will become vim input mode, no other keybindings are altered.
```{hint}
This prompt does not enable `j/k` navigation when `vi_mode` is `True`. When `vi_mode` is `True` in fuzzy prompt, the input buffer
will become vim input mode, no other keybindings are altered.
The `space` key for toggle choice is also disabled since it blocks user from typing space in the input buffer.
```

```{include} ../kb.md
:start-after: <!-- start kb -->
:end-before: <!-- end kb -->
```

```{include} ./list.md
:start-after: <!-- start list kb -->
:end-before: <!-- end list kb -->
```

## Multiple Selection

Expand Down
8 changes: 8 additions & 0 deletions docs/pages/prompts/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ A prompt that displays a list of choices to select.
:end-before: <!-- end kb -->
```

<!-- start list kb -->

The following dictionary contains the additional keybindings created by this prompt.

```{code-block} python
Expand Down Expand Up @@ -76,6 +78,10 @@ The following dictionary contains the additional keybindings created by this pro
}
```

<!-- end list kb -->

<!-- start list vi kb -->

When `vi_mode` is True, the "up" and "down" navigation key will be changed.

```{code-block} python
Expand All @@ -91,6 +97,8 @@ When `vi_mode` is True, the "up" and "down" navigation key will be changed.
}
```

<!-- end list vi kb -->

## Multiple Selection

```{seealso}
Expand Down
22 changes: 19 additions & 3 deletions docs/pages/prompts/rawlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,27 @@ For this specific prompt, due to the shortcut being created is between 1-9, the
## Keybindings

```{seealso}
{ref}`pages/prompts/list:keybindings`
{ref}`pages/kb:Keybindings`
```

In addition to the keybindings mentioned in {ref}`select prompt <pages/prompts/list:keybindings>`, keybindings are created for keys 1-9
to jump to the target index choices.
```{hint}
In addition to the keybindings mentioned below, keybindings are created for keys 1-9 to jump to the target index choices.
```

```{include} ../kb.md
:start-after: <!-- start kb -->
:end-before: <!-- end kb -->
```

```{include} ./list.md
:start-after: <!-- start list kb -->
:end-before: <!-- end list kb -->
```

```{include} ./list.md
:start-after: <!-- start list vi kb -->
:end-before: <!-- end list vi kb -->
```

## Multiple Selection

Expand Down

0 comments on commit e748d21

Please sign in to comment.