From a23f52bca0c2ae9ff50f8f033b13e8bd82372fc6 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 29 Oct 2022 19:36:11 +0800 Subject: [PATCH] docs(notify): update the doc for notify api --- docs/api/notify.md | 23 +++++++++++++++-------- docs/cn/api/notify.md | 4 ++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/api/notify.md b/docs/api/notify.md index 813737dde..6914c1971 100644 --- a/docs/api/notify.md +++ b/docs/api/notify.md @@ -8,7 +8,8 @@ description: "notify API provides some basic functions for generating notificati - [Intro](#intro) -- [Functions](#functions) +- [Functions and variables](#functions-and-variables) +- [Usage](#usage) @@ -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 | diff --git a/docs/cn/api/notify.md b/docs/cn/api/notify.md index 41c740d31..8e6627e15 100644 --- a/docs/cn/api/notify.md +++ b/docs/cn/api/notify.md @@ -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!') ```