Skip to content

Commit 29bee11

Browse files
docs: docgen using nix
1 parent 061f65d commit 29bee11

File tree

11 files changed

+368
-289
lines changed

11 files changed

+368
-289
lines changed

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: lint format test docgen
1+
.PHONY: lint format test docgen doc
22
.SILENT: docgen
33

44
lint:
@@ -11,10 +11,3 @@ test:
1111
LUA_PATH="$(shell luarocks path --lr-path --lua-version 5.1 --local)" \
1212
LUA_CPATH="$(shell luarocks path --lr-cpath --lua-version 5.1 --local)" \
1313
luarocks test --local --lua-version 5.1
14-
15-
docgen:
16-
lemmy-help lua/rest-nvim/commands.lua > doc/rest-nvim-commands.txt
17-
lemmy-help lua/rest-nvim/config/init.lua > doc/rest-nvim-config.txt
18-
lemmy-help lua/rest-nvim/cookie_jar.lua > doc/rest-nvim-cookies.txt
19-
lemmy-help lua/rest-nvim/api.lua lua/rest-nvim/client/init.lua lua/rest-nvim/script/init.lua lua/rest-nvim/ui/result.lua lua/rest-nvim/utils.lua > doc/rest-nvim-api.txt
20-
lemmy-help lua/rest-nvim/client/curl/cli.lua lua/rest-nvim/client/curl/utils.lua > doc/rest-nvim-client-curl.txt

doc/rest-nvim-api.txt

Lines changed: 76 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,32 @@ api.register_rest_subcommand({name}, {cmd})
4545
{cmd} (RestCmd)
4646

4747

48+
api.register_rest_client() *api.register_rest_client*
49+
50+
4851
==============================================================================
4952
rest.nvim client module *rest-nvim.client*
5053

54+
rest.Client *rest.Client*
55+
Client to send request
5156

52-
Mainly about `rest.Client` type requirements
57+
Fields: ~
58+
{name} (string) name of the client
59+
{request} (fun(req:rest.Request):nio.control.Future) Sends request and return the response asynchronously
60+
{available} (fun(req:rest.Request):boolean) Check if client can handle given request
5361

5462

55-
rest.Client *rest.Client*
56-
Client to send request
63+
clients.register_client() *clients.register_client*
5764

5865

59-
client:request({req}) *client:request*
60-
Sends request and return the response asynchronously
66+
clients.get_available_clients({req}) *clients.get_available_clients*
67+
Find all registered clients available for given request
6168

6269
Parameters: ~
6370
{req} (rest.Request)
6471

6572
Returns: ~
66-
(nio.control.Future) Future containing `rest.Response`
73+
(rest.Client[])
6774

6875

6976
==============================================================================
@@ -77,60 +84,56 @@ script runner client for rest.nvim *rest-nvim.script*
7784
rest.ScriptClient *rest.ScriptClient*
7885

7986

80-
script:load_pre_req_hook({str}, {ctx}) *script:load_pre_req_hook*
87+
script.load_pre_req_hook({str}, {ctx}) *script.load_pre_req_hook*
8188

8289
Parameters: ~
8390
{str} (string)
8491
{ctx} (rest.Context)
8592

8693

87-
script:load_post_req_hook({str}, {ctx}) *script:load_post_req_hook*
94+
script.load_post_req_hook({str}, {ctx}) *script.load_post_req_hook*
8895

8996
Parameters: ~
9097
{str} (string)
9198
{ctx} (rest.Context)
9299

93100

94101
==============================================================================
95-
rest.nvim result UI module *rest-nvim.ui.result*
102+
Cookie handler module *rest-nvim.cookie_jar*
96103

104+
rest.Cookie *rest.Cookie*
97105

98-
rest.nvim result UI implmentation
106+
Fields: ~
107+
{name} (string)
108+
{value} (string)
109+
{domain} (string)
110+
{path} (string)
111+
{expires} (integer)
112+
{max_date} (integer)
99113

100114

101-
rest.UIData *rest.UIData*
102-
data used to render the UI
103-
104-
105-
ui.stat_winbar() *ui.stat_winbar*
106-
Winbar component showing response statistics
107-
108-
Returns: ~
109-
(string)
115+
M.load_jar() *M.load_jar*
116+
Load Cookie jar from rest-nvim.cookies file
110117

111118

112-
ui.is_open() *ui.is_open*
113-
Check if UI window is shown in current tabpage
114-
115-
Returns: ~
116-
(boolean)
117-
118-
119-
ui.enter({winnr}) *ui.enter*
119+
M.update_jar({req_url}, {res}) *M.update_jar*
120+
Save cookies from response
121+
Request is provided as a context
120122

121123
Parameters: ~
122-
{winnr} (integer)
124+
{req_url} (string)
125+
{res} (rest.Response)
123126

124127

125-
ui.clear() *ui.clear*
126-
Clear the UI
128+
M.save_jar() *M.save_jar*
129+
Save current cookie jar to cookies file
127130

128131

129-
ui.update({new_data}) *ui.update*
130-
Update data and rerender the UI
132+
M.load_cookies({req}) *M.load_cookies*
133+
Load cookies for request
131134

132135
Parameters: ~
133-
{new_data} (rest.UIData)
136+
{req} (rest.Request)
134137

135138

136139
==============================================================================
@@ -245,4 +248,44 @@ utils.nvim_lazy_set_wo({bufnr}, {name}, {value})
245248
{value} (any)
246249

247250

251+
utils.gq_lines({lines}, {filetype}) *utils.gq_lines*
252+
format lines using native vim `gq` command
253+
254+
Parameters: ~
255+
{lines} (string[])
256+
{filetype} (string)
257+
258+
Returns: ~
259+
(string[])
260+
261+
262+
==============================================================================
263+
rest.nvim logger *rest-nvim.logger*
264+
265+
266+
Logging library for rest.nvim, inspired by nvim-neorocks/rocks.nvim
267+
Intended for use by internal and third-party modules.
268+
269+
270+
logger.trace() *logger.trace*
271+
272+
273+
logger.debug() *logger.debug*
274+
275+
276+
logger.info() *logger.info*
277+
278+
279+
logger.warn() *logger.warn*
280+
281+
282+
logger.error() *logger.error*
283+
284+
285+
logger.set_log_level() *logger.set_log_level*
286+
287+
See: ~
288+
|vim.log.levels|
289+
290+
248291
vim:tw=78:ts=8:noet:ft=help:norl:

doc/rest-nvim-commands.txt

Lines changed: 0 additions & 46 deletions
This file was deleted.

doc/rest-nvim-cookies.txt

Lines changed: 0 additions & 39 deletions
This file was deleted.

doc/rest-nvim-script.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)