Skip to content

Commit 869fc95

Browse files
authored
docs(#2934): add nvim_tree.config* classes with generated help and new nvim-tree-icons-highlighting help section (#3235)
* doc(#2934): POC to use gen_vimdoc.lua for decorator meta * doc(#2934): use injected gen_vimdoc.lua from nvim source, move decorators to main help * doc(#2934): tidy and harden scripts * doc(#2934): add nvim_tree.Config meta classes, add nvim_tree.api. meta classes * doc(#2934): add nvim_tree.Config to help * doc(#2934): add nvim_tree.api classes to help * doc(#2934): tidy and correct nvim_tree.Config.UI and nvim_tree.Config.Actions * doc(#2934): tidy and correct nvim_tree.Config.HijackDirectories, format and order nvim_tree.Config * doc(#2934): tidy and nvim_tree.Config top level * doc(#2934): tidy and format nvim_tree.Config.LiveFilter, Modified, Tab, Trash * doc(#2934): tidy and format nvim_tree.Config.FilesystemWatchers, Log * doc(#2934): split nvim_tree.Config into files, Sort and HijackDirectories populate others placeholder * doc(#2934): more generic gen_vimdoc_config module config * doc(#2934): tidy Config.HijackDirectories and Actions, move them into place * doc(#2934): tidy Config.Modified, move into place * doc(#2934): tidy Config.LiveFilter, move into place * doc(#2934): tidy Config.FilesystemWatchers, move into place * doc(#2934): tidy Config.Trash, move into place * doc(#2934): tidy Config.Tab, move into place * doc(#2934): tidy Config.UI, move into place * doc(#2934): tidy Config.Log, move into place * doc(#2934): tidy Config.Notify, move into place * doc(#2934): tidy Config.SystemOpen, move into place * doc(#2934): tidy Config.Help, move into place * doc(#2934): tidy Config.Help, move into place * doc(#2934): tidy Config.Help, move into place * doc(#2934): tidy Config.Diagnostics, move into place * doc(#2934): remove api/decorator as they are out of scope, revert api_decorator.lua changes, retain api opts classes but make them exact * doc(#2934): tidy Config.Filters, move into place * doc(#2934): tidy Config.FilesystemWatchers, move into place * doc(#2934): tidy Config.FilesystemWatchers, Git, move into place * doc(#2934): tidy Config.UpdateFocusedFile, move into place * doc(#2934): tidy Config.Sort, move into place * doc(#2934): tidy Config.View, move into place * doc(#2934): tidy Config.View, move into place * docs(#2934): type DEFAULT_OPTS, use bracketed references to keep luals happy * docs(#2934): tidy, inline some classes * docs(#2934): tidy Config.Renderer * docs(#2934): remove problematic glyphs, tidy other glyphs * docs(#2934): tidy Config.Renderer, ensure functions are parenthesised when necessary * docs(#2934): tidy Config.Renderer * docs(#2934): tidy Config.Renderer, move into place * docs(#2934): tidy Config.Renderer * docs(#2934): tidy Config.FilesystemWatchers * docs(#2934): fix broken links * docs(#2934): fix broken links * docs(#2934): fix broken links * docs(#2934): fix broken links * docs(#2934): refer to nvim in help, not neovim, as this trips the lintdoc spell checker * docs(#2934): fix broken links * docs(#2934): add lintdoc.sh, fix some branding spelling * docs(#2934): update old config links * docs(#2934): remove 5. Opts, 8.2 Highlight: Overhaul, 15.1 Index: Opts, update links as needed * docs(#2934): remove indices * docs(#2934): add bookmarks, put long descriptions into @brief * docs(#2934): move hidden display to verbatim new section * docs(#2934): add config lsp examples, link setup * docs(#2934): normalise heading formatting, remove TOC * docs(#2934): move all icon and highlight info into a table * docs(#2934): move all icon and highlight info into a new section * docs(#2934): normalise all icon and highlight * docs(#2934): extract nvim_tree.Config field descriptions to class overview * docs(#2934): consistent string formatting * docs(#2934): normalise all icon and highlight * docs(#2934): remove @Briefs as they are shown above the class tag * docs(#2934): don't <pre> filters * docs(#2934): add experimental example * docs(#2934): add gen_vimdoc.sh to CI * docs(#2934): add gen_vimdoc.sh to CI * docs(#2934): add gen_vimdoc.sh to CI * docs(#2934): temporarily --ignore-blank-lines during help check * docs(#2934): add lintdoc.sh to CI * docs(#2934): add lintdoc.sh to CI * docs(#2934): add lintdoc.sh to CI * docs(#2934): move Nvim build and help-check to the end for faster turnaround * docs(#2934): use make lintdoc target directly * docs(#2934): CONTRIBUTING.md updates for help generation and lint * docs(#2934): revert API opts classes changes * docs(#2934): harden gen and lint scripts, moving things out of nvim-tree source to prevent luals upset * docs(#2934): harden gen and lint scripts, moving things out of nvim-tree source to prevent luals upset * docs(#2934): fix lintdoc make target * docs(#2934): polish vimdoc config * docs(#2934): snake case config class names * docs(#2934): snake case config alias names * docs(#2934): note help tag prefixes * docs(#2934): snake case config sections * docs(#2934): move default config to end * docs(#2934): move setup doc from config to quickstart and setup * docs(#2934): index contributing * docs(#2934): tidy gitignore * docs(#2934): tidy formatting * docs(#2934): lint and check scripts, rewrite luals check script following upstream changes * docs(#2934): script tidying * docs(#2934): add a temporary codestyle violation to test scripts * Revert "docs(#2934): add a temporary codestyle violation to test scripts" This reverts commit fca4dbf. * docs(#2934): remove class from config section headers
1 parent ca8d82f commit 869fc95

33 files changed

+3045
-1957
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353

5454
env:
5555
VIMRUNTIME: /home/runner/nvim-${{ matrix.nvim_version }}/share/nvim/runtime
56+
DIR_NVIM_SRC: /home/runner/src/neovim-${{ matrix.nvim_version }}
5657

5758
steps:
5859
- name: checkout
@@ -72,8 +73,15 @@ jobs:
7273
7374
- run: make check
7475

75-
- run: make help-check
76-
7776
- run: make style
7877

7978
- run: make style-doc
79+
80+
- name: build Nvim from source
81+
run: |
82+
mkdir -p "${DIR_NVIM_SRC}"
83+
curl -L "https://github.com/neovim/neovim/archive/refs/tags/${{ matrix.nvim_version }}.tar.gz" | tar zx --directory "${DIR_NVIM_SRC}/.."
84+
cd "${DIR_NVIM_SRC}"
85+
make
86+
87+
- run: make help-check

CONTRIBUTING.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ markdown-toc --maxdepth=2 -i CONTRIBUTING.md
1818
* [check](#check)
1919
- [Diagnostics](#diagnostics)
2020
- [Backwards Compatibility](#backwards-compatibility)
21-
- [Adding New Actions](#adding-new-actions)
2221
- [Documentation](#documentation)
23-
* [Opts](#opts)
22+
* [Config And Mappings](#config-and-mappings)
2423
* [API](#api)
2524
- [Windows](#windows)
2625
- [Pull Request](#pull-request)
@@ -120,19 +119,32 @@ else
120119
end
121120
```
122121

123-
# Adding New Actions
122+
# Documentation
124123

125-
To add a new action, add a file in `actions/name-of-the-action.lua`. You should export a `setup` function if some configuration is needed.
124+
## Config And Mappings
126125

127-
Once you did, you should run `make help-update`
126+
When adding to or changing:
127+
1. Default config
128+
2. `config` classes
129+
3. `on_attach` default mappings
128130

129-
# Documentation
131+
You must generate help documentation. This requires neovim stable sources. You will be promted with instructions on fetching and referencing the source.
130132

131-
## Opts
133+
```sh
134+
make help-update
135+
```
132136

133-
When adding new options, you should declare the defaults in the main `nvim-tree.lua` file.
137+
This will:
138+
1. Update config defaults in `*nvim-tree-setup*`
139+
2. Regenerate from `*nvim-tree-config*` to the end of the file, see `gen_vimdoc.sh`
140+
3. Update default mappings in `*nvim-tree-mappings-default*` and `*nvim-tree-quickstart-help*`
141+
142+
Commit your changes then run:
143+
```sh
144+
make help-check
145+
```
134146

135-
Documentation for options should also be added to `nvim-tree-opts` in `doc/nvim-tree-lua.txt`
147+
This will re-run `help-update` and check that there are no diffs. It will also lint the documentation, see `lintdoc.sh`
136148

137149
## API
138150

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ check: luals
1212
#
1313
# subtasks
1414
#
15+
# TODO #3241 ensure that decorator is checked - all meta should be valid
1516
luacheck:
16-
luacheck --codes --quiet lua --exclude-files "**/_meta/**"
17+
luacheck --codes --quiet lua --exclude-files "**/_meta/api_decorator.lua"
18+
luacheck --codes --quiet scripts
1719

18-
# --diagnosis-as-error does not function for workspace, hence we post-process the output
1920
style-check:
20-
@scripts/luals-check.sh codestyle-check
21+
scripts/luals-check.sh codestyle-check
2122

2223
style-doc:
2324
scripts/doc-comments.sh
2425

2526
luals:
26-
@scripts/luals-check.sh
27+
scripts/luals-check.sh
2728

2829
#
2930
# fixes
@@ -35,13 +36,16 @@ style-fix:
3536
# utility
3637
#
3738
help-update:
39+
scripts/gen_vimdoc.sh
3840
scripts/help-update.sh
3941

4042
#
4143
# CI
44+
# --ignore-blank-lines is used as nightly has removed unnecessary blank lines that stable (0.11.5) currently inserts
4245
#
4346
help-check: help-update
44-
git diff --exit-code doc/nvim-tree-lua.txt
47+
scripts/lintdoc.sh
48+
git diff --ignore-blank-lines --exit-code doc/nvim-tree-lua.txt
4549

4650

4751
.PHONY: all lint style check luacheck style-check style-doc luals style-fix help-update help-check

0 commit comments

Comments
 (0)