mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
docs: docgen
This commit is contained in:
parent
d3efb92aa5
commit
636a17fd66
5 changed files with 84 additions and 11 deletions
|
@ -16,6 +16,7 @@ Table of Contents *snacks-init-table-of-contents*
|
|||
---@class snacks.Config
|
||||
---@field bigfile? snacks.bigfile.Config | { enabled: boolean }
|
||||
---@field gitbrowse? snacks.gitbrowse.Config
|
||||
---@field input? snacks.input.Config
|
||||
---@field lazygit? snacks.lazygit.Config
|
||||
---@field notifier? snacks.notifier.Config | { enabled: boolean }
|
||||
---@field quickfile? { enabled: boolean }
|
||||
|
@ -47,6 +48,7 @@ Table of Contents *snacks-init-table-of-contents*
|
|||
---@field debug snacks.debug
|
||||
---@field git snacks.git
|
||||
---@field gitbrowse snacks.gitbrowse
|
||||
---@field input snacks.input
|
||||
---@field lazygit snacks.lazygit
|
||||
---@field notifier snacks.notifier
|
||||
---@field notify snacks.notify
|
||||
|
|
|
@ -13,7 +13,7 @@ Table of Contents *snacks-lazygit-table-of-contents*
|
|||
- Snacks.lazygit.log_file()|snacks-lazygit-module-snacks.lazygit.log_file()|
|
||||
- Snacks.lazygit.open() |snacks-lazygit-module-snacks.lazygit.open()|
|
||||
5. Links |snacks-lazygit-links|
|
||||
Autmatically configures lazygit with a theme generated based on your Neovim
|
||||
Automatically configures lazygit with a theme generated based on your Neovim
|
||||
colorscheme and integrate edit with the current neovim instance.
|
||||
|
||||
|
||||
|
|
|
@ -3,15 +3,17 @@
|
|||
==============================================================================
|
||||
Table of Contents *snacks-terminal-table-of-contents*
|
||||
|
||||
1. Config |snacks-terminal-config|
|
||||
2. Styles |snacks-terminal-styles|
|
||||
1. Usage |snacks-terminal-usage|
|
||||
- Edgy Integration |snacks-terminal-usage-edgy-integration|
|
||||
2. Config |snacks-terminal-config|
|
||||
3. Styles |snacks-terminal-styles|
|
||||
- terminal |snacks-terminal-styles-terminal|
|
||||
3. Types |snacks-terminal-types|
|
||||
4. Module |snacks-terminal-module|
|
||||
4. Types |snacks-terminal-types|
|
||||
5. Module |snacks-terminal-module|
|
||||
- Snacks.terminal() |snacks-terminal-module-snacks.terminal()|
|
||||
- Snacks.terminal.open() |snacks-terminal-module-snacks.terminal.open()|
|
||||
- Snacks.terminal.toggle() |snacks-terminal-module-snacks.terminal.toggle()|
|
||||
5. Links |snacks-terminal-links|
|
||||
6. Links |snacks-terminal-links|
|
||||
Create and toggle terminal windows.
|
||||
|
||||
Based on the provided options, some defaults will be set:
|
||||
|
@ -22,7 +24,38 @@ Based on the provided options, some defaults will be set:
|
|||
|
||||
|
||||
==============================================================================
|
||||
1. Config *snacks-terminal-config*
|
||||
1. Usage *snacks-terminal-usage*
|
||||
|
||||
|
||||
EDGY INTEGRATION *snacks-terminal-usage-edgy-integration*
|
||||
|
||||
>lua
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
---@module 'edgy'
|
||||
---@param opts Edgy.Config
|
||||
opts = function(_, opts)
|
||||
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
|
||||
opts[pos] = opts[pos] or {}
|
||||
table.insert(opts[pos], {
|
||||
ft = "snacks_terminal",
|
||||
size = { height = 0.4 },
|
||||
title = "%{b:snacks_terminal.id}: %{b:term_title}",
|
||||
filter = function(_buf, win)
|
||||
return vim.w[win].snacks_win
|
||||
and vim.w[win].snacks_win.position == pos
|
||||
and vim.w[win].snacks_win.relative == "editor"
|
||||
and not vim.w[win].trouble_preview
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
<
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Config *snacks-terminal-config*
|
||||
|
||||
>lua
|
||||
---@class snacks.terminal.Config
|
||||
|
@ -35,7 +68,7 @@ Based on the provided options, some defaults will be set:
|
|||
|
||||
|
||||
==============================================================================
|
||||
2. Styles *snacks-terminal-styles*
|
||||
3. Styles *snacks-terminal-styles*
|
||||
|
||||
|
||||
TERMINAL *snacks-terminal-styles-terminal*
|
||||
|
@ -78,7 +111,7 @@ TERMINAL *snacks-terminal-styles-terminal*
|
|||
|
||||
|
||||
==============================================================================
|
||||
3. Types *snacks-terminal-types*
|
||||
4. Types *snacks-terminal-types*
|
||||
|
||||
>lua
|
||||
---@class snacks.terminal.Opts: snacks.terminal.Config
|
||||
|
@ -89,7 +122,7 @@ TERMINAL *snacks-terminal-styles-terminal*
|
|||
|
||||
|
||||
==============================================================================
|
||||
4. Module *snacks-terminal-module*
|
||||
5. Module *snacks-terminal-module*
|
||||
|
||||
>lua
|
||||
---@class snacks.terminal: snacks.win
|
||||
|
@ -130,7 +163,7 @@ and `vim.v.count1` options.
|
|||
<
|
||||
|
||||
==============================================================================
|
||||
5. Links *snacks-terminal-links*
|
||||
6. Links *snacks-terminal-links*
|
||||
|
||||
1. *image*: https://github.com/user-attachments/assets/afcc9989-57d7-4518-a390-cc7d6f0cec13
|
||||
|
||||
|
|
|
@ -19,9 +19,11 @@ Table of Contents *snacks-win-table-of-contents*
|
|||
- win:focus() |snacks-win-module-win:focus()|
|
||||
- win:hide() |snacks-win-module-win:hide()|
|
||||
- win:is_floating() |snacks-win-module-win:is_floating()|
|
||||
- win:lines() |snacks-win-module-win:lines()|
|
||||
- win:parent_size() |snacks-win-module-win:parent_size()|
|
||||
- win:show() |snacks-win-module-win:show()|
|
||||
- win:size() |snacks-win-module-win:size()|
|
||||
- win:text() |snacks-win-module-win:text()|
|
||||
- win:toggle() |snacks-win-module-win:toggle()|
|
||||
- win:update() |snacks-win-module-win:update()|
|
||||
- win:valid() |snacks-win-module-win:valid()|
|
||||
|
@ -119,6 +121,7 @@ MINIMAL *snacks-win-styles-minimal*
|
|||
winbar = "",
|
||||
statuscolumn = "",
|
||||
wrap = false,
|
||||
sidescrolloff = 0,
|
||||
},
|
||||
}
|
||||
<
|
||||
|
@ -221,6 +224,15 @@ WIN:IS_FLOATING() *snacks-win-module-win:is_floating()*
|
|||
<
|
||||
|
||||
|
||||
WIN:LINES() *snacks-win-module-win:lines()*
|
||||
|
||||
>lua
|
||||
---@param from? number
|
||||
---@param to? number
|
||||
win:lines(from, to)
|
||||
<
|
||||
|
||||
|
||||
WIN:PARENT_SIZE() *snacks-win-module-win:parent_size()*
|
||||
|
||||
>lua
|
||||
|
@ -243,6 +255,15 @@ WIN:SIZE() *snacks-win-module-win:size()*
|
|||
<
|
||||
|
||||
|
||||
WIN:TEXT() *snacks-win-module-win:text()*
|
||||
|
||||
>lua
|
||||
---@param from? number
|
||||
---@param to? number
|
||||
win:text(from, to)
|
||||
<
|
||||
|
||||
|
||||
WIN:TOGGLE() *snacks-win-module-win:toggle()*
|
||||
|
||||
>lua
|
||||
|
|
17
docs/win.md
17
docs/win.md
|
@ -87,6 +87,7 @@ Snacks.win({
|
|||
winbar = "",
|
||||
statuscolumn = "",
|
||||
wrap = false,
|
||||
sidescrolloff = 0,
|
||||
},
|
||||
}
|
||||
```
|
||||
|
@ -175,6 +176,14 @@ win:hide()
|
|||
win:is_floating()
|
||||
```
|
||||
|
||||
### `win:lines()`
|
||||
|
||||
```lua
|
||||
---@param from? number
|
||||
---@param to? number
|
||||
win:lines(from, to)
|
||||
```
|
||||
|
||||
### `win:parent_size()`
|
||||
|
||||
```lua
|
||||
|
@ -194,6 +203,14 @@ win:show()
|
|||
win:size()
|
||||
```
|
||||
|
||||
### `win:text()`
|
||||
|
||||
```lua
|
||||
---@param from? number
|
||||
---@param to? number
|
||||
win:text(from, to)
|
||||
```
|
||||
|
||||
### `win:toggle()`
|
||||
|
||||
```lua
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue