Skip to content

Commit 41f2788

Browse files
committed
docs(#2934): add lintdoc.sh, fix some branding spelling
1 parent 42271b9 commit 41f2788

File tree

5 files changed

+60
-20
lines changed

5 files changed

+60
-20
lines changed

doc/nvim-tree-lua.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*nvim-tree* A File Explorer For nvim
1+
*nvim-tree* A File Explorer For Nvim
22

33
Author: Yazdani Kiyan
44

@@ -105,7 +105,7 @@ Git Integration
105105

106106
Requirements
107107

108-
This file explorer requires nvim >= 0.9
108+
This file explorer requires Nvim >= 0.9
109109

110110
==============================================================================
111111
2. QUICKSTART *nvim-tree-quickstart*
@@ -364,7 +364,7 @@ See |nvim-tree-highlight| for details.
364364
4. SETUP *nvim-tree-setup*
365365

366366
You must run setup() function once to initialise nvim-tree. It may be called
367-
again to apply a change in configuration without restarting nvim.
367+
again to apply a change in configuration without restarting Nvim.
368368

369369
setup() function takes one optional argument: configuration table. If omitted
370370
nvim-tree will be initialised with default configuration.
@@ -1235,18 +1235,18 @@ Takes the `BufEnter` event as an argument. see |autocmd-events|
12351235

12361236
Open a file or directory in your preferred application.
12371237

1238-
|vim.ui.open()| was introduced in nvim 0.10 and is the default.
1238+
|vim.ui.open()| was introduced in Nvim 0.10 and is the default.
12391239

1240-
Once nvim-tree minimum nvim version is updated to 0.10, these options will
1240+
Once nvim-tree minimum Nvim version is updated to 0.10, these options will
12411241
no longer be necessary and will be removed.
12421242

12431243
*nvim-tree.system_open.cmd*
12441244
The open command itself.
12451245
Type: `string`, Default: `""`
12461246

1247-
nvim >= 0.10 defaults to |vim.ui.open()|
1247+
Nvim >= 0.10 defaults to |vim.ui.open()|
12481248

1249-
nvim < 0.10 defaults to:
1249+
Nvim < 0.10 defaults to:
12501250
UNIX: `"xdg-open"`
12511251
macOS: `"open"`
12521252
Windows: `"cmd"`
@@ -1495,7 +1495,7 @@ Configuration for |nvim-tree-api.tree.expand_all()| and
14951495

14961496
*nvim-tree.actions.expand_all.max_folder_discovery*
14971497
Limit the number of folders being explored when expanding every folders.
1498-
Avoids hanging nvim when running this action on very large folders.
1498+
Avoids hanging Nvim when running this action on very large folders.
14991499
Type: `number`, Default: `300`
15001500

15011501
*nvim-tree.actions.expand_all.exclude*
@@ -3058,13 +3058,13 @@ Contents of `my-decorator.lua`:
30583058
Windows WSL and PowerShell
30593059
- Trash is synchronized
30603060
- Executable file detection is disabled as this is non-performant and can
3061-
freeze nvim
3061+
freeze Nvim
30623062
- Some filesystem watcher error related to permissions will not be reported
30633063

30643064
==============================================================================
30653065
13. NETRW *nvim-tree-netrw*
30663066

3067-
|netrw| is a standard nvim plugin that is enabled by default. It provides,
3067+
|netrw| is a standard Nvim plugin that is enabled by default. It provides,
30683068
amongst other functionality, a file/directory browser.
30693069

30703070
It interferes with nvim-tree and the intended user experience is nvim-tree
@@ -3941,14 +3941,14 @@ Class: Config.SystemOpen *nvim-tree-config-system-open*
39413941
*nvim_tree.Config.SystemOpen*
39423942
Open files or directories via the OS.
39433943

3944-
nvim:
3944+
Nvim:
39453945
`>=` 0.10 uses |vim.ui.open()| unless {cmd} is specified
39463946
`<` 0.10 calls external {cmd}:
39473947
• UNIX: `xdg-open`
39483948
• macOS: `open`
39493949
• Windows: `cmd`
39503950

3951-
Once nvim-tree minimum nvim version is updated to 0.10, these options will
3951+
Once nvim-tree minimum Nvim version is updated to 0.10, these options will
39523952
no longer be necessary and will be removed.
39533953

39543954
Fields: ~
@@ -4185,7 +4185,7 @@ Class: Config.Actions *nvim-tree-config-actions*
41854185
Fields: ~
41864186
• {max_folder_discovery}? (`integer`, default: `300`) Limit the number
41874187
of folders being explored when expanding
4188-
every folder. Avoids hanging nvim when
4188+
every folder. Avoids hanging Nvim when
41894189
running this action on very large folders.
41904190
{exclude}? (`string[]`, default: `{}`) A list of
41914191
directories that should not be expanded

lua/nvim-tree/_meta/config/actions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ error("Cannot require a meta file")
4242
---Configure [nvim-tree-api.tree.expand_all()] and [nvim-tree-api.node.expand()]
4343
---@class nvim_tree.Config.Actions.ExpandAll
4444
---
45-
---Limit the number of folders being explored when expanding every folder. Avoids hanging nvim when running this action on very large folders.
45+
---Limit the number of folders being explored when expanding every folder. Avoids hanging Nvim when running this action on very large folders.
4646
---(default: `300`)
4747
---@field max_folder_discovery? integer
4848
---

lua/nvim-tree/_meta/config/system_open.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ error("Cannot require a meta file")
33

44
---Open files or directories via the OS.
55
---
6-
---nvim:
6+
---Nvim:
77
---- `>=` 0.10 uses [vim.ui.open()] unless {cmd} is specified
88
---- `<` 0.10 calls external {cmd}:
99
--- - UNIX: `xdg-open`
1010
--- - macOS: `open`
1111
--- - Windows: `cmd`
1212
---
13-
---Once nvim-tree minimum nvim version is updated to 0.10, these options will no longer be necessary and will be removed.
13+
---Once nvim-tree minimum Nvim version is updated to 0.10, these options will no longer be necessary and will be removed.
1414
---
1515
---@class nvim_tree.Config.SystemOpen
1616
---

scripts/gen_vimdoc.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
#!/usr/bin/env sh
22

3+
# Wrapper around nvim help generator gen_vimdoc.lua, run as part of nvim's make doc target.
4+
#
5+
# Doesn't require nvim to have been built.
6+
#
7+
# Shims our moudules into gen_vimdoc_config.lua, replacing nvim's.
8+
#
9+
# There are some hardcoded expectations which we work around as commented.
10+
311
set -e
412

5-
if [ ! -d "${NEOVIM_SRC}" ]; then
6-
echo "\$NEOVIM_SRC not set"
13+
if [ ! -d "${NVIM_SRC}" ]; then
14+
echo "\$NVIM_SRC not set"
715
exit 1
816
fi
917

@@ -12,11 +20,11 @@ mkdir -pv runtime/doc
1220
cp -v "doc/nvim-tree-lua.txt" runtime/doc
1321

1422
# modify gen_vimdoc.lua to use our config
15-
cp -v "${NEOVIM_SRC}/src/gen/gen_vimdoc.lua" gen_vimdoc.lua
23+
cp -v "${NVIM_SRC}/src/gen/gen_vimdoc.lua" gen_vimdoc.lua
1624
sed -i -E 's/spairs\(config\)/spairs\(require("gen_vimdoc_config")\)/g' gen_vimdoc.lua
1725

1826
# use luacacts etc. from neovim src as well as our specific config
19-
export LUA_PATH="${NEOVIM_SRC}/src/?.lua;scripts/?.lua"
27+
export LUA_PATH="${NVIM_SRC}/src/?.lua;scripts/?.lua"
2028

2129
# generate
2230
./gen_vimdoc.lua

scripts/lintdoc.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env sh
2+
3+
# Wrapper around nvim help linter lintdoc.lua, run as part of nvim's make lintdoc target.
4+
#
5+
# Requires nvim to have been built.
6+
#
7+
# Desired:
8+
# - tags valid
9+
# - links valid
10+
# Also:
11+
# - brand spelling, notably Nvim and Lua
12+
#
13+
# There are some hardcoded expectations which we work around as commented.
14+
15+
set -e
16+
17+
if [ ! -d "${NVIM_SRC}" ]; then
18+
echo "\$NVIM_SRC not set"
19+
exit 1
20+
fi
21+
22+
# runtime/doc in the nvim source is practically hardcoded, copy our help in
23+
cp -v "doc/nvim-tree-lua.txt" "${NVIM_SRC}/runtime/doc"
24+
25+
# run from within nvim source
26+
cd "${NVIM_SRC}"
27+
28+
# make nvim
29+
make
30+
31+
# execute the lint
32+
VIMRUNTIME=runtime scripts/lintdoc.lua

0 commit comments

Comments
 (0)