Skip to content

Commit 62420b4

Browse files
docs(vimdoc): Auto-generate user / API documentation + vimtags
1 parent 0585a10 commit 62420b4

2 files changed

Lines changed: 67 additions & 5 deletions

File tree

doc/plugin-template.txt

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*plugin-template.txt* For Neovim >= 0.8.0 Last change: 2025 April 06
1+
*plugin-template.txt* For Neovim >= 0.8.0 Last change: 2025 April 12
22

33
==============================================================================
44
Table of Contents *plugin-template-table-of-contents*
@@ -14,8 +14,13 @@ Table of Contents *plugin-template-table-of-contents*
1414
7. Tests |plugin-template-tests|
1515
- Initialization |plugin-template-tests-initialization|
1616
- Running |plugin-template-tests-running|
17-
8. Tracking Updates |plugin-template-tracking-updates|
18-
9. Other Plugins |plugin-template-other-plugins|
17+
8. Coverage |plugin-template-coverage|
18+
- Setup |plugin-template-coverage-setup|
19+
- Running |plugin-template-coverage-running|
20+
- Viewing |plugin-template-coverage-viewing|
21+
9. Tracking Updates |plugin-template-tracking-updates|
22+
10. Other Plugins |plugin-template-other-plugins|
23+
11. Links |plugin-template-links|
1924

2025
==============================================================================
2126
1. A Neovim Plugin Template *plugin-template-a-neovim-plugin-template*
@@ -52,6 +57,7 @@ A template repository used to create Neovim plugins.
5257
- RSS feed support <https://github.com/ColinKennedy/nvim-best-practices-plugin-template/commits/main/doc/news.txt.atom>
5358
- Built-in logging to stdout / files
5459
- Unittests use the full power of native busted <https://github.com/lunarmodules/busted>
60+
- Supports LuaCov <https://luarocks.org/modules/mpeterv/luacov> for coverage reports!
5561
- Automated testing matrix supports 12 Neovim/OS combinations
5662
- neovim: `[v0.10.0, v0.11.0, stable, nightly]`
5763
- os: `[ubuntu-latest, macos-latest, windows-latest]`
@@ -274,7 +280,52 @@ Run test based on tags
274280

275281

276282
==============================================================================
277-
8. Tracking Updates *plugin-template-tracking-updates*
283+
8. Coverage *plugin-template-coverage*
284+
285+
Making sure that your plugin is well tested is important.
286+
`nvim-best-practices-plugin-template` can generate a per-line breakdown of
287+
exactly where your code is lacking tests using LuaCov
288+
<https://luarocks.org/modules/mpeterv/luacov>.
289+
290+
291+
SETUP *plugin-template-coverage-setup*
292+
293+
Make sure to install all dependencies for the unittests + coverage reporter if
294+
you have not installed them already.
295+
296+
>sh
297+
luarocks install busted --local
298+
luarocks install luacov --local
299+
luarocks install luacov-multiple --local
300+
<
301+
302+
303+
RUNNING *plugin-template-coverage-running*
304+
305+
>sh
306+
make coverage-html
307+
<
308+
309+
This will generate a `luacov.stats.out` & `luacov_html/` directory.
310+
311+
312+
VIEWING *plugin-template-coverage-viewing*
313+
314+
>sh
315+
(cd luacov_html && python -m http.server)
316+
<
317+
318+
If it worked, you should see a message like "Serving HTTP on 0.0.0.0 port 8000
319+
<http://0.0.0.0:8000> …" Open `http://0.0.0.0:8000/` in a browser like
320+
Firefox <https://www.mozilla.org/en-US/firefox> and you should see a view like
321+
this:
322+
323+
Just navigate down a few folders until you get to a .lua file and you’ll see
324+
a breakdown of your line coverage like this:
325+
326+
327+
==============================================================================
328+
9. Tracking Updates *plugin-template-tracking-updates*
278329

279330
See doc/news.txt <doc/news.txt> for updates.
280331

@@ -286,13 +337,19 @@ You can watch this plugin for changes by adding this URL to your RSS feed:
286337

287338

288339
==============================================================================
289-
9. Other Plugins *plugin-template-other-plugins*
340+
10. Other Plugins *plugin-template-other-plugins*
290341

291342
This template is full of various features. But if your plugin is only meant to
292343
be a simple plugin and you don’t want the bells and whistles that this
293344
template provides, consider instead using nvim-plugin-template
294345
<https://github.com/ellisonleao/nvim-plugin-template>
295346

347+
==============================================================================
348+
11. Links *plugin-template-links*
349+
350+
1. *Image*: https://github.com/user-attachments/assets/e5b30df8-036a-4886-81b9-affbf5c9e32a
351+
2. *Image*: https://github.com/user-attachments/assets/c5420b16-4be7-4177-92c7-01af0b418816
352+
296353
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
297354

298355
vim:tw=78:ts=8:noet:ft=help:norl:

doc/tags

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ plugin-template-commands plugin-template.txt /*plugin-template-commands*
33
plugin-template-configuration plugin-template.txt /*plugin-template-configuration*
44
plugin-template-configuration-lualine plugin-template.txt /*plugin-template-configuration-lualine*
55
plugin-template-configuration-telescope plugin-template.txt /*plugin-template-configuration-telescope*
6+
plugin-template-coverage plugin-template.txt /*plugin-template-coverage*
7+
plugin-template-coverage-running plugin-template.txt /*plugin-template-coverage-running*
8+
plugin-template-coverage-setup plugin-template.txt /*plugin-template-coverage-setup*
9+
plugin-template-coverage-viewing plugin-template.txt /*plugin-template-coverage-viewing*
610
plugin-template-features plugin-template.txt /*plugin-template-features*
711
plugin-template-installation plugin-template.txt /*plugin-template-installation*
12+
plugin-template-links plugin-template.txt /*plugin-template-links*
813
plugin-template-new-breaking news.txt /*plugin-template-new-breaking*
914
plugin-template-new-features news.txt /*plugin-template-new-features*
1015
plugin-template-news.txt news.txt /*plugin-template-news.txt*

0 commit comments

Comments
 (0)