docs: turn properties list into a table

also fix member functions causing a spam of separators
pull/260/head
sammyette 2023-09-02 16:01:57 -04:00
parent eda4fda972
commit 0900284304
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
16 changed files with 236 additions and 87 deletions

View File

@ -481,11 +481,17 @@ func main() {
if len(modu.Fields) != 0 { if len(modu.Fields) != 0 {
f.WriteString("## Interface fields\n") f.WriteString("## Interface fields\n")
for _, dps := range modu.Fields {
f.WriteString(fmt.Sprintf("- `%s`: ", dps.FuncName)) mdTable := md.NewTable(len(modu.Fields), 2)
f.WriteString(strings.Join(dps.Doc, " ")) mdTable.SetTitle(0, "")
f.WriteString("\n") mdTable.SetTitle(1, "")
for i, dps := range modu.Fields {
mdTable.SetContent(i, 0, dps.FuncName)
mdTable.SetContent(i, 1, strings.Join(dps.Doc, " "))
} }
f.WriteString(mdTable.String())
f.WriteString("\n") f.WriteString("\n")
} }
if len(modu.Properties) != 0 { if len(modu.Properties) != 0 {
@ -499,12 +505,12 @@ func main() {
} }
if len(modu.Docs) != 0 { if len(modu.Docs) != 0 {
//f.WriteString("## Functions\n") f.WriteString("## Functions\n")
for _, dps := range modu.Docs { for _, dps := range modu.Docs {
f.WriteString(fmt.Sprintf("<hr><div id='%s'>", dps.FuncName))
if dps.IsMember { if dps.IsMember {
continue continue
} }
f.WriteString(fmt.Sprintf("<hr><div id='%s'>", dps.FuncName))
htmlSig := typeTag.ReplaceAllStringFunc(strings.Replace(modname + "." + dps.FuncSig, "<", `\<`, -1), func(typ string) string { htmlSig := typeTag.ReplaceAllStringFunc(strings.Replace(modname + "." + dps.FuncSig, "<", `\<`, -1), func(typ string) string {
typName := typ[1:] typName := typ[1:]
typLookup := typeTable[strings.ToLower(typName)] typLookup := typeTable[strings.ToLower(typName)]
@ -550,6 +556,7 @@ func main() {
f.WriteString("\n\n") f.WriteString("\n\n")
} }
f.WriteString("</div>") f.WriteString("</div>")
f.WriteString("\n\n")
} }
} }

View File

@ -41,6 +41,7 @@ this function will set the user prompt.
|<a href="#release">release(name, catcher)</a>|Removes the `catcher` for the event with `name`.| |<a href="#release">release(name, catcher)</a>|Removes the `catcher` for the event with `name`.|
|<a href="#throw">throw(name, ...args)</a>|Throws a hook with `name` with the provided `args`| |<a href="#throw">throw(name, ...args)</a>|Throws a hook with `name` with the provided `args`|
## Functions
<hr><div id='catch'> <hr><div id='catch'>
<h4 class='heading'> <h4 class='heading'>
bait.catch(name, cb) bait.catch(name, cb)
@ -57,7 +58,9 @@ ummm
`function` **`cb`** `function` **`cb`**
? ?
</div><hr><div id='catchOnce'> </div>
<hr><div id='catchOnce'>
<h4 class='heading'> <h4 class='heading'>
bait.catchOnce(name, cb) bait.catchOnce(name, cb)
<a href="#catchOnce" class='heading-link'> <a href="#catchOnce" class='heading-link'>
@ -68,7 +71,9 @@ bait.catchOnce(name, cb)
Same as catch, but only runs the `cb` once and then removes the hook Same as catch, but only runs the `cb` once and then removes the hook
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='hooks'> </div>
<hr><div id='hooks'>
<h4 class='heading'> <h4 class='heading'>
bait.hooks(name) -> table bait.hooks(name) -> table
<a href="#hooks" class='heading-link'> <a href="#hooks" class='heading-link'>
@ -79,7 +84,9 @@ bait.hooks(name) -> table
Returns a table with hooks (callback functions) on the event with `name`. Returns a table with hooks (callback functions) on the event with `name`.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='release'> </div>
<hr><div id='release'>
<h4 class='heading'> <h4 class='heading'>
bait.release(name, catcher) bait.release(name, catcher)
<a href="#release" class='heading-link'> <a href="#release" class='heading-link'>
@ -92,7 +99,9 @@ For this to work, `catcher` has to be the same function used to catch
an event, like one saved to a variable. an event, like one saved to a variable.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='throw'> </div>
<hr><div id='throw'>
<h4 class='heading'> <h4 class='heading'>
bait.throw(name, ...args) bait.throw(name, ...args)
<a href="#throw" class='heading-link'> <a href="#throw" class='heading-link'>
@ -109,3 +118,4 @@ The name of the hook.
The arguments to pass to the hook. The arguments to pass to the hook.
</div> </div>

View File

@ -43,6 +43,7 @@ name would suggest.
|<a href="#deregister">deregister(name)</a>|Deregisters any command registered with `name`| |<a href="#deregister">deregister(name)</a>|Deregisters any command registered with `name`|
|<a href="#register">register(name, cb)</a>|Register a command with `name` that runs `cb` when ran| |<a href="#register">register(name, cb)</a>|Register a command with `name` that runs `cb` when ran|
## Functions
<hr><div id='deregister'> <hr><div id='deregister'>
<h4 class='heading'> <h4 class='heading'>
commander.deregister(name) commander.deregister(name)
@ -54,7 +55,9 @@ commander.deregister(name)
Deregisters any command registered with `name` Deregisters any command registered with `name`
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='register'> </div>
<hr><div id='register'>
<h4 class='heading'> <h4 class='heading'>
commander.register(name, cb) commander.register(name, cb)
<a href="#register" class='heading-link'> <a href="#register" class='heading-link'>
@ -66,3 +69,4 @@ Register a command with `name` that runs `cb` when ran
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -25,6 +25,7 @@ I/O and filesystem functions.
|<a href="#readdir">readdir(dir) -> {}</a>|Returns a table of files in `dir`.| |<a href="#readdir">readdir(dir) -> {}</a>|Returns a table of files in `dir`.|
|<a href="#stat">stat(path) -> {}</a>|Returns a table of info about the `path`.| |<a href="#stat">stat(path) -> {}</a>|Returns a table of info about the `path`.|
## Functions
<hr><div id='abs'> <hr><div id='abs'>
<h4 class='heading'> <h4 class='heading'>
fs.abs(path) -> string fs.abs(path) -> string
@ -36,7 +37,9 @@ fs.abs(path) -> string
Gives an absolute version of `path`. Gives an absolute version of `path`.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='basename'> </div>
<hr><div id='basename'>
<h4 class='heading'> <h4 class='heading'>
fs.basename(path) -> string fs.basename(path) -> string
<a href="#basename" class='heading-link'> <a href="#basename" class='heading-link'>
@ -48,7 +51,9 @@ Gives the basename of `path`. For the rules,
see Go's filepath.Base see Go's filepath.Base
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='cd'> </div>
<hr><div id='cd'>
<h4 class='heading'> <h4 class='heading'>
fs.cd(dir) fs.cd(dir)
<a href="#cd" class='heading-link'> <a href="#cd" class='heading-link'>
@ -59,7 +64,9 @@ fs.cd(dir)
Changes directory to `dir` Changes directory to `dir`
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='dir'> </div>
<hr><div id='dir'>
<h4 class='heading'> <h4 class='heading'>
fs.dir(path) -> string fs.dir(path) -> string
<a href="#dir" class='heading-link'> <a href="#dir" class='heading-link'>
@ -71,7 +78,9 @@ Returns the directory part of `path`. For the rules, see Go's
filepath.Dir filepath.Dir
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='glob'> </div>
<hr><div id='glob'>
<h4 class='heading'> <h4 class='heading'>
fs.glob(pattern) -> matches (table) fs.glob(pattern) -> matches (table)
<a href="#glob" class='heading-link'> <a href="#glob" class='heading-link'>
@ -83,7 +92,9 @@ Glob all files and directories that match the pattern.
For the rules, see Go's filepath.Glob For the rules, see Go's filepath.Glob
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='join'> </div>
<hr><div id='join'>
<h4 class='heading'> <h4 class='heading'>
fs.join(...) -> string fs.join(...) -> string
<a href="#join" class='heading-link'> <a href="#join" class='heading-link'>
@ -95,7 +106,9 @@ Takes paths and joins them together with the OS's
directory separator (forward or backward slash). directory separator (forward or backward slash).
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='mkdir'> </div>
<hr><div id='mkdir'>
<h4 class='heading'> <h4 class='heading'>
fs.mkdir(name, recursive) fs.mkdir(name, recursive)
<a href="#mkdir" class='heading-link'> <a href="#mkdir" class='heading-link'>
@ -106,7 +119,9 @@ fs.mkdir(name, recursive)
Makes a directory called `name`. If `recursive` is true, it will create its parent directories. Makes a directory called `name`. If `recursive` is true, it will create its parent directories.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='readdir'> </div>
<hr><div id='readdir'>
<h4 class='heading'> <h4 class='heading'>
fs.readdir(dir) -> {} fs.readdir(dir) -> {}
<a href="#readdir" class='heading-link'> <a href="#readdir" class='heading-link'>
@ -117,7 +132,9 @@ fs.readdir(dir) -> {}
Returns a table of files in `dir`. Returns a table of files in `dir`.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='stat'> </div>
<hr><div id='stat'>
<h4 class='heading'> <h4 class='heading'>
fs.stat(path) -> {} fs.stat(path) -> {}
<a href="#stat" class='heading-link'> <a href="#stat" class='heading-link'>
@ -134,3 +151,4 @@ isDir (boolean) - If the path is a directory
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -34,16 +34,19 @@ interfaces and functions which directly relate to shell functionality.
|<a href="#which">which(name) -> string</a>|Checks if `name` is a valid command.| |<a href="#which">which(name) -> string</a>|Checks if `name` is a valid command.|
## Interface fields ## Interface fields
- `ver`: The version of Hilbish |||
- `goVersion`: The version of Go that Hilbish was compiled with |----|----|
- `user`: Username of the user |ver|The version of Hilbish|
- `host`: Hostname of the machine |goVersion|The version of Go that Hilbish was compiled with|
- `dataDir`: Directory for Hilbish data files, including the docs and default modules |user|Username of the user|
- `interactive`: Is Hilbish in an interactive shell? |host|Hostname of the machine|
- `login`: Is Hilbish the login shell? |dataDir|Directory for Hilbish data files, including the docs and default modules|
- `vimMode`: Current Vim input mode of Hilbish (will be nil if not in Vim input mode) |interactive|Is Hilbish in an interactive shell?|
- `exitCode`: xit code of the last executed command |login|Is Hilbish the login shell?|
|vimMode|Current Vim input mode of Hilbish (will be nil if not in Vim input mode)|
|exitCode|xit code of the last executed command|
## Functions
<hr><div id='alias'> <hr><div id='alias'>
<h4 class='heading'> <h4 class='heading'>
hilbish.alias(cmd, orig) hilbish.alias(cmd, orig)
@ -55,7 +58,9 @@ hilbish.alias(cmd, orig)
Sets an alias of `cmd` to `orig` Sets an alias of `cmd` to `orig`
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='appendPath'> </div>
<hr><div id='appendPath'>
<h4 class='heading'> <h4 class='heading'>
hilbish.appendPath(dir) hilbish.appendPath(dir)
<a href="#appendPath" class='heading-link'> <a href="#appendPath" class='heading-link'>
@ -66,7 +71,9 @@ hilbish.appendPath(dir)
Appends `dir` to $PATH Appends `dir` to $PATH
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='complete'> </div>
<hr><div id='complete'>
<h4 class='heading'> <h4 class='heading'>
hilbish.complete(scope, cb) hilbish.complete(scope, cb)
<a href="#complete" class='heading-link'> <a href="#complete" class='heading-link'>
@ -81,7 +88,9 @@ replacing <cmd> with the name of the command (for example `command.git`).
Check `doc completions` for more information. Check `doc completions` for more information.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='cwd'> </div>
<hr><div id='cwd'>
<h4 class='heading'> <h4 class='heading'>
hilbish.cwd() -> string hilbish.cwd() -> string
<a href="#cwd" class='heading-link'> <a href="#cwd" class='heading-link'>
@ -92,7 +101,9 @@ hilbish.cwd() -> string
Returns the current directory of the shell Returns the current directory of the shell
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='exec'> </div>
<hr><div id='exec'>
<h4 class='heading'> <h4 class='heading'>
hilbish.exec(cmd) hilbish.exec(cmd)
<a href="#exec" class='heading-link'> <a href="#exec" class='heading-link'>
@ -103,7 +114,9 @@ hilbish.exec(cmd)
Replaces running hilbish with `cmd` Replaces running hilbish with `cmd`
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='goro'> </div>
<hr><div id='goro'>
<h4 class='heading'> <h4 class='heading'>
hilbish.goro(fn) hilbish.goro(fn)
<a href="#goro" class='heading-link'> <a href="#goro" class='heading-link'>
@ -114,7 +127,9 @@ hilbish.goro(fn)
Puts `fn` in a goroutine Puts `fn` in a goroutine
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='highlighter'> </div>
<hr><div id='highlighter'>
<h4 class='heading'> <h4 class='heading'>
hilbish.highlighter(line) hilbish.highlighter(line)
<a href="#highlighter" class='heading-link'> <a href="#highlighter" class='heading-link'>
@ -136,7 +151,9 @@ end
This code will highlight all double quoted strings in green. This code will highlight all double quoted strings in green.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='hinter'> </div>
<hr><div id='hinter'>
<h4 class='heading'> <h4 class='heading'>
hilbish.hinter(line, pos) hilbish.hinter(line, pos)
<a href="#hinter" class='heading-link'> <a href="#hinter" class='heading-link'>
@ -151,7 +168,9 @@ as the text for the hint. This is by default a shim. To set hints,
override this function with your custom handler. override this function with your custom handler.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='inputMode'> </div>
<hr><div id='inputMode'>
<h4 class='heading'> <h4 class='heading'>
hilbish.inputMode(mode) hilbish.inputMode(mode)
<a href="#inputMode" class='heading-link'> <a href="#inputMode" class='heading-link'>
@ -162,7 +181,9 @@ hilbish.inputMode(mode)
Sets the input mode for Hilbish's line reader. Accepts either emacs or vim Sets the input mode for Hilbish's line reader. Accepts either emacs or vim
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='interval'> </div>
<hr><div id='interval'>
<h4 class='heading'> <h4 class='heading'>
hilbish.interval(cb, time) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a> hilbish.interval(cb, time) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a>
<a href="#interval" class='heading-link'> <a href="#interval" class='heading-link'>
@ -174,7 +195,9 @@ Runs the `cb` function every `time` milliseconds.
This creates a timer that starts immediately. This creates a timer that starts immediately.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='multiprompt'> </div>
<hr><div id='multiprompt'>
<h4 class='heading'> <h4 class='heading'>
hilbish.multiprompt(str) hilbish.multiprompt(str)
<a href="#multiprompt" class='heading-link'> <a href="#multiprompt" class='heading-link'>
@ -185,7 +208,9 @@ hilbish.multiprompt(str)
Changes the continued line prompt to `str` Changes the continued line prompt to `str`
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='prependPath'> </div>
<hr><div id='prependPath'>
<h4 class='heading'> <h4 class='heading'>
hilbish.prependPath(dir) hilbish.prependPath(dir)
<a href="#prependPath" class='heading-link'> <a href="#prependPath" class='heading-link'>
@ -196,7 +221,9 @@ hilbish.prependPath(dir)
Prepends `dir` to $PATH Prepends `dir` to $PATH
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='prompt'> </div>
<hr><div id='prompt'>
<h4 class='heading'> <h4 class='heading'>
hilbish.prompt(str, typ) hilbish.prompt(str, typ)
<a href="#prompt" class='heading-link'> <a href="#prompt" class='heading-link'>
@ -212,7 +239,9 @@ These will be formatted and replaced with the appropriate values.
`%h` - Hostname of device `%h` - Hostname of device
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='read'> </div>
<hr><div id='read'>
<h4 class='heading'> <h4 class='heading'>
hilbish.read(prompt) -> input (string) hilbish.read(prompt) -> input (string)
<a href="#read" class='heading-link'> <a href="#read" class='heading-link'>
@ -225,7 +254,9 @@ This is a separate instance from the one Hilbish actually uses.
Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which shouldn't happen) Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which shouldn't happen)
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='run'> </div>
<hr><div id='run'>
<h4 class='heading'> <h4 class='heading'>
hilbish.run(cmd, returnOut) -> exitCode (number), stdout (string), stderr (string) hilbish.run(cmd, returnOut) -> exitCode (number), stdout (string), stderr (string)
<a href="#run" class='heading-link'> <a href="#run" class='heading-link'>
@ -238,7 +269,9 @@ If returnOut is true, the outputs of `cmd` will be returned as the 2nd and
3rd values instead of being outputted to the terminal. 3rd values instead of being outputted to the terminal.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='runnerMode'> </div>
<hr><div id='runnerMode'>
<h4 class='heading'> <h4 class='heading'>
hilbish.runnerMode(mode) hilbish.runnerMode(mode)
<a href="#runnerMode" class='heading-link'> <a href="#runnerMode" class='heading-link'>
@ -253,7 +286,9 @@ sh, and lua. It also accepts a function, to which if it is passed one
will call it to execute user input instead. will call it to execute user input instead.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='timeout'> </div>
<hr><div id='timeout'>
<h4 class='heading'> <h4 class='heading'>
hilbish.timeout(cb, time) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a> hilbish.timeout(cb, time) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a>
<a href="#timeout" class='heading-link'> <a href="#timeout" class='heading-link'>
@ -265,7 +300,9 @@ Runs the `cb` function after `time` in milliseconds.
This creates a timer that starts immediately. This creates a timer that starts immediately.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='which'> </div>
<hr><div id='which'>
<h4 class='heading'> <h4 class='heading'>
hilbish.which(name) -> string hilbish.which(name) -> string
<a href="#which" class='heading-link'> <a href="#which" class='heading-link'>
@ -277,7 +314,9 @@ Checks if `name` is a valid command.
Will return the path of the binary, or a basename if it's a commander. Will return the path of the binary, or a basename if it's a commander.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='luaSinkAutoFlush'><hr><div id='luaSinkFlush'><hr><div id='luaSinkRead'><hr><div id='luaSinkWrite'><hr><div id='luaSinkWriteln'>## Types </div>
<hr><div id='luaSinkAutoFlush'><hr><div id='luaSinkFlush'><hr><div id='luaSinkRead'><hr><div id='luaSinkWrite'><hr><div id='luaSinkWriteln'>## Types
## Sink ## Sink
A sink is a structure that has input and/or output to/from A sink is a structure that has input and/or output to/from
a desination. a desination.

View File

@ -18,6 +18,7 @@ The alias interface deals with all command aliases in Hilbish.
|<a href="#aliases.list">list() -> table<string, string></a>|Get a table of all aliases, with string keys as the alias and the value as the command.| |<a href="#aliases.list">list() -> table<string, string></a>|Get a table of all aliases, with string keys as the alias and the value as the command.|
|<a href="#aliases.resolve">resolve(alias) -> command (string)</a>|Tries to resolve an alias to its command.| |<a href="#aliases.resolve">resolve(alias) -> command (string)</a>|Tries to resolve an alias to its command.|
## Functions
<hr><div id='aliases.add'> <hr><div id='aliases.add'>
<h4 class='heading'> <h4 class='heading'>
hilbish.aliases.add(alias, cmd) hilbish.aliases.add(alias, cmd)
@ -29,7 +30,9 @@ hilbish.aliases.add(alias, cmd)
This is an alias (ha) for the `hilbish.alias` function. This is an alias (ha) for the `hilbish.alias` function.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='aliases.delete'> </div>
<hr><div id='aliases.delete'>
<h4 class='heading'> <h4 class='heading'>
hilbish.aliases.delete(name) hilbish.aliases.delete(name)
<a href="#aliases.delete" class='heading-link'> <a href="#aliases.delete" class='heading-link'>
@ -40,7 +43,9 @@ hilbish.aliases.delete(name)
Removes an alias. Removes an alias.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='aliases.list'> </div>
<hr><div id='aliases.list'>
<h4 class='heading'> <h4 class='heading'>
hilbish.aliases.list() -> table\<string, string> hilbish.aliases.list() -> table\<string, string>
<a href="#aliases.list" class='heading-link'> <a href="#aliases.list" class='heading-link'>
@ -51,7 +56,9 @@ hilbish.aliases.list() -> table\<string, string>
Get a table of all aliases, with string keys as the alias and the value as the command. Get a table of all aliases, with string keys as the alias and the value as the command.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='aliases.resolve'> </div>
<hr><div id='aliases.resolve'>
<h4 class='heading'> <h4 class='heading'>
hilbish.aliases.resolve(alias) -> command (string) hilbish.aliases.resolve(alias) -> command (string)
<a href="#aliases.resolve" class='heading-link'> <a href="#aliases.resolve" class='heading-link'>
@ -63,3 +70,4 @@ Tries to resolve an alias to its command.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -18,6 +18,7 @@ The completions interface deals with tab completions.
|<a href="#completions.bins">bins(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns binary/executale completion candidates based on the provided query.| |<a href="#completions.bins">bins(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns binary/executale completion candidates based on the provided query.|
|<a href="#completions.files">files(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns file completion candidates based on the provided query.| |<a href="#completions.files">files(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns file completion candidates based on the provided query.|
## Functions
<hr><div id='completions.call'> <hr><div id='completions.call'>
<h4 class='heading'> <h4 class='heading'>
hilbish.completions.call(name, query, ctx, fields) -> completionGroups (table), prefix (string) hilbish.completions.call(name, query, ctx, fields) -> completionGroups (table), prefix (string)
@ -32,7 +33,9 @@ of `command.name`, example: `command.git`.
You can check `doc completions` for info on the `completionGroups` return value. You can check `doc completions` for info on the `completionGroups` return value.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='completions.handler'> </div>
<hr><div id='completions.handler'>
<h4 class='heading'> <h4 class='heading'>
hilbish.completions.handler(line, pos) hilbish.completions.handler(line, pos)
<a href="#completions.handler" class='heading-link'> <a href="#completions.handler" class='heading-link'>
@ -44,7 +47,9 @@ The handler function is the callback for tab completion in Hilbish.
You can check the completions doc for more info. You can check the completions doc for more info.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='completions.bins'> </div>
<hr><div id='completions.bins'>
<h4 class='heading'> <h4 class='heading'>
hilbish.completions.bins(query, ctx, fields) -> entries (table), prefix (string) hilbish.completions.bins(query, ctx, fields) -> entries (table), prefix (string)
<a href="#completions.bins" class='heading-link'> <a href="#completions.bins" class='heading-link'>
@ -55,7 +60,9 @@ hilbish.completions.bins(query, ctx, fields) -> entries (table), prefix (string)
Returns binary/executale completion candidates based on the provided query. Returns binary/executale completion candidates based on the provided query.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='completions.files'> </div>
<hr><div id='completions.files'>
<h4 class='heading'> <h4 class='heading'>
hilbish.completions.files(query, ctx, fields) -> entries (table), prefix (string) hilbish.completions.files(query, ctx, fields) -> entries (table), prefix (string)
<a href="#completions.files" class='heading-link'> <a href="#completions.files" class='heading-link'>
@ -67,3 +74,4 @@ Returns file completion candidates based on the provided query.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -19,6 +19,7 @@ directly interact with the line editor in use.
|<a href="#editor.insert">insert(text)</a>|Inserts text into the line.| |<a href="#editor.insert">insert(text)</a>|Inserts text into the line.|
|<a href="#editor.setVimRegister">setVimRegister(register, text)</a>|Sets the vim register at `register` to hold the passed text.| |<a href="#editor.setVimRegister">setVimRegister(register, text)</a>|Sets the vim register at `register` to hold the passed text.|
## Functions
<hr><div id='editor.getLine'> <hr><div id='editor.getLine'>
<h4 class='heading'> <h4 class='heading'>
hilbish.editor.getLine() -> string hilbish.editor.getLine() -> string
@ -30,7 +31,9 @@ hilbish.editor.getLine() -> string
Returns the current input line. Returns the current input line.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='editor.getVimRegister'> </div>
<hr><div id='editor.getVimRegister'>
<h4 class='heading'> <h4 class='heading'>
hilbish.editor.getVimRegister(register) -> string hilbish.editor.getVimRegister(register) -> string
<a href="#editor.getVimRegister" class='heading-link'> <a href="#editor.getVimRegister" class='heading-link'>
@ -41,7 +44,9 @@ hilbish.editor.getVimRegister(register) -> string
Returns the text that is at the register. Returns the text that is at the register.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='editor.insert'> </div>
<hr><div id='editor.insert'>
<h4 class='heading'> <h4 class='heading'>
hilbish.editor.insert(text) hilbish.editor.insert(text)
<a href="#editor.insert" class='heading-link'> <a href="#editor.insert" class='heading-link'>
@ -52,7 +57,9 @@ hilbish.editor.insert(text)
Inserts text into the line. Inserts text into the line.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='editor.setVimRegister'> </div>
<hr><div id='editor.setVimRegister'>
<h4 class='heading'> <h4 class='heading'>
hilbish.editor.setVimRegister(register, text) hilbish.editor.setVimRegister(register, text)
<a href="#editor.setVimRegister" class='heading-link'> <a href="#editor.setVimRegister" class='heading-link'>
@ -64,3 +71,4 @@ Sets the vim register at `register` to hold the passed text.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -21,6 +21,7 @@ method of saving history.
|<a href="#history.get">get(idx)</a>|Retrieves a command from the history based on the `idx`.| |<a href="#history.get">get(idx)</a>|Retrieves a command from the history based on the `idx`.|
|<a href="#history.size">size() -> number</a>|Returns the amount of commands in the history.| |<a href="#history.size">size() -> number</a>|Returns the amount of commands in the history.|
## Functions
<hr><div id='history.add'> <hr><div id='history.add'>
<h4 class='heading'> <h4 class='heading'>
hilbish.history.add(cmd) hilbish.history.add(cmd)
@ -32,7 +33,9 @@ hilbish.history.add(cmd)
Adds a command to the history. Adds a command to the history.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='history.all'> </div>
<hr><div id='history.all'>
<h4 class='heading'> <h4 class='heading'>
hilbish.history.all() -> table hilbish.history.all() -> table
<a href="#history.all" class='heading-link'> <a href="#history.all" class='heading-link'>
@ -43,7 +46,9 @@ hilbish.history.all() -> table
Retrieves all history. Retrieves all history.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='history.clear'> </div>
<hr><div id='history.clear'>
<h4 class='heading'> <h4 class='heading'>
hilbish.history.clear() hilbish.history.clear()
<a href="#history.clear" class='heading-link'> <a href="#history.clear" class='heading-link'>
@ -54,7 +59,9 @@ hilbish.history.clear()
Deletes all commands from the history. Deletes all commands from the history.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='history.get'> </div>
<hr><div id='history.get'>
<h4 class='heading'> <h4 class='heading'>
hilbish.history.get(idx) hilbish.history.get(idx)
<a href="#history.get" class='heading-link'> <a href="#history.get" class='heading-link'>
@ -65,7 +72,9 @@ hilbish.history.get(idx)
Retrieves a command from the history based on the `idx`. Retrieves a command from the history based on the `idx`.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='history.size'> </div>
<hr><div id='history.size'>
<h4 class='heading'> <h4 class='heading'>
hilbish.history.size() -> number hilbish.history.size() -> number
<a href="#history.size" class='heading-link'> <a href="#history.size" class='heading-link'>
@ -77,3 +86,4 @@ Returns the amount of commands in the history.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -23,6 +23,7 @@ interactive usage or with the functions defined below for use in external runner
|<a href="#jobs.get">get(id) -> @Job</a>|Get a job object via its ID.| |<a href="#jobs.get">get(id) -> @Job</a>|Get a job object via its ID.|
|<a href="#jobs.last">last() -> @Job</a>|Returns the last added job from the table.| |<a href="#jobs.last">last() -> @Job</a>|Returns the last added job from the table.|
## Functions
<hr><div id='jobs.background'><hr><div id='jobs.foreground'><hr><div id='jobs.start'><hr><div id='jobs.stop'><hr><div id='jobs.add'> <hr><div id='jobs.background'><hr><div id='jobs.foreground'><hr><div id='jobs.start'><hr><div id='jobs.stop'><hr><div id='jobs.add'>
<h4 class='heading'> <h4 class='heading'>
hilbish.jobs.add(cmdstr, args, execPath) hilbish.jobs.add(cmdstr, args, execPath)
@ -34,7 +35,9 @@ hilbish.jobs.add(cmdstr, args, execPath)
Adds a new job to the job table. Note that this does not immediately run it. Adds a new job to the job table. Note that this does not immediately run it.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='jobs.all'> </div>
<hr><div id='jobs.all'>
<h4 class='heading'> <h4 class='heading'>
hilbish.jobs.all() -> table\<<a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" style="text-decoration: none;" id="lol">Job</a>> hilbish.jobs.all() -> table\<<a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" style="text-decoration: none;" id="lol">Job</a>>
<a href="#jobs.all" class='heading-link'> <a href="#jobs.all" class='heading-link'>
@ -45,7 +48,9 @@ hilbish.jobs.all() -> table\<<a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#jo
Returns a table of all job objects. Returns a table of all job objects.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='jobs.disown'> </div>
<hr><div id='jobs.disown'>
<h4 class='heading'> <h4 class='heading'>
hilbish.jobs.disown(id) hilbish.jobs.disown(id)
<a href="#jobs.disown" class='heading-link'> <a href="#jobs.disown" class='heading-link'>
@ -56,7 +61,9 @@ hilbish.jobs.disown(id)
Disowns a job. This deletes it from the job table. Disowns a job. This deletes it from the job table.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='jobs.get'> </div>
<hr><div id='jobs.get'>
<h4 class='heading'> <h4 class='heading'>
hilbish.jobs.get(id) -> <a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" style="text-decoration: none;" id="lol">Job</a> hilbish.jobs.get(id) -> <a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" style="text-decoration: none;" id="lol">Job</a>
<a href="#jobs.get" class='heading-link'> <a href="#jobs.get" class='heading-link'>
@ -67,7 +74,9 @@ hilbish.jobs.get(id) -> <a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" st
Get a job object via its ID. Get a job object via its ID.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='jobs.last'> </div>
<hr><div id='jobs.last'>
<h4 class='heading'> <h4 class='heading'>
hilbish.jobs.last() -> <a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" style="text-decoration: none;" id="lol">Job</a> hilbish.jobs.last() -> <a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" style="text-decoration: none;" id="lol">Job</a>
<a href="#jobs.last" class='heading-link'> <a href="#jobs.last" class='heading-link'>
@ -78,7 +87,9 @@ hilbish.jobs.last() -> <a href="/Hilbish/docs/api/hilbish/hilbish.jobs/#job" sty
Returns the last added job from the table. Returns the last added job from the table.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div>## Types </div>
## Types
## Job ## Job
The Job type describes a Hilbish job. The Job type describes a Hilbish job.
### Properties ### Properties

View File

@ -13,7 +13,9 @@ the current OS on the systen. This mainly includes the name and
version. version.
## Interface fields ## Interface fields
- `family`: Family name of the current OS |||
- `name`: Pretty name of the current OS |----|----|
- `version`: Version of the current OS |family|Family name of the current OS|
|name|Pretty name of the current OS|
|version|Version of the current OS|

View File

@ -21,6 +21,7 @@ write command in Fennel.
|<a href="#runner.lua">lua(cmd)</a>|Evaluates `cmd` as Lua input. This is the same as using `dofile`| |<a href="#runner.lua">lua(cmd)</a>|Evaluates `cmd` as Lua input. This is the same as using `dofile`|
|<a href="#runner.sh">sh(cmd)</a>|Runs a command in Hilbish's shell script interpreter.| |<a href="#runner.sh">sh(cmd)</a>|Runs a command in Hilbish's shell script interpreter.|
## Functions
<hr><div id='runner.setMode'> <hr><div id='runner.setMode'>
<h4 class='heading'> <h4 class='heading'>
hilbish.runner.setMode(cb) hilbish.runner.setMode(cb)
@ -35,7 +36,9 @@ In normal cases, neither callbacks should be overrided by the user,
as the higher level functions listed below this will handle it. as the higher level functions listed below this will handle it.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='runner.lua'> </div>
<hr><div id='runner.lua'>
<h4 class='heading'> <h4 class='heading'>
hilbish.runner.lua(cmd) hilbish.runner.lua(cmd)
<a href="#runner.lua" class='heading-link'> <a href="#runner.lua" class='heading-link'>
@ -47,7 +50,9 @@ Evaluates `cmd` as Lua input. This is the same as using `dofile`
or `load`, but is appropriated for the runner interface. or `load`, but is appropriated for the runner interface.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='runner.sh'> </div>
<hr><div id='runner.sh'>
<h4 class='heading'> <h4 class='heading'>
hilbish.runner.sh(cmd) hilbish.runner.sh(cmd)
<a href="#runner.sh" class='heading-link'> <a href="#runner.sh" class='heading-link'>
@ -60,3 +65,4 @@ This is the equivalent of using `source`.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -37,9 +37,12 @@ print(t.running) // true
|<a href="#timers.get">get(id) -> @Timer</a>|Retrieves a timer via its ID.| |<a href="#timers.get">get(id) -> @Timer</a>|Retrieves a timer via its ID.|
## Interface fields ## Interface fields
- `INTERVAL`: Constant for an interval timer type |||
- `TIMEOUT`: Constant for a timeout timer type |----|----|
|INTERVAL|Constant for an interval timer type|
|TIMEOUT|Constant for a timeout timer type|
## Functions
<hr><div id='timers.start'><hr><div id='timers.stop'><hr><div id='timers.create'> <hr><div id='timers.start'><hr><div id='timers.stop'><hr><div id='timers.create'>
<h4 class='heading'> <h4 class='heading'>
hilbish.timers.create(type, time, callback) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a> hilbish.timers.create(type, time, callback) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a>
@ -52,7 +55,9 @@ Creates a timer that runs based on the specified `time` in milliseconds.
The `type` can either be `hilbish.timers.INTERVAL` or `hilbish.timers.TIMEOUT` The `type` can either be `hilbish.timers.INTERVAL` or `hilbish.timers.TIMEOUT`
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='timers.get'> </div>
<hr><div id='timers.get'>
<h4 class='heading'> <h4 class='heading'>
hilbish.timers.get(id) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a> hilbish.timers.get(id) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a>
<a href="#timers.get" class='heading-link'> <a href="#timers.get" class='heading-link'>
@ -63,7 +68,9 @@ hilbish.timers.get(id) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#tim
Retrieves a timer via its ID. Retrieves a timer via its ID.
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div>## Types </div>
## Types
## Timer ## Timer
The Job type describes a Hilbish timer. The Job type describes a Hilbish timer.
### Properties ### Properties

View File

@ -13,6 +13,8 @@ It is equivalent to XDG on Linux and gets the user's preferred directories
for configs and data. for configs and data.
## Interface fields ## Interface fields
- `config`: The user's config directory |||
- `data`: The user's directory for program data |----|----|
|config|The user's config directory|
|data|The user's directory for program data|

View File

@ -18,6 +18,7 @@ The terminal library is a simple and lower level library for certain terminal in
|<a href="#setRaw">setRaw()</a>|Puts the terminal in raw mode| |<a href="#setRaw">setRaw()</a>|Puts the terminal in raw mode|
|<a href="#size">size()</a>|Gets the dimensions of the terminal. Returns a table with `width` and `height`| |<a href="#size">size()</a>|Gets the dimensions of the terminal. Returns a table with `width` and `height`|
## Functions
<hr><div id='restoreState'> <hr><div id='restoreState'>
<h4 class='heading'> <h4 class='heading'>
terminal.restoreState() terminal.restoreState()
@ -29,7 +30,9 @@ terminal.restoreState()
Restores the last saved state of the terminal Restores the last saved state of the terminal
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='saveState'> </div>
<hr><div id='saveState'>
<h4 class='heading'> <h4 class='heading'>
terminal.saveState() terminal.saveState()
<a href="#saveState" class='heading-link'> <a href="#saveState" class='heading-link'>
@ -40,7 +43,9 @@ terminal.saveState()
Saves the current state of the terminal Saves the current state of the terminal
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='setRaw'> </div>
<hr><div id='setRaw'>
<h4 class='heading'> <h4 class='heading'>
terminal.setRaw() terminal.setRaw()
<a href="#setRaw" class='heading-link'> <a href="#setRaw" class='heading-link'>
@ -51,7 +56,9 @@ terminal.setRaw()
Puts the terminal in raw mode Puts the terminal in raw mode
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div><hr><div id='size'> </div>
<hr><div id='size'>
<h4 class='heading'> <h4 class='heading'>
terminal.size() terminal.size()
<a href="#size" class='heading-link'> <a href="#size" class='heading-link'>
@ -64,3 +71,4 @@ Note: this is not the size in relation to the dimensions of the display
#### Parameters #### Parameters
This function has no parameters. This function has no parameters.
</div> </div>

View File

@ -60,6 +60,7 @@
border-style: solid; border-style: solid;
border-color: #565c64;; border-color: #565c64;;
border-collapse: collapse; border-collapse: collapse;
margin-bottom: 12px;
} }
table td { table td {