Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit d6297f1

Browse files
committed
fix(docs): Update doc gen scripts
fixes #495
1 parent 44b0726 commit d6297f1

File tree

5 files changed

+44
-35
lines changed

5 files changed

+44
-35
lines changed

.github/workflows/gen-docs-txt.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
run: git checkout -b ${VIMDOC_BRANCH}
4040
- name: Generate vimdocs
4141
run: make gen-vimdoc
42+
- name: Generate API docs
43+
run: make gen-api-docs-ci
4244
- name: Create PR
4345
run: |
4446
if ! [[ -z $(git status -s) ]]; then

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ check: check-luacheck check-stylua
6565
api-docs:
6666
./gen-api-docs.bash
6767

68+
.PHONY: gen-api-docs-ci
69+
gen-api-docs-ci:
70+
./gen-api-docs.bash ci
71+
6872
.PHONY: init
6973
init:
7074
git config core.hooksPath .githooks

doc/legendary-api.txt

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
M.setup() *legendary.setup*
55

66

7+
M.repeat_previous({ignore_filters}) *legendary.repeat_previous*
8+
Repeat execution of the previously selected item. By default, only executes if the previously used filters
9+
still return true.
10+
11+
Parameters: ~
12+
{ignore_filters} (boolean|nil) whether to ignore the filters used when selecting the item, default false
13+
14+
715
M.find({opts}) *legendary.find*
816
Find items using vim.ui.select()
917

@@ -44,14 +52,14 @@ M.autocmds({aus}) *legendary.autocmds*
4452
Bind a *list of* autocmds and/or augroups
4553

4654
Parameters: ~
47-
{aus} (Autocmd|Augroup[])
55+
{aus} (table)
4856

4957

5058
M.autocmd({au}) *legendary.autocmd*
5159
Bind a *single autocmd/augroup*
5260

5361
Parameters: ~
54-
{au} (Autocmd|Augroup)
62+
{au} (table)
5563

5664

5765
==============================================================================
@@ -159,7 +167,7 @@ Return a function that creates a new horizontal
159167
split, then calls the given function.
160168

161169
Parameters: ~
162-
{fn} (function) The function to call after creating a spli
170+
{fn} (function) The function to call after creating a split
163171

164172
Returns: ~
165173
(function)
@@ -170,7 +178,7 @@ Return a function that creates a new vertical
170178
split, then calls the given function.
171179

172180
Parameters: ~
173-
{fn} (function) The function to call after creating a spli
181+
{fn} (function) The function to call after creating a split
174182

175183
Returns: ~
176184
(function)
@@ -265,11 +273,11 @@ Returns: ~
265273

266274

267275
M.set_marks({marks}) *legendary.toolbox.set_marks*
268-
Set visual marks from a table in the forma
276+
Set visual marks from a table in the format
269277
{start_line, start_col, end_line, end_col}
270278

271279
Parameters: ~
272-
{marks} (Marks) the marks to se
280+
{marks} (Marks) the marks to set
273281

274282

275283
*legendary.toolbox.table_from_vimscript*
@@ -296,7 +304,7 @@ fun(items:LegendaryItem[],mode:string):string[]
296304

297305

298306
M.default_format({item}) *legendary.ui.format.default_format*
299-
Default forma
307+
Default format
300308

301309
Parameters: ~
302310
{item} (LegendaryItem)
@@ -329,37 +337,21 @@ Returns: ~
329337
(string)
330338

331339

332-
==============================================================================
333-
*legendary.integrations.which-key*
334-
335-
*legendary.integrations.which-key.parse_whichkey*
336-
M.parse_whichkey({which_key_tbls}, {which_key_opts}, {do_binding})
337-
Take which-key.nvim tables
338-
and parse them into legendary.nvim tables
339-
340-
Parameters: ~
341-
{which_key_tbls} (table[])
342-
{which_key_opts} (table)
343-
{do_binding} (boolean) whether to bind the keymaps or let which-key handle i
344-
345-
Returns: ~
346-
(LegendaryItem[])
340+
M.load_all() *M.load_all*
341+
Load all extensions specified in legendary.nvim config
347342

348343

349-
*legendary.integrations.which-key.bind_whichkey*
350-
M.bind_whichkey({wk_tbls}, {wk_opts}, {do_binding})
351-
Bind a which-key.nvim table with legendary.nvim
344+
*M.load_extension*
345+
M.load_extension({extension_name}, {config})
346+
Load a single extension by name. If config is not provided,
347+
it will be looked up in the legendary.nvim config.
352348

353349
Parameters: ~
354-
{wk_tbls} (table)
355-
{wk_opts} (table)
356-
{do_binding} (boolean) whether to bind the keymaps or let which-key handle i
350+
{extension_name} (string)
351+
{config} (any)
357352

358353

359-
*legendary.integrations.which-key.whichkey_listen*
360-
M.whichkey_listen()
361-
Enable auto-registering of which-key.nvim tables
362-
with legendary.nvim
354+
M.pre_ui_hook() *M.pre_ui_hook*
363355

364356

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

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
devShells.default = pkgs.mkShell {
1111
name = "shell with stylua and luacheck";
1212

13-
packages = with pkgs; [ stylua luajitPackages.luacheck ];
13+
packages = with pkgs; [ stylua luajitPackages.luacheck lemmy-help ];
1414
};
1515
});
1616
}

gen-api-docs.bash

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
#!/usr/bin/env bash
22

3-
lemmy-help -fact \
3+
export LEMMY_HELP_CMD="lemmy-help"
4+
5+
if [ "$1" == "ci" ]; then
6+
curl -Lq https://github.com/numToStr/lemmy-help/releases/latest/download/lemmy-help-x86_64-unknown-linux-gnu.tar.gz | tar xz
7+
export LEMMY_HELP_CMD="./lemmy-help"
8+
fi
9+
10+
$LEMMY_HELP_CMD -fact \
411
./lua/legendary/init.lua \
512
./lua/legendary/filters.lua \
613
./lua/legendary/toolbox.lua \
714
./lua/legendary/ui/format.lua \
8-
./lua/legendary/integrations/which-key.lua >doc/legendary-api.txt
15+
./lua/legendary/extensions/init.lua >doc/legendary-api.txt
916

1017
whitespace_trimmed=$(sed 's/^[ \t]*//;s/[ \t]*$//' <doc/legendary-api.txt)
1118
echo -e "$whitespace_trimmed" >doc/legendary-api.txt
19+
20+
if [ "$1" == "ci" ]; then
21+
rm ./lemmy-help
22+
fi

0 commit comments

Comments
 (0)