1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:30:05 +08:00

docs(notify): update the doc for notify api

This commit is contained in:
wsdjeg 2022-10-29 19:36:11 +08:00
parent a6baae5924
commit a23f52bca0
2 changed files with 19 additions and 8 deletions

View File

@ -8,7 +8,8 @@ description: "notify API provides some basic functions for generating notificati
<!-- vim-markdown-toc GFM -->
- [Intro](#intro)
- [Functions](#functions)
- [Functions and variables](#functions-and-variables)
- [Usage](#usage)
<!-- vim-markdown-toc -->
@ -16,14 +17,20 @@ description: "notify API provides some basic functions for generating notificati
This api provides some basic Functions for generating notifications.
## Functions and variables
| function name | description |
| --------------------------- | -------------------------------------------------------- |
| `notify(string)` | generate notification with default color |
| `notify(string, highlight)` | generate notification with custom highlight group |
| `notify.notify_max_width` | set the max width of notify windows |
| `notify.timeout` | set the time in milliseconds to close the notify windows |
## Usage
```vim
let s:NOTIFY = SpaceVim#api#import('notify')
let s:NOTIFY.notify_max_width = 40
let s:NOTIFY.timeout = 3000
call s:NOTIFY.notify('This is a simple notification!')
```
## Functions
| function name | description |
| --------------------------- | ------------------------------------------------- |
| `notify(string)` | generate notification with default color |
| `notify(string, highlight)` | generate notification with custom highlight group |

View File

@ -24,6 +24,8 @@ lang: zh
| --------------------------- | ---------------------------- |
| `notify(string)` | 使用默认的颜色弹出通知消息 |
| `notify(string, highlight)` | 使用自定义的颜色弹出通知消息 |
| `notify.notify_max_width` | 设置通知窗口的宽度 |
| `notify.timeout` | 设置通知窗口关闭的延迟时间 |
## 使用示例
@ -31,5 +33,7 @@ lang: zh
```vim
let s:NOTIFY = SpaceVim#api#import('notify')
let s:NOTIFY.notify_max_width = 40
let s:NOTIFY.timeout = 3000
call s:NOTIFY.notify('This is a simple notification!')
```