Skip to content

Commit 70915be

Browse files
committed
📝 Add documentation comments on function
1 parent 3bdbd21 commit 70915be

File tree

4 files changed

+47
-31
lines changed

4 files changed

+47
-31
lines changed

denops_std/function/README.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
1-
# function
2-
3-
`function`, `function/vim`, and `function/nvim` are modules to provide functions
4-
of Vim and Neovim native functions.
5-
6-
- [API documentation](https://doc.deno.land/https/deno.land/x/denops_std/function/mod.ts)
7-
- [API documentation (Vim)](https://doc.deno.land/https/deno.land/x/denops_std/function/vim/mod.ts)
8-
- [API documentation (Neovim)](https://doc.deno.land/https/deno.land/x/denops_std/function/nvim/mod.ts)
9-
101
Most of codes are automatically generated by
112
[`gen-function.ts`](../../scripts/gen-function/gen-function.ts) from `eval.txt`
123
in minimal supported Vim and Neovim versions.
134

14-
## Example
15-
16-
```typescript
17-
import { Denops } from "../mod.ts";
18-
import * as fn from "../function/mod.ts";
19-
import * as vimFn from "../function/vim/mod.ts";
20-
import * as nvimFn from "../function/nvim/mod.ts";
21-
22-
export async function main(denops: Denops): Promise<void> {
23-
// fn holds functions exists in both Vim and Neovim
24-
console.log(fn.or(denops, 0, 1));
25-
26-
// vimFn holds functions exists only in Vim
27-
console.log(vimFn.balloon_gettext(denops));
28-
29-
// nvimFn holds functions exists only in Neovim
30-
console.log(nvimFn.api_info(denops));
31-
}
32-
```
33-
34-
## How to add functions manually
35-
365
To add functions manually, create or modify corresponding module under
376
`function`, `function/vim`, or `function/nvim` module then make sure that module
387
is listed in `_manual.ts` uneder corresponding module. After that, execute

denops_std/function/mod.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* A module to provide functions of Vim and Neovim native functions.
3+
*
4+
* ```typescript
5+
* import { Denops } from "../mod.ts";
6+
* import * as fn from "../function/mod.ts";
7+
*
8+
* export async function main(denops: Denops): Promise<void> {
9+
* // fn holds functions exists in both Vim and Neovim
10+
* console.log(fn.or(denops, 0, 1));
11+
* }
12+
* ```
13+
*
14+
* See [`vim/mod.ts`](./vim/mod.ts) or [`nvim/mod.ts`](nvim/mod.ts) if you need Vim or Neovim specific functions.
15+
*
16+
* @module
17+
*/
118
// NOTE:
219
// Do NOT add modules manually to this file.
320
// Add modules to `_manual.ts` instead for manually written modules.

denops_std/function/nvim/mod.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* A module to provide functions of Neovim native functions.
3+
*
4+
* ```typescript
5+
* import { Denops } from "../../mod.ts";
6+
* import * as nvimFn from "../../function/nvim/mod.ts";
7+
*
8+
* export async function main(denops: Denops): Promise<void> {
9+
* // nvimFn holds functions exists only in Neovim
10+
* console.log(nvimFn.api_info(denops));
11+
* }
12+
* ```
13+
*
14+
* @module
15+
*/
116
// NOTE:
217
// Do NOT add modules manually to this file.
318
// Add modules to `_manual.ts` instead for manually written modules.

denops_std/function/vim/mod.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**
2+
* A module to provide functions of Vim native functions.
3+
*
4+
* ```typescript
5+
* import { Denops } from "../../mod.ts";
6+
* import * as vimFn from "../../function/vim/mod.ts";
7+
*
8+
* export async function main(denops: Denops): Promise<void> {
9+
* // vimFn holds functions exists only in Vim
10+
* console.log(vimFn.balloon_gettext(denops));
11+
* }
12+
* ```
13+
*
14+
* @module
15+
*/
116
// NOTE:
217
// Do NOT add modules manually to this file.
318
// Add modules to `_manual.ts` instead for manually written modules.

0 commit comments

Comments
 (0)