2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-01 16:52:03 +00:00

docs: change way params are styled

This commit is contained in:
sammyette 2025-06-22 12:39:49 -04:00
parent 6fd03b6eac
commit da5a1d0e34
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
5 changed files with 44 additions and 44 deletions

View File

@ -649,7 +649,7 @@ func generateFile(v module) {
typ = p.Type[3:] typ = p.Type[3:]
} }
f.WriteString(fmt.Sprintf("`%s` `*%s*`", typ, p.Name)) f.WriteString(fmt.Sprintf("`%s` _%s_", typ, p.Name))
if isVariadic { if isVariadic {
f.WriteString(" (This type is variadic. You can pass an infinite amount of parameters with this type.)") f.WriteString(" (This type is variadic. You can pass an infinite amount of parameters with this type.)")
} }

View File

@ -82,10 +82,10 @@ Catches an event. This function can be used to act on events.
#### Parameters #### Parameters
`string` `*name*` `string` _name_
The name of the hook. The name of the hook.
`function` `*cb*` `function` _cb_
The function that will be called when the hook is thrown. The function that will be called when the hook is thrown.
#### Example #### Example
@ -113,10 +113,10 @@ Catches an event, but only once. This will remove the hook immediately after it
#### Parameters #### Parameters
`string` `*name*` `string` _name_
The name of the event The name of the event
`function` `*cb*` `function` _cb_
The function that will be called when the event is thrown. The function that will be called when the event is thrown.
@ -137,7 +137,7 @@ Returns a table of functions that are hooked on an event with the corresponding
#### Parameters #### Parameters
`string` `*name*` `string` _name_
The name of the hook The name of the hook
@ -160,10 +160,10 @@ an event, like one saved to a variable.
#### Parameters #### Parameters
`string` `*name*` `string` _name_
Name of the event the hook is on Name of the event the hook is on
`function` `*catcher*` `function` _catcher_
Hook function to remove Hook function to remove
#### Example #### Example
@ -195,10 +195,10 @@ Throws a hook with `name` with the provided `args`.
#### Parameters #### Parameters
`string` `*name*` `string` _name_
The name of the hook. The name of the hook.
`any` `*args*` (This type is variadic. You can pass an infinite amount of parameters with this type.) `any` _args_ (This type is variadic. You can pass an infinite amount of parameters with this type.)
The arguments to pass to the hook. The arguments to pass to the hook.
#### Example #### Example

View File

@ -81,7 +81,7 @@ Removes the named command. Note that this will only remove Commander-registered
#### Parameters #### Parameters
`string` `*name*` `string` _name_
Name of the command to remove. Name of the command to remove.
@ -103,10 +103,10 @@ it will run the function providing the arguments and sinks.
#### Parameters #### Parameters
`string` `*name*` `string` _name_
Name of the command Name of the command
`function` `*cb*` `function` _cb_
Callback to handle command invocation Callback to handle command invocation
#### Example #### Example

View File

@ -99,7 +99,7 @@ This can be used to resolve short paths like `..` to `/home/user`.
#### Parameters #### Parameters
`string` `*path*` `string` _path_
@ -121,7 +121,7 @@ Returns the "basename," or the last part of the provided `path`. If path is empt
#### Parameters #### Parameters
`string` `*path*` `string` _path_
Path to get the base name of. Path to get the base name of.
@ -142,7 +142,7 @@ Changes Hilbish's directory to `dir`.
#### Parameters #### Parameters
`string` `*dir*` `string` _dir_
Path to change directory to. Path to change directory to.
@ -164,7 +164,7 @@ Returns the directory part of `path`. If a file path like
#### Parameters #### Parameters
`string` `*path*` `string` _path_
Path to get the directory for. Path to get the directory for.
@ -186,7 +186,7 @@ For the syntax' refer to Go's filepath.Match function: https://pkg.go.dev/path/f
#### Parameters #### Parameters
`string` `*pattern*` `string` _pattern_
Pattern to compare files with. Pattern to compare files with.
#### Example #### Example
@ -221,7 +221,7 @@ Takes any list of paths and joins them based on the operating system's path sepa
#### Parameters #### Parameters
`string` `*path*` (This type is variadic. You can pass an infinite amount of parameters with this type.) `string` _path_ (This type is variadic. You can pass an infinite amount of parameters with this type.)
Paths to join together Paths to join together
#### Example #### Example
@ -250,10 +250,10 @@ With `recursive`, mkdir will create parent directories.
#### Parameters #### Parameters
`string` `*name*` `string` _name_
Name of the directory Name of the directory
`boolean` `*recursive*` `boolean` _recursive_
Whether to create parent directories for the provided name Whether to create parent directories for the provided name
#### Example #### Example
@ -301,7 +301,7 @@ Returns a list of all files and directories in the provided path.
#### Parameters #### Parameters
`string` `*dir*` `string` _dir_
@ -327,7 +327,7 @@ isDir (boolean) - If the path is a directory
#### Parameters #### Parameters
`string` `*path*` `string` _path_
#### Example #### Example

View File

@ -104,10 +104,10 @@ Sets an alias, with a name of `cmd` to another command.
#### Parameters #### Parameters
`string` `*cmd*` `string` _cmd_
Name of the alias Name of the alias
`string` `*orig*` `string` _orig_
Command that will be aliased Command that will be aliased
#### Example #### Example
@ -138,7 +138,7 @@ Appends the provided dir to the command path (`$PATH`)
#### Parameters #### Parameters
`string|table` `*dir*` `string|table` _dir_
Directory (or directories) to append to path Directory (or directories) to append to path
#### Example #### Example
@ -175,10 +175,10 @@ provides more details.
#### Parameters #### Parameters
`string` `*scope*` `string` _scope_
`function` `*cb*` `function` _cb_
#### Example #### Example
@ -246,7 +246,7 @@ This can be used to do an in-place restart.
#### Parameters #### Parameters
`string` `*cmd*` `string` _cmd_
@ -270,7 +270,7 @@ This can be used to run any function in another thread at the same time as other
#### Parameters #### Parameters
`function` `*fn*` `function` _fn_
@ -295,7 +295,7 @@ Note that to set a highlighter, one has to override this function.
#### Parameters #### Parameters
`string` `*line*` `string` _line_
#### Example #### Example
@ -330,10 +330,10 @@ override this function with your custom handler.
#### Parameters #### Parameters
`string` `*line*` `string` _line_
`number` `*pos*` `number` _pos_
Position of cursor in line. Usually equals string.len(line) Position of cursor in line. Usually equals string.len(line)
#### Example #### Example
@ -364,7 +364,7 @@ Vim-like with modes and Vim keybinds.
#### Parameters #### Parameters
`string` `*mode*` `string` _mode_
Can be set to either `emacs` or `vim` Can be set to either `emacs` or `vim`
@ -386,10 +386,10 @@ This creates a timer that ticking immediately.
#### Parameters #### Parameters
`function` `*cb*` `function` _cb_
`number` `*time*` `number` _time_
Time in milliseconds. Time in milliseconds.
@ -411,7 +411,7 @@ This will show up when text is incomplete, like a missing quote
#### Parameters #### Parameters
`string` `*str*` `string` _str_
#### Example #### Example
@ -451,7 +451,7 @@ Prepends `dir` to $PATH.
#### Parameters #### Parameters
`string` `*dir*` `string` _dir_
@ -477,10 +477,10 @@ These will be formatted and replaced with the appropriate values.
#### Parameters #### Parameters
`string` `*str*` `string` _str_
`string` `*typ?*` `string` _typ?_
Type of prompt, being left or right. Left by default. Type of prompt, being left or right. Left by default.
#### Example #### Example
@ -512,7 +512,7 @@ Returns `input`, will be nil if Ctrl-D is pressed, or an error occurs.
#### Parameters #### Parameters
`string` `*prompt?*` `string` _prompt?_
Text to print before input, can be empty. Text to print before input, can be empty.
@ -534,10 +534,10 @@ This creates a Timer that starts ticking immediately.
#### Parameters #### Parameters
`function` `*cb*` `function` _cb_
`number` `*time*` `number` _time_
Time to run in milliseconds. Time to run in milliseconds.
@ -559,7 +559,7 @@ Will return the path of the binary, or a basename if it's a commander.
#### Parameters #### Parameters
`string` `*name*` `string` _name_