From 627e5fda6b38e7bde7306be448bfd40164dac2df Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sat, 24 Feb 2024 17:39:16 +1100 Subject: [PATCH] docs: add nvim-tree-index-api --- CONTRIBUTING.md | 2 +- doc/nvim-tree-lua.txt | 25 ++----------------------- scripts/help-update.sh | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9f9a300654..7c0ad6021c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,7 +77,7 @@ Documentation for options should also be added to `nvim-tree-opts` in `doc/nvim- ## API -When adding or changing API please update :help nvim-tree-api and generate the index via `scripts/help-index-api.sh` +When adding or changing API please update :help nvim-tree-api # Pull Request diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 0b1699b6e7d..5a0d0fc326f 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -2883,9 +2883,6 @@ highlight group is not, hard linking as follows: > ============================================================================== 14.2 INDEX: API *nvim-tree-index-api* -|nvim-tree-api| - -|nvim-tree-api.tree| |nvim-tree-api.tree.open()| |nvim-tree-api.tree.toggle()| |nvim-tree-api.tree.close()| @@ -2912,8 +2909,6 @@ highlight group is not, hard linking as follows: > |nvim-tree-api.tree.is_tree_buf()| |nvim-tree-api.tree.is_visible()| |nvim-tree-api.tree.winid()| - -|nvim-tree-api.fs| |nvim-tree-api.fs.create()| |nvim-tree-api.fs.remove()| |nvim-tree-api.fs.trash()| @@ -2930,8 +2925,6 @@ highlight group is not, hard linking as follows: > |nvim-tree-api.fs.copy.relative_path()| |nvim-tree-api.fs.clear_clipboard()| |nvim-tree-api.fs.print_clipboard()| - -|nvim-tree-api.node| |nvim-tree-api.node.open.edit()| |nvim-tree-api.node.open.replace_tree_buffer()| |nvim-tree-api.node.open.no_window_picker()| @@ -2964,20 +2957,10 @@ highlight group is not, hard linking as follows: > |nvim-tree-api.node.show_info_popup()| |nvim-tree-api.node.run.cmd()| |nvim-tree-api.node.run.system()| - -|nvim-tree-api.git| |nvim-tree-api.git.reload()| - -|nvim-tree-api.events| |nvim-tree-api.events.subscribe()| - -|nvim-tree-api.events.Event| - -|nvim-tree-api.live_filter| |nvim-tree-api.live_filter.start()| |nvim-tree-api.live_filter.clear()| - -|nvim-tree-api.marks| |nvim-tree-api.marks.get()| |nvim-tree-api.marks.list()| |nvim-tree-api.marks.toggle()| @@ -2988,16 +2971,12 @@ highlight group is not, hard linking as follows: > |nvim-tree-api.marks.navigate.next()| |nvim-tree-api.marks.navigate.prev()| |nvim-tree-api.marks.navigate.select()| - -|nvim-tree-api.config| |nvim-tree-api.config.mappings.default_on_attach()| |nvim-tree-api.config.mappings.get_keymap()| |nvim-tree-api.config.mappings.get_keymap_default()| - -|nvim-tree-api.commands| |nvim-tree-api.commands.get()| - -|nvim-tree-api.diagnostics| |nvim-tree-api.diagnostics.hi_test()| +============================================================================== + vim:tw=78:ts=4:sw=4:et:ft=help:norl: diff --git a/scripts/help-update.sh b/scripts/help-update.sh index e5fbc964607..85815d3bf24 100755 --- a/scripts/help-update.sh +++ b/scripts/help-update.sh @@ -28,7 +28,6 @@ sed -i -e "/${begin}/,/${end}/{ /${begin}/{p; r /tmp/DEFAULT_OPTS.6.lua begin="nvim-tree-index-opts\*" end="=====================" -# generate printf '\n' > /tmp/index-opts.txt sed -E " /^ *\*(nvim-tree\..*)\*$/! d ; @@ -39,6 +38,22 @@ printf '\n' >> /tmp/index-opts.txt sed -i -e "/${begin}/,/${end}/{ /${begin}/{p; r /tmp/index-opts.txt }; /${end}/p; d; }" doc/nvim-tree-lua.txt +# +# api index +# +begin="nvim-tree-index-api\*" +end="=====================" + +printf '\n' > /tmp/index-api.txt +sed -E " +/\*(nvim-tree-api.*\(\))\*/! d ; +s/^.*\*(.*)\*/|\1|/g +" doc/nvim-tree-lua.txt >> /tmp/index-api.txt +printf '\n' >> /tmp/index-api.txt + +sed -i -e "/${begin}/,/${end}/{ /${begin}/{p; r /tmp/index-api.txt + }; /${end}/p; d; }" doc/nvim-tree-lua.txt + # # DEFAULT_ON_ATTACH #