mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
chore(build): auto-generate docs
This commit is contained in:
parent
e35d6cd4ba
commit
cfb4be1a24
2 changed files with 39 additions and 66 deletions
|
@ -58,12 +58,19 @@ to the supported formats (all except PNG).
|
|||
{
|
||||
formats = { "png", "jpg", "jpeg", "gif", "bmp", "webp", "tiff", "heic", "avif", "mp4", "mov", "avi", "mkv", "webm" },
|
||||
force = false, -- try displaying the image, even if the terminal does not support it
|
||||
markdown = {
|
||||
-- enable image viewer for markdown files
|
||||
-- if your env doesn't support unicode placeholders, this will be disabled
|
||||
doc = {
|
||||
-- enable image viewer for documents
|
||||
-- a treesitter parser must be available for the enabled languages.
|
||||
-- supported language injections: markdown, html
|
||||
enabled = true,
|
||||
inline = true, -- render the image inline in the buffer (takes precedence over `opts.float` on supported terminals)
|
||||
float = true, -- render the image in a floating window
|
||||
lang = { "markdown", "html" },
|
||||
-- render the image inline in the buffer
|
||||
-- if your env doesn't support unicode placeholders, this will be disabled
|
||||
-- takes precedence over `opts.float` on supported terminals
|
||||
inline = true,
|
||||
-- render the image in a floating window
|
||||
-- only used if `opts.inline` is disabled
|
||||
float = true,
|
||||
max_width = 80,
|
||||
max_height = 40,
|
||||
},
|
||||
|
@ -139,49 +146,15 @@ docs for more information on how to customize these styles
|
|||
|
||||
## 📦 Module
|
||||
|
||||
### `Snacks.image.attach()`
|
||||
|
||||
```lua
|
||||
---@param buf number
|
||||
---@param opts? snacks.image.Opts|{src?: string}
|
||||
Snacks.image.attach(buf, opts)
|
||||
```
|
||||
|
||||
### `Snacks.image.dim()`
|
||||
|
||||
Get the dimensions of a PNG file
|
||||
|
||||
```lua
|
||||
---@param file string
|
||||
---@return number width, number height
|
||||
Snacks.image.dim(file)
|
||||
```
|
||||
|
||||
### `Snacks.image.env()`
|
||||
|
||||
```lua
|
||||
Snacks.image.env()
|
||||
```
|
||||
|
||||
### `Snacks.image.markdown()`
|
||||
|
||||
```lua
|
||||
---@param buf? number
|
||||
Snacks.image.markdown(buf)
|
||||
```
|
||||
|
||||
### `Snacks.image.request()`
|
||||
|
||||
```lua
|
||||
---@param opts table<string, string|number>|{data?: string}
|
||||
Snacks.image.request(opts)
|
||||
```
|
||||
|
||||
### `Snacks.image.set_cursor()`
|
||||
|
||||
```lua
|
||||
---@param pos {[1]: number, [2]: number}
|
||||
Snacks.image.set_cursor(pos)
|
||||
---@class snacks.image
|
||||
---@field terminal snacks.image.terminal
|
||||
---@field image snacks.Image
|
||||
---@field placement snacks.image.Placement
|
||||
---@field util snacks.image.util
|
||||
---@field buf snacks.image.buf
|
||||
---@field doc snacks.image.doc
|
||||
Snacks.image = {}
|
||||
```
|
||||
|
||||
### `Snacks.image.supports()`
|
||||
|
|
|
@ -602,23 +602,6 @@ Snacks.picker.pick({source = "files", ...})
|
|||
---@field notify? boolean
|
||||
```
|
||||
|
||||
```lua
|
||||
---@alias snacks.Picker.ref (fun():snacks.Picker?)|{value?: snacks.Picker}
|
||||
```
|
||||
|
||||
```lua
|
||||
---@class snacks.picker.Last
|
||||
---@field cursor number
|
||||
---@field topline number
|
||||
---@field opts? snacks.picker.Config
|
||||
---@field selected snacks.picker.Item[]
|
||||
---@field filter snacks.picker.Filter
|
||||
```
|
||||
|
||||
```lua
|
||||
---@alias snacks.picker.history.Record {pattern: string, search: string, live?: boolean}
|
||||
```
|
||||
|
||||
```lua
|
||||
---@alias snacks.picker.Extmark vim.api.keyset.set_extmark|{col:number, row?:number, field?:string}
|
||||
---@alias snacks.picker.Text {[1]:string, [2]:string?, virtual?:boolean, field?:string}
|
||||
|
@ -697,6 +680,23 @@ It's a previewer that shows a preview based on the item data.
|
|||
---@field preview? snacks.win.Config|{} preview window config
|
||||
```
|
||||
|
||||
```lua
|
||||
---@alias snacks.Picker.ref (fun():snacks.Picker?)|{value?: snacks.Picker}
|
||||
```
|
||||
|
||||
```lua
|
||||
---@class snacks.picker.Last
|
||||
---@field cursor number
|
||||
---@field topline number
|
||||
---@field opts? snacks.picker.Config
|
||||
---@field selected snacks.picker.Item[]
|
||||
---@field filter snacks.picker.Filter
|
||||
```
|
||||
|
||||
```lua
|
||||
---@alias snacks.picker.history.Record {pattern: string, search: string, live?: boolean}
|
||||
```
|
||||
|
||||
## 📦 Module
|
||||
|
||||
```lua
|
||||
|
@ -2689,6 +2689,8 @@ Snacks.picker.actions.toggle_preview(picker)
|
|||
Snacks.picker.actions.yank(picker, item, action)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 📦 `snacks.picker.core.picker`
|
||||
|
||||
```lua
|
||||
|
@ -2943,5 +2945,3 @@ Get the word under the cursor or the current visual selection
|
|||
```lua
|
||||
picker:word()
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue