Skip to content

Commit

Permalink
docs: fix format on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn authored Jul 19, 2024
1 parent 0aecf63 commit cd94930
Showing 1 changed file with 47 additions and 63 deletions.
110 changes: 47 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ To change the environment file name, use the `HurlSetEnvFile` command followed b

This is a feature that allows you to define custom variables in your `.hurl` files. You can define a list of custom variables with a name and a callback function that returns the value of the variable. The callback function is executed every time the variable is used in the `.hurl` file.

> Note
> [!NOTE]
> This is a workaround to inject dynamic variables into the hurl command, refer https://github.com/Orange-OpenSource/hurl/issues?q=sort:updated-desc+is:open+label:%22topic:+generators%22
> -- This is a workaround to inject dynamic variables into the hurl command, refer https://github.com/Orange-OpenSource/hurl/issues?q=sort:updated-desc+is:open+label:%22topic:+generators%22
```lua
-- Custom below to add your own fixture variables
Expand Down Expand Up @@ -269,70 +268,55 @@ These key mappings are active within the popup windows that `hurl.nvim` displays

`hurl.nvim` can be customized with the following default configurations:

<details><summary>Default Options</summary>

</details>
```lua
--- Default configuration for hurl.nvim
local default_config = {
-- Toggle debugging information
debug = false, -- If true, logs will be saved at ~/.local/state/nvim/hurl.nvim.log

-- Set the display mode for the response: 'split' or 'popup'
mode = 'split',

-- Split settings
split_position = "right",
split_size = "50%",

-- Popup settings
popup_position = '50%',
popup_size = {
width = 80,
height = 40,
},

-- Default environment file name
env_file = {
'vars.env',
},

-- Default test fixtures
fixture_vars = {
{
name = 'random_int_number',
callback = function()
return math.random(1, 1000)
end,
},
{
name = 'random_float_number',
callback = function()
local result = math.random() \* 10
return string.format('%.2f', result)
end,
},
},

-- Specify formatters for different response types
formatters = {
json = { 'jq' }, -- Uses jq to format JSON responses
html = {
'prettier', -- Uses prettier to format HTML responses
'--parser',
'html',
},
xml = {
'tidy', -- Uses tidy to format XML responses
'-xml',
'-i',
'-q',
},
},
debug = false,
mode = 'split',
show_notification = false,
auto_close = true,
-- Default split options
split_position = 'right',
split_size = '50%',
-- Default popup options
popup_position = '50%',
popup_size = {
width = 80,
height = 40,
},
env_file = { 'vars.env' },
fixture_vars = {
{
name = 'random_int_number',
callback = function()
return math.random(1, 1000)
end,
},
{
name = 'random_float_number',
callback = function()
local result = math.random() * 10
return string.format('%.2f', result)
end,
},
},
find_env_files_in_folders = utils.find_env_files_in_folders,
formatters = {
json = { 'jq' },
html = {
'prettier',
'--parser',
'html',
},
xml = {
'tidy',
'-xml',
'-i',
'-q',
},
},
}

````

</details>
```

To apply these configurations, include them in your Neovim setup like this:

Expand Down

0 comments on commit cd94930

Please sign in to comment.