diff --git a/cmd/docgen/docgen.go b/cmd/docgen/docgen.go index 3af014d3..e8c6dafa 100644 --- a/cmd/docgen/docgen.go +++ b/cmd/docgen/docgen.go @@ -724,7 +724,7 @@ func table(elems [][]string) string { for _, line := range elems { b.WriteString("
catch(name, cb) | -Catches an event. This function can be used to act on events. | +catch(name, cb) | +Catches an event. This function can be used to act on events. |
catchOnce(name, cb) | -Catches an event, but only once. This will remove the hook immediately after it runs for the first time. | +catchOnce(name, cb) | +Catches an event, but only once. This will remove the hook immediately after it runs for the first time. |
hooks(name) -> table | -Returns a table of functions that are hooked on an event with the corresponding `name`. | +hooks(name) -> table | +Returns a table of functions that are hooked on an event with the corresponding `name`. |
release(name, catcher) | -Removes the `catcher` for the event with `name`. | +release(name, catcher) | +Removes the `catcher` for the event with `name`. |
throw(name, ...args) | -Throws a hook with `name` with the provided `args`. | +throw(name, ...args) | +Throws a hook with `name` with the provided `args`. |
deregister(name) | -Removes the named command. Note that this will only remove Commander-registered commands. | +deregister(name) | +Removes the named command. Note that this will only remove Commander-registered commands. |
register(name, cb) | -Adds a new command with the given `name`. When Hilbish has to run a command with a name, | +register(name, cb) | +Adds a new command with the given `name`. When Hilbish has to run a command with a name, |
registry() -> table | -Returns all registered commanders. Returns a list of tables with the following keys: | +registry() -> table | +Returns all registered commanders. Returns a list of tables with the following keys: |
abs(path) -> string | -Returns an absolute version of the `path`. | +abs(path) -> string | +Returns an absolute version of the `path`. |
basename(path) -> string | -Returns the "basename," or the last part of the provided `path`. If path is empty, | +basename(path) -> string | +Returns the "basename," or the last part of the provided `path`. If path is empty, |
cd(dir) | -Changes Hilbish's directory to `dir`. | +cd(dir) | +Changes Hilbish's directory to `dir`. |
dir(path) -> string | -Returns the directory part of `path`. If a file path like | +dir(path) -> string | +Returns the directory part of `path`. If a file path like |
glob(pattern) -> matches (table) | -Match all files based on the provided `pattern`. | +glob(pattern) -> matches (table) | +Match all files based on the provided `pattern`. |
join(...path) -> string | -Takes any list of paths and joins them based on the operating system's path separator. | +join(...path) -> string | +Takes any list of paths and joins them based on the operating system's path separator. |
mkdir(name, recursive) | -Creates a new directory with the provided `name`. | +mkdir(name, recursive) | +Creates a new directory with the provided `name`. |
fpipe() -> File, File | -Returns a pair of connected files, also known as a pipe. | +fpipe() -> File, File | +Returns a pair of connected files, also known as a pipe. |
readdir(path) -> table[string] | -Returns a list of all files and directories in the provided path. | +readdir(path) -> table[string] | +Returns a list of all files and directories in the provided path. |
stat(path) -> {} | -Returns the information about a given `path`. | +stat(path) -> {} | +Returns the information about a given `path`. |
pathSep | -The operating system's path separator. | +pathSep | +The operating system's path separator. |
alias(cmd, orig) | -Sets an alias, with a name of `cmd` to another command. | +alias(cmd, orig) | +Sets an alias, with a name of `cmd` to another command. |
appendPath(dir) | -Appends the provided dir to the command path (`$PATH`) | +appendPath(dir) | +Appends the provided dir to the command path (`$PATH`) |
complete(scope, cb) | -Registers a completion handler for the specified scope. | +complete(scope, cb) | +Registers a completion handler for the specified scope. |
cwd() -> string | -Returns the current directory of the shell. | +cwd() -> string | +Returns the current directory of the shell. |
exec(cmd) | -Replaces the currently running Hilbish instance with the supplied command. | +exec(cmd) | +Replaces the currently running Hilbish instance with the supplied command. |
goro(fn) | -Puts `fn` in a Goroutine. | +goro(fn) | +Puts `fn` in a Goroutine. |
highlighter(line) | -Line highlighter handler. | +highlighter(line) | +Line highlighter handler. |
hinter(line, pos) | -The command line hint handler. It gets called on every key insert to | +hinter(line, pos) | +The command line hint handler. It gets called on every key insert to |
inputMode(mode) | -Sets the input mode for Hilbish's line reader. | +inputMode(mode) | +Sets the input mode for Hilbish's line reader. |
interval(cb, time) -> @Timer | -Runs the `cb` function every specified amount of `time`. | +interval(cb, time) -> @Timer | +Runs the `cb` function every specified amount of `time`. |
multiprompt(str) | -Changes the text prompt when Hilbish asks for more input. | +multiprompt(str) | +Changes the text prompt when Hilbish asks for more input. |
prependPath(dir) | -Prepends `dir` to $PATH. | +prependPath(dir) | +Prepends `dir` to $PATH. |
prompt(str, typ) | -Changes the shell prompt to the provided string. | +prompt(str, typ) | +Changes the shell prompt to the provided string. |
read(prompt) -> input (string) | -Read input from the user, using Hilbish's line editor/input reader. | +read(prompt) -> input (string) | +Read input from the user, using Hilbish's line editor/input reader. |
timeout(cb, time) -> @Timer | -Executed the `cb` function after a period of `time`. | +timeout(cb, time) -> @Timer | +Executed the `cb` function after a period of `time`. |
which(name) -> string | -Checks if `name` is a valid command. | +which(name) -> string | +Checks if `name` is a valid command. |
new() -> @Readline | -Creates a new readline instance. | +new() -> @Readline | +Creates a new readline instance. |
new() -> @Snail | -Creates a new Snail instance. | +new() -> @Snail | +Creates a new Snail instance. |
restoreState() | -Restores the last saved state of the terminal | +restoreState() | +Restores the last saved state of the terminal |
saveState() | -Saves the current state of the terminal. | +saveState() | +Saves the current state of the terminal. |
setRaw() | -Puts the terminal into raw mode. | +setRaw() | +Puts the terminal into raw mode. |
size() | -Gets the dimensions of the terminal. Returns a table with `width` and `height` | +size() | +Gets the dimensions of the terminal. Returns a table with `width` and `height` |
thread(fun) -> @Thread | -Creates a new, fresh Yarn thread. | +thread(fun) -> @Thread | +Creates a new, fresh Yarn thread. |