Skip to content

Commit 24a3169

Browse files
committed
chore: regenerate documentation
1 parent b8cfe07 commit 24a3169

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

doc/rest-nvim.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CONTENTS *rest-nvim-contents*
1515
4. Environment Variables........|rest-nvim-usage-environment-variables|
1616
5. Dynamic Variables................|rest-nvim-usage-dynamic-variables|
1717
6. Script Variables..................|rest-nvim-usage-script-variables|
18-
6. Callbacks................................|rest-nvim-usage-callbacks|
18+
7. Hooks........................................|rest-nvim-usage-hooks|
1919
6. License..............................................|rest-nvim-license|
2020
7. Contributing....................................|rest-nvim-contributing|
2121

@@ -64,6 +64,7 @@ function, it looks like this by default:
6464
stay_in_current_window_after_split = true,
6565
},
6666
behavior = {
67+
decode_url = true,
6768
show_info = {
6869
url = true,
6970
headers = true,
@@ -301,19 +302,24 @@ You can extend or overwrite built-in dynamic variables, with the config key
301302

302303

303304
===============================================================================
304-
CALLBACKS *rest-nvim-usage-callbacks*
305+
HOOKS *rest-nvim-usage-hooks*
305306

306307
`rest.nvim` fires different events upon requests:
307-
- a User `RestStartRequest` event when launching the request
308-
- a User `RestStopRequest` event when the requests finishes or errors out
308+
- a User `RestStartRequest` event when launching the request.
309+
- a User `RestStopRequest` event when the requests finishes.
309310

310311
>lua
311312
vim.api.nvim_create_autocmd("User", {
312313
pattern = "RestStartRequest",
313-
once = true,
314-
callback = function(opts)
315-
print("IT STARTED")
316-
vim.pretty_print(opts)
314+
once = true, -- This is optional, only if you want the hook to run once
315+
callback = function()
316+
print("Started request")
317+
-- You can access and modify the request data (body, headers, etc) by
318+
-- using the following temporal global variable
319+
vim.print(_G._rest_nvim_req_data)
320+
-- You can also access environment variables from both your current
321+
-- shell session and your environment file by using 'vim.env'
322+
_G._rest_nvim_req_data.headers["USER"] = vim.env.USERNAME
317323
end,
318324
})
319325
<

doc/tags

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ rest-nvim-license rest-nvim.txt /*rest-nvim-license*
5757
rest-nvim-quick-start rest-nvim.txt /*rest-nvim-quick-start*
5858
rest-nvim-script-variables rest-nvim.txt /*rest-nvim-script-variables*
5959
rest-nvim-usage rest-nvim.txt /*rest-nvim-usage*
60-
rest-nvim-usage-callbacks rest-nvim.txt /*rest-nvim-usage-callbacks*
6160
rest-nvim-usage-commands rest-nvim.txt /*rest-nvim-usage-commands*
6261
rest-nvim-usage-dynamic-variables rest-nvim.txt /*rest-nvim-usage-dynamic-variables*
6362
rest-nvim-usage-environment-variables rest-nvim.txt /*rest-nvim-usage-environment-variables*
6463
rest-nvim-usage-external-files rest-nvim.txt /*rest-nvim-usage-external-files*
64+
rest-nvim-usage-hooks rest-nvim.txt /*rest-nvim-usage-hooks*
6565
rest-nvim-usage-requests rest-nvim.txt /*rest-nvim-usage-requests*
6666
rest-nvim.api rest-nvim-api.txt /*rest-nvim.api*
6767
rest-nvim.client.curl rest-nvim-curl.txt /*rest-nvim.client.curl*
@@ -84,6 +84,7 @@ result.get_or_create_buf rest-nvim-api.txt /*result.get_or_create_buf*
8484
result.write_block rest-nvim-api.txt /*result.write_block*
8585
result.write_res rest-nvim-api.txt /*result.write_res*
8686
script_vars.load rest-nvim-parser.txt /*script_vars.load*
87+
utils.escape rest-nvim-api.txt /*utils.escape*
8788
utils.file_exists rest-nvim-api.txt /*utils.file_exists*
8889
utils.highlight rest-nvim-api.txt /*utils.highlight*
8990
utils.read_file rest-nvim-api.txt /*utils.read_file*

0 commit comments

Comments
 (0)