diff --git a/cmd/docgen/docgen.go b/cmd/docgen/docgen.go index a14742d..9332dfa 100644 --- a/cmd/docgen/docgen.go +++ b/cmd/docgen/docgen.go @@ -481,11 +481,17 @@ func main() { if len(modu.Fields) != 0 { f.WriteString("## Interface fields\n") - for _, dps := range modu.Fields { - f.WriteString(fmt.Sprintf("- `%s`: ", dps.FuncName)) - f.WriteString(strings.Join(dps.Doc, " ")) - f.WriteString("\n") + + mdTable := md.NewTable(len(modu.Fields), 2) + mdTable.SetTitle(0, "") + 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") } if len(modu.Properties) != 0 { @@ -499,12 +505,12 @@ func main() { } if len(modu.Docs) != 0 { - //f.WriteString("## Functions\n") + f.WriteString("## Functions\n") for _, dps := range modu.Docs { - f.WriteString(fmt.Sprintf("
", dps.FuncName)) if dps.IsMember { continue } + f.WriteString(fmt.Sprintf("
", dps.FuncName)) htmlSig := typeTag.ReplaceAllStringFunc(strings.Replace(modname + "." + dps.FuncSig, "<", `\<`, -1), func(typ string) string { typName := typ[1:] typLookup := typeTable[strings.ToLower(typName)] @@ -550,6 +556,7 @@ func main() { f.WriteString("\n\n") } f.WriteString("
") + f.WriteString("\n\n") } } diff --git a/docs/api/bait.md b/docs/api/bait.md index 292152f..468648f 100644 --- a/docs/api/bait.md +++ b/docs/api/bait.md @@ -41,6 +41,7 @@ this function will set the user prompt. |release(name, catcher)|Removes the `catcher` for the event with `name`.| |throw(name, ...args)|Throws a hook with `name` with the provided `args`| +## Functions

bait.catch(name, cb) @@ -57,7 +58,9 @@ ummm `function` **`cb`** ? -


+
+ +

bait.catchOnce(name, cb) @@ -68,7 +71,9 @@ bait.catchOnce(name, cb) Same as catch, but only runs the `cb` once and then removes the hook #### Parameters This function has no parameters. -


+
+ +

bait.hooks(name) -> table @@ -79,7 +84,9 @@ bait.hooks(name) -> table Returns a table with hooks (callback functions) on the event with `name`. #### Parameters This function has no parameters. -


+
+ +

bait.release(name, catcher) @@ -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. #### Parameters This function has no parameters. -


+
+ +

bait.throw(name, ...args) @@ -108,4 +117,5 @@ The name of the hook. `any` **`args`** (This type is variadic. You can pass an infinite amount of parameters with this type.) The arguments to pass to the hook. -

\ No newline at end of file +
+ diff --git a/docs/api/commander.md b/docs/api/commander.md index fa641b4..20117af 100644 --- a/docs/api/commander.md +++ b/docs/api/commander.md @@ -43,6 +43,7 @@ name would suggest. |deregister(name)|Deregisters any command registered with `name`| |register(name, cb)|Register a command with `name` that runs `cb` when ran| +## Functions

commander.deregister(name) @@ -54,7 +55,9 @@ commander.deregister(name) Deregisters any command registered with `name` #### Parameters This function has no parameters. -


+
+ +

commander.register(name, cb) @@ -65,4 +68,5 @@ commander.register(name, cb) Register a command with `name` that runs `cb` when ran #### Parameters This function has no parameters. -

\ No newline at end of file + + diff --git a/docs/api/fs.md b/docs/api/fs.md index 64a2092..fff8877 100644 --- a/docs/api/fs.md +++ b/docs/api/fs.md @@ -25,6 +25,7 @@ I/O and filesystem functions. |readdir(dir) -> {}|Returns a table of files in `dir`.| |stat(path) -> {}|Returns a table of info about the `path`.| +## Functions

fs.abs(path) -> string @@ -36,7 +37,9 @@ fs.abs(path) -> string Gives an absolute version of `path`. #### Parameters This function has no parameters. -


+
+ +

fs.basename(path) -> string @@ -48,7 +51,9 @@ Gives the basename of `path`. For the rules, see Go's filepath.Base #### Parameters This function has no parameters. -


+
+ +

fs.cd(dir) @@ -59,7 +64,9 @@ fs.cd(dir) Changes directory to `dir` #### Parameters This function has no parameters. -


+
+ +

fs.dir(path) -> string @@ -71,7 +78,9 @@ Returns the directory part of `path`. For the rules, see Go's filepath.Dir #### Parameters This function has no parameters. -


+
+ +

fs.glob(pattern) -> matches (table) @@ -83,7 +92,9 @@ Glob all files and directories that match the pattern. For the rules, see Go's filepath.Glob #### Parameters This function has no parameters. -


+
+ +

fs.join(...) -> string @@ -95,7 +106,9 @@ Takes paths and joins them together with the OS's directory separator (forward or backward slash). #### Parameters This function has no parameters. -


+
+ +

fs.mkdir(name, recursive) @@ -106,7 +119,9 @@ fs.mkdir(name, recursive) Makes a directory called `name`. If `recursive` is true, it will create its parent directories. #### Parameters This function has no parameters. -


+
+ +

fs.readdir(dir) -> {} @@ -117,7 +132,9 @@ fs.readdir(dir) -> {} Returns a table of files in `dir`. #### Parameters This function has no parameters. -


+
+ +

fs.stat(path) -> {} @@ -133,4 +150,5 @@ mode (string) - Permission mode in an octal format string (with leading 0) isDir (boolean) - If the path is a directory #### Parameters This function has no parameters. -

\ No newline at end of file + + diff --git a/docs/api/hilbish/_index.md b/docs/api/hilbish/_index.md index 317ba5d..2fb9aa7 100644 --- a/docs/api/hilbish/_index.md +++ b/docs/api/hilbish/_index.md @@ -34,16 +34,19 @@ interfaces and functions which directly relate to shell functionality. |which(name) -> string|Checks if `name` is a valid command.| ## Interface fields -- `ver`: The version of Hilbish -- `goVersion`: The version of Go that Hilbish was compiled with -- `user`: Username of the user -- `host`: Hostname of the machine -- `dataDir`: Directory for Hilbish data files, including the docs and default modules -- `interactive`: Is Hilbish in an interactive shell? -- `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 +||| +|----|----| +|ver|The version of Hilbish| +|goVersion|The version of Go that Hilbish was compiled with| +|user|Username of the user| +|host|Hostname of the machine| +|dataDir|Directory for Hilbish data files, including the docs and default modules| +|interactive|Is Hilbish in an interactive shell?| +|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

hilbish.alias(cmd, orig) @@ -55,7 +58,9 @@ hilbish.alias(cmd, orig) Sets an alias of `cmd` to `orig` #### Parameters This function has no parameters. -


+
+ +

hilbish.appendPath(dir) @@ -66,7 +71,9 @@ hilbish.appendPath(dir) Appends `dir` to $PATH #### Parameters This function has no parameters. -


+
+ +

hilbish.complete(scope, cb) @@ -81,7 +88,9 @@ replacing with the name of the command (for example `command.git`). Check `doc completions` for more information. #### Parameters This function has no parameters. -


+
+ +

hilbish.cwd() -> string @@ -92,7 +101,9 @@ hilbish.cwd() -> string Returns the current directory of the shell #### Parameters This function has no parameters. -


+
+ +

hilbish.exec(cmd) @@ -103,7 +114,9 @@ hilbish.exec(cmd) Replaces running hilbish with `cmd` #### Parameters This function has no parameters. -


+
+ +

hilbish.goro(fn) @@ -114,7 +127,9 @@ hilbish.goro(fn) Puts `fn` in a goroutine #### Parameters This function has no parameters. -


+
+ +

hilbish.highlighter(line) @@ -136,7 +151,9 @@ end This code will highlight all double quoted strings in green. #### Parameters This function has no parameters. -


+
+ +

hilbish.hinter(line, pos) @@ -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. #### Parameters This function has no parameters. -


+
+ +

hilbish.inputMode(mode) @@ -162,7 +181,9 @@ hilbish.inputMode(mode) Sets the input mode for Hilbish's line reader. Accepts either emacs or vim #### Parameters This function has no parameters. -


+
+ +

hilbish.interval(cb, time) -> Timer @@ -174,7 +195,9 @@ Runs the `cb` function every `time` milliseconds. This creates a timer that starts immediately. #### Parameters This function has no parameters. -


+
+ +

hilbish.multiprompt(str) @@ -185,7 +208,9 @@ hilbish.multiprompt(str) Changes the continued line prompt to `str` #### Parameters This function has no parameters. -


+
+ +

hilbish.prependPath(dir) @@ -196,7 +221,9 @@ hilbish.prependPath(dir) Prepends `dir` to $PATH #### Parameters This function has no parameters. -


+
+ +

hilbish.prompt(str, typ) @@ -212,7 +239,9 @@ These will be formatted and replaced with the appropriate values. `%h` - Hostname of device #### Parameters This function has no parameters. -


+
+ +

hilbish.read(prompt) -> input (string) @@ -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) #### Parameters This function has no parameters. -


+
+ +

hilbish.run(cmd, returnOut) -> exitCode (number), stdout (string), stderr (string) @@ -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. #### Parameters This function has no parameters. -


+
+ +

hilbish.runnerMode(mode) @@ -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. #### Parameters This function has no parameters. -


+
+ +

hilbish.timeout(cb, time) -> Timer @@ -265,7 +300,9 @@ Runs the `cb` function after `time` in milliseconds. This creates a timer that starts immediately. #### Parameters This function has no parameters. -


+
+ +

hilbish.which(name) -> string @@ -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. #### Parameters This function has no parameters. -






+ +




+ diff --git a/docs/api/hilbish/hilbish.completions.md b/docs/api/hilbish/hilbish.completions.md index 726e7e9..698140d 100644 --- a/docs/api/hilbish/hilbish.completions.md +++ b/docs/api/hilbish/hilbish.completions.md @@ -18,6 +18,7 @@ The completions interface deals with tab completions. |bins(query, ctx, fields) -> entries (table), prefix (string)|Returns binary/executale completion candidates based on the provided query.| |files(query, ctx, fields) -> entries (table), prefix (string)|Returns file completion candidates based on the provided query.| +## Functions

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. #### Parameters This function has no parameters. -


+
+ +

+ +

+ +
\ No newline at end of file +
+ diff --git a/docs/api/hilbish/hilbish.editor.md b/docs/api/hilbish/hilbish.editor.md index 38b247e..ee55580 100644 --- a/docs/api/hilbish/hilbish.editor.md +++ b/docs/api/hilbish/hilbish.editor.md @@ -19,6 +19,7 @@ directly interact with the line editor in use. |insert(text)|Inserts text into the line.| |setVimRegister(register, text)|Sets the vim register at `register` to hold the passed text.| +## Functions

hilbish.editor.getLine() -> string @@ -30,7 +31,9 @@ hilbish.editor.getLine() -> string Returns the current input line. #### Parameters This function has no parameters. -


+
+ +

+ +

+ +
\ No newline at end of file +
+ diff --git a/docs/api/hilbish/hilbish.history.md b/docs/api/hilbish/hilbish.history.md index 0f60370..dee087a 100644 --- a/docs/api/hilbish/hilbish.history.md +++ b/docs/api/hilbish/hilbish.history.md @@ -21,6 +21,7 @@ method of saving history. |get(idx)|Retrieves a command from the history based on the `idx`.| |size() -> number|Returns the amount of commands in the history.| +## Functions

hilbish.history.add(cmd) @@ -32,7 +33,9 @@ hilbish.history.add(cmd) Adds a command to the history. #### Parameters This function has no parameters. -


+
+ +

+ +

+ +

+ +
\ No newline at end of file +
+ diff --git a/docs/api/hilbish/hilbish.jobs.md b/docs/api/hilbish/hilbish.jobs.md index f27bc98..ecc045e 100644 --- a/docs/api/hilbish/hilbish.jobs.md +++ b/docs/api/hilbish/hilbish.jobs.md @@ -23,6 +23,7 @@ interactive usage or with the functions defined below for use in external runner |get(id) -> @Job|Get a job object via its ID.| |last() -> @Job|Returns the last added job from the table.| +## Functions




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. #### Parameters This function has no parameters. -


+
+ +

+ +

hilbish.jobs.get(id) -> Job @@ -67,7 +74,9 @@ hilbish.jobs.get(id) ->
+
+ +
+ +## Types ## Job The Job type describes a Hilbish job. ### Properties diff --git a/docs/api/hilbish/hilbish.os.md b/docs/api/hilbish/hilbish.os.md index 00196da..3abd8f7 100644 --- a/docs/api/hilbish/hilbish.os.md +++ b/docs/api/hilbish/hilbish.os.md @@ -13,7 +13,9 @@ the current OS on the systen. This mainly includes the name and version. ## 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| diff --git a/docs/api/hilbish/hilbish.runner.md b/docs/api/hilbish/hilbish.runner.md index f5977e1..98e8f6c 100644 --- a/docs/api/hilbish/hilbish.runner.md +++ b/docs/api/hilbish/hilbish.runner.md @@ -21,6 +21,7 @@ write command in Fennel. |lua(cmd)|Evaluates `cmd` as Lua input. This is the same as using `dofile`| |sh(cmd)|Runs a command in Hilbish's shell script interpreter.| +## Functions

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. #### Parameters This function has no parameters. -


+
+ +

+ +
\ No newline at end of file +

+ diff --git a/docs/api/hilbish/hilbish.timers.md b/docs/api/hilbish/hilbish.timers.md index 20efd7c..186c1af 100644 --- a/docs/api/hilbish/hilbish.timers.md +++ b/docs/api/hilbish/hilbish.timers.md @@ -37,9 +37,12 @@ print(t.running) // true |get(id) -> @Timer|Retrieves a timer via its ID.| ## 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


hilbish.timers.create(type, time, callback) -> Timer @@ -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` #### Parameters This function has no parameters. -


+
+ +
+ diff --git a/website/themes/hsh/layouts/partials/head.html b/website/themes/hsh/layouts/partials/head.html index 8299693..6109fb5 100644 --- a/website/themes/hsh/layouts/partials/head.html +++ b/website/themes/hsh/layouts/partials/head.html @@ -60,6 +60,7 @@ border-style: solid; border-color: #565c64;; border-collapse: collapse; + margin-bottom: 12px; } table td {