From d512e1173520cf1e496eb898ec62fd121b2aa4ba Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Sat, 9 Sep 2023 17:39:15 +0000 Subject: [PATCH] deploy: 726082ba032309b80b27d8ba63ea0a215f7cae91 --- versions/doc-improvements/docs/api/bait/index.html | 3 +-- .../doc-improvements/docs/api/commander/index.html | 3 +-- versions/doc-improvements/docs/api/fs/index.html | 3 +-- .../docs/api/hilbish/hilbish.aliases/index.html | 3 +-- .../docs/api/hilbish/hilbish.completions/index.html | 3 +-- .../docs/api/hilbish/hilbish.editor/index.html | 3 +-- .../docs/api/hilbish/hilbish.history/index.html | 3 +-- .../docs/api/hilbish/hilbish.jobs/index.html | 3 +-- .../docs/api/hilbish/hilbish.runner/index.html | 3 +-- .../docs/api/hilbish/hilbish.timers/index.html | 3 +-- versions/doc-improvements/docs/api/hilbish/index.html | 3 +-- versions/doc-improvements/docs/api/hilbish/index.xml | 9 +++++---- versions/doc-improvements/docs/api/index.xml | 2 +- .../doc-improvements/docs/api/terminal/index.html | 3 +-- versions/doc-improvements/index.xml | 11 ++++++----- 15 files changed, 24 insertions(+), 34 deletions(-) diff --git a/versions/doc-improvements/docs/api/bait/index.html b/versions/doc-improvements/docs/api/bait/index.html index fcfce42..bcf8da8 100644 --- a/versions/doc-improvements/docs/api/bait/index.html +++ b/versions/doc-improvements/docs/api/bait/index.html @@ -16,8 +16,7 @@ Consider this part of it:

end)
 

What this does is, whenever the command.exit event is thrown, this function will set the user prompt.

Functions -

catch(name, cb)Catches a hook with name. Runs the cb when it is thrown
catchOnce(name, cb)Same as catch, but only runs the cb once and then removes the hook
hooks(name) -> tableReturns a table with hooks (callback functions) on 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

Functions -


bait.catch(name, cb) +

catch(name, cb)Catches a hook with name. Runs the cb when it is thrown
catchOnce(name, cb)Same as catch, but only runs the cb once and then removes the hook
hooks(name) -> tableReturns a table with hooks (callback functions) on 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

bait.catch(name, cb)

Catches a hook with name. Runs the cb when it is thrown

Parameters

string name
ummm

function cb
?


bait.catchOnce(name, cb)

Same as catch, but only runs the cb once and then removes the hook

Parameters diff --git a/versions/doc-improvements/docs/api/commander/index.html b/versions/doc-improvements/docs/api/commander/index.html index 0dd2884..db27a21 100644 --- a/versions/doc-improvements/docs/api/commander/index.html +++ b/versions/doc-improvements/docs/api/commander/index.html @@ -18,8 +18,7 @@ and err. The values of these is a
  • out is standard output. This is usually where text meant for output should go.
  • err is standard error. This sink is for writing errors, as the name would suggest.
  • Functions -

    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) +

    deregister(name)Deregisters any command registered with name
    register(name, cb)Register a command with name that runs cb when ran

    commander.deregister(name)

    Deregisters any command registered with name

    Parameters

    This function has no parameters.


    commander.register(name, cb)

    Register a command with name that runs cb when ran

    Parameters diff --git a/versions/doc-improvements/docs/api/fs/index.html b/versions/doc-improvements/docs/api/fs/index.html index d96fdb0..dbe8c25 100644 --- a/versions/doc-improvements/docs/api/fs/index.html +++ b/versions/doc-improvements/docs/api/fs/index.html @@ -5,8 +5,7 @@

    The fs module provides easy and simple access to filesystem functions and other things, and acts an addition to the Lua standard library’s I/O and filesystem functions.

    Functions -

    abs(path) -> stringGives an absolute version of path.
    basename(path) -> stringGives the basename of path. For the rules,
    cd(dir)Changes directory to dir
    dir(path) -> stringReturns the directory part of path. For the rules, see Go’s
    glob(pattern) -> matches (table)Glob all files and directories that match the pattern.
    join(…) -> stringTakes paths and joins them together with the OS’s
    mkdir(name, recursive)Makes a directory called name. If recursive is true, it will create its parent directories.
    readdir(dir) -> {}Returns a table of files in dir.
    stat(path) -> {}Returns a table of info about the path.

    Functions -


    fs.abs(path) -> string +

    abs(path) -> stringGives an absolute version of path.
    basename(path) -> stringGives the basename of path. For the rules,
    cd(dir)Changes directory to dir
    dir(path) -> stringReturns the directory part of path. For the rules, see Go’s
    glob(pattern) -> matches (table)Glob all files and directories that match the pattern.
    join(…) -> stringTakes paths and joins them together with the OS’s
    mkdir(name, recursive)Makes a directory called name. If recursive is true, it will create its parent directories.
    readdir(dir) -> {}Returns a table of files in dir.
    stat(path) -> {}Returns a table of info about the path.

    fs.abs(path) -> string

    Gives an absolute version of path.

    Parameters

    This function has no parameters.


    fs.basename(path) -> string

    Gives the basename of path. For the rules, diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/index.html index e992ff4..97f37b1 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/index.html @@ -3,8 +3,7 @@

    Module hilbish.aliases

    command aliasing

    Introduction

    The alias interface deals with all command aliases in Hilbish.

    Functions -

    add(alias, cmd)This is an alias (ha) for the hilbish.alias function.
    delete(name)Removes an alias.
    list() -> table<string, string>Get a table of all aliases, with string keys as the alias and the value as the command.
    resolve(alias) -> command (string)Tries to resolve an alias to its command.

    Functions -


    hilbish.aliases.add(alias, cmd) +

    add(alias, cmd)This is an alias (ha) for the hilbish.alias function.
    delete(name)Removes an alias.
    list() -> table<string, string>Get a table of all aliases, with string keys as the alias and the value as the command.
    resolve(alias) -> command (string)Tries to resolve an alias to its command.

    hilbish.aliases.add(alias, cmd)

    This is an alias (ha) for the hilbish.alias function.

    Parameters

    This function has no parameters.


    hilbish.aliases.delete(name)

    Removes an alias.

    Parameters diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.completions/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.completions/index.html index dd309c4..ec1f6ab 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.completions/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.completions/index.html @@ -3,8 +3,7 @@

    Module hilbish.completions

    tab completions

    Introduction

    The completions interface deals with tab completions.

    Functions -

    call(name, query, ctx, fields) -> completionGroups (table), prefix (string)Calls a completer function. This is mainly used to call
    handler(line, pos)The handler function is the callback for tab completion in Hilbish.
    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) +

    call(name, query, ctx, fields) -> completionGroups (table), prefix (string)Calls a completer function. This is mainly used to call
    handler(line, pos)The handler function is the callback for tab completion in Hilbish.
    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.

    hilbish.completions.call(name, query, ctx, fields) -> completionGroups (table), prefix (string)

    Calls a completer function. This is mainly used to call a command completer, which will have a name in the form of command.name, example: command.git. diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.editor/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.editor/index.html index b0f8466..4312acf 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.editor/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.editor/index.html @@ -4,8 +4,7 @@

    Module hilbish.editor

    interactions for Hilbish's line reader

    Introduction

    The hilbish.editor interface provides functions to directly interact with the line editor in use.

    Functions -

    getLine() -> stringReturns the current input line.
    getVimRegister(register) -> stringReturns the text that is at the register.
    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 +

    getLine() -> stringReturns the current input line.
    getVimRegister(register) -> stringReturns the text that is at the register.
    insert(text)Inserts text into the line.
    setVimRegister(register, text)Sets the vim register at register to hold the passed text.

    hilbish.editor.getLine() -> string

    Returns the current input line.

    Parameters

    This function has no parameters.


    hilbish.editor.getVimRegister(register) -> string

    Returns the text that is at the register.

    Parameters diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.history/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.history/index.html index 1b8fc06..7cfd05b 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.history/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.history/index.html @@ -5,8 +5,7 @@

    The history interface deals with command history. This includes the ability to override functions to change the main method of saving history.

    Functions -

    add(cmd)Adds a command to the history.
    all() -> tableRetrieves all history.
    clear()Deletes all commands from the history.
    get(idx)Retrieves a command from the history based on the idx.
    size() -> numberReturns the amount of commands in the history.

    Functions -


    hilbish.history.add(cmd) +

    add(cmd)Adds a command to the history.
    all() -> tableRetrieves all history.
    clear()Deletes all commands from the history.
    get(idx)Retrieves a command from the history based on the idx.
    size() -> numberReturns the amount of commands in the history.

    hilbish.history.add(cmd)

    Adds a command to the history.

    Parameters

    This function has no parameters.


    hilbish.history.all() -> table

    Retrieves all history.

    Parameters diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/index.html index 24f7235..3c2ccfe 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/index.html @@ -4,8 +4,7 @@

    Module hilbish.jobs

    background job management

    Introduction

    Manage interactive jobs in Hilbish via Lua.

    Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners.

    Functions -

    add(cmdstr, args, execPath)Adds a new job to the job table. Note that this does not immediately run it.
    all() -> table<@Job>Returns a table of all job objects.
    disown(id)Disowns a job. This deletes it from the job table.
    get(id) -> @JobGet a job object via its ID.
    last() -> @JobReturns the last added job from the table.

    Functions -


    hilbish.jobs.add(cmdstr, args, execPath) +

    add(cmdstr, args, execPath)Adds a new job to the job table. Note that this does not immediately run it.
    all() -> table<@Job>Returns a table of all job objects.
    disown(id)Disowns a job. This deletes it from the job table.
    get(id) -> @JobGet a job object via its ID.
    last() -> @JobReturns the last added job from the table.

    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.all() -> table\<Job>

    Returns a table of all job objects.

    Parameters diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.runner/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.runner/index.html index d2edda0..248dd12 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.runner/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.runner/index.html @@ -7,8 +7,7 @@ how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel.

    Functions -

    setMode(cb)This is the same as the hilbish.runnerMode function. It takes a callback,
    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) +

    setMode(cb)This is the same as the hilbish.runnerMode function. It takes a callback,
    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.

    hilbish.runner.setMode(cb)

    This is the same as the hilbish.runnerMode function. It takes a callback, which will be used to execute all interactive input. In normal cases, neither callbacks should be overrided by the user, diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.timers/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.timers/index.html index e9a6e79..006c410 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.timers/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.timers/index.html @@ -15,8 +15,7 @@ t:start() print(t.running) // true

    Functions

    create(type, time, callback) -> @TimerCreates a timer that runs based on the specified time in milliseconds.
    get(id) -> @TimerRetrieves a timer via its ID.

    Static module fields -

    INTERVALConstant for an interval timer type
    TIMEOUTConstant for a timeout timer type

    Functions -


    hilbish.timers.create(type, time, callback) -> Timer +

    INTERVALConstant for an interval timer type
    TIMEOUTConstant for a timeout timer type

    hilbish.timers.create(type, time, callback) -> Timer

    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.


    hilbish.timers.get(id) -> Timer diff --git a/versions/doc-improvements/docs/api/hilbish/index.html b/versions/doc-improvements/docs/api/hilbish/index.html index c7112da..64d5656 100644 --- a/versions/doc-improvements/docs/api/hilbish/index.html +++ b/versions/doc-improvements/docs/api/hilbish/index.html @@ -5,8 +5,7 @@

    The Hilbish module includes the core API, containing interfaces and functions which directly relate to shell functionality.

    Functions

    alias(cmd, orig)Sets an alias of cmd to orig
    appendPath(dir)Appends dir to $PATH
    complete(scope, cb)Registers a completion handler for scope.
    cwd() -> stringReturns the current directory of the shell
    exec(cmd)Replaces running hilbish with cmd
    goro(fn)Puts fn in a goroutine
    highlighter(line)Line highlighter handler. This is mainly for syntax highlighting, but in
    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. Accepts either emacs or vim
    interval(cb, time) -> @TimerRuns the cb function every time milliseconds.
    multiprompt(str)Changes the continued line prompt to str
    prependPath(dir)Prepends dir to $PATH
    prompt(str, typ)Changes the shell prompt to str
    read(prompt) -> input (string)Read input from the user, using Hilbish’s line editor/input reader.
    run(cmd, returnOut) -> exitCode (number), stdout (string), stderr (string)Runs cmd in Hilbish’s sh interpreter.
    runnerMode(mode)Sets the execution/runner mode for interactive Hilbish. This determines whether
    timeout(cb, time) -> @TimerRuns the cb function after time in milliseconds.
    which(name) -> stringChecks if name is a valid command.

    Static module fields -

    verThe version of Hilbish
    goVersionThe version of Go that Hilbish was compiled with
    userUsername of the user
    hostHostname of the machine
    dataDirDirectory for Hilbish data files, including the docs and default modules
    interactiveIs Hilbish in an interactive shell?
    loginIs Hilbish the login shell?
    vimModeCurrent Vim input mode of Hilbish (will be nil if not in Vim input mode)
    exitCodexit code of the last executed command

    Functions -


    hilbish.alias(cmd, orig) +

    verThe version of Hilbish
    goVersionThe version of Go that Hilbish was compiled with
    userUsername of the user
    hostHostname of the machine
    dataDirDirectory for Hilbish data files, including the docs and default modules
    interactiveIs Hilbish in an interactive shell?
    loginIs Hilbish the login shell?
    vimModeCurrent Vim input mode of Hilbish (will be nil if not in Vim input mode)
    exitCodexit code of the last executed command

    hilbish.alias(cmd, orig)

    Sets an alias of cmd to orig

    Parameters

    This function has no parameters.


    hilbish.appendPath(dir)

    Appends dir to $PATH

    Parameters diff --git a/versions/doc-improvements/docs/api/hilbish/index.xml b/versions/doc-improvements/docs/api/hilbish/index.xml index 1d9ccfd..38087ba 100644 --- a/versions/doc-improvements/docs/api/hilbish/index.xml +++ b/versions/doc-improvements/docs/api/hilbish/index.xml @@ -1,9 +1,10 @@ Module hilbish on Hilbishhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/Recent content in Module hilbish on HilbishHugo -- gohugo.ioen-usModule hilbish.aliaseshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/Introduction The alias interface deals with all command aliases in Hilbish. -Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&gt; table&lt;string, string&gt; Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&gt; command (string) Tries to resolve an alias to its command. Functions hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.Module hilbish.completionshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Introduction The completions interface deals with tab completions. +Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&gt; table&lt;string, string&gt; Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&gt; command (string) Tries to resolve an alias to its command. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.Module hilbish.completionshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Introduction The completions interface deals with tab completions. Functions call(name, query, ctx, fields) -&gt; completionGroups (table), prefix (string) Calls a completer function. This is mainly used to call handler(line, pos) The handler function is the callback for tab completion in Hilbish. bins(query, ctx, fields) -&gt; entries (table), prefix (string) Returns binary/executale completion candidates based on the provided query. files(query, ctx, fields) -&gt; entries (table), prefix (string) Returns file completion candidates based on the provided query.Module hilbish.editorhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/Introduction The hilbish.editor interface provides functions to directly interact with the line editor in use. -Functions getLine() -&gt; string Returns the current input line. getVimRegister(register) -&gt; string Returns the text that is at the register. 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 Returns the current input line. -Parameters This function has no parameters.Module hilbish.historyhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history. -Functions add(cmd) Adds a command to the history. all() -&gt; table Retrieves all history. clear() Deletes all commands from the history. get(idx) Retrieves a command from the history based on the idx. size() -&gt; number Returns the amount of commands in the history. Functions hilbish.history.add(cmd) Adds a command to the history.Module hilbish.jobshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Introduction Manage interactive jobs in Hilbish via Lua. +Functions getLine() -&gt; string Returns the current input line. getVimRegister(register) -&gt; string Returns the text that is at the register. insert(text) Inserts text into the line. setVimRegister(register, text) Sets the vim register at register to hold the passed text. hilbish.editor.getLine() -> string Returns the current input line. +Parameters This function has no parameters. +hilbish.editor.getVimRegister(register) -> string Returns the text that is at the register.Module hilbish.historyhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history. +Functions add(cmd) Adds a command to the history. all() -&gt; table Retrieves all history. clear() Deletes all commands from the history. get(idx) Retrieves a command from the history based on the idx. size() -&gt; number Returns the amount of commands in the history. hilbish.history.add(cmd) Adds a command to the history.Module hilbish.jobshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Introduction Manage interactive jobs in Hilbish via Lua. Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners. Functions add(cmdstr, args, execPath) Adds a new job to the job table. Note that this does not immediately run it. all() -&gt; table&lt;@Job&gt; Returns a table of all job objects. disown(id) Disowns a job. This deletes it from the job table.Module hilbish.oshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/ Introduction The os interface provides simple text information properties about the current OS on the systen. This mainly includes the name and version. Static module fields family Family name of the current OS name Pretty name of the current OS version Version of the current OSModule hilbish.runnerhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/Introduction The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel. diff --git a/versions/doc-improvements/docs/api/index.xml b/versions/doc-improvements/docs/api/index.xml index d419c34..b94c479 100644 --- a/versions/doc-improvements/docs/api/index.xml +++ b/versions/doc-improvements/docs/api/index.xml @@ -2,5 +2,5 @@ Usage of the Bait module consists of userstanding event-driven architecture, but it&rsquo;s pretty simple: If you want to act on a certain event, you can catch it. You can act on events via callback functions.Module commanderhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/Introduction Commander is a library for writing custom commands in Lua. In order to make it easier to write commands for Hilbish, not require separate scripts and to be able to use in a config, the Commander library exists. This is like a very simple wrapper that works with Hilbish for writing commands. Example: local commander = require &#39;commander&#39; commander.register(&#39;hello&#39;, function(args, sinks) sinks.out:writeln &#39;Hello world!&#39; end) In this example, a command with the name of hello is created that will print Hello world!Module fshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/Introduction The fs module provides easy and simple access to filesystem functions and other things, and acts an addition to the Lua standard library&rsquo;s I/O and filesystem functions. Functions abs(path) -&gt; string Gives an absolute version of path. basename(path) -&gt; string Gives the basename of path. For the rules, cd(dir) Changes directory to dir dir(path) -&gt; string Returns the directory part of path. For the rules, see Go&rsquo;s glob(pattern) -&gt; matches (table) Glob all files and directories that match the pattern.Module terminalhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/Introduction The terminal library is a simple and lower level library for certain terminal interactions. -Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal setRaw() Puts the terminal in raw mode size() Gets the dimensions of the terminal. Returns a table with width and height Functions terminal.restoreState() Restores the last saved state of the terminal +Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal setRaw() Puts the terminal in raw mode size() Gets the dimensions of the terminal. Returns a table with width and height terminal.restoreState() Restores the last saved state of the terminal Parameters This function has no parameters. \ No newline at end of file diff --git a/versions/doc-improvements/docs/api/terminal/index.html b/versions/doc-improvements/docs/api/terminal/index.html index 4d4e9b0..2b606fa 100644 --- a/versions/doc-improvements/docs/api/terminal/index.html +++ b/versions/doc-improvements/docs/api/terminal/index.html @@ -3,8 +3,7 @@

    Module terminal

    low level terminal library

    Introduction

    The terminal library is a simple and lower level library for certain terminal interactions.

    Functions -

    restoreState()Restores the last saved state of the terminal
    saveState()Saves the current state of the terminal
    setRaw()Puts the terminal in raw mode
    size()Gets the dimensions of the terminal. Returns a table with width and height

    Functions -


    terminal.restoreState() +

    restoreState()Restores the last saved state of the terminal
    saveState()Saves the current state of the terminal
    setRaw()Puts the terminal in raw mode
    size()Gets the dimensions of the terminal. Returns a table with width and height

    terminal.restoreState()

    Restores the last saved state of the terminal

    Parameters

    This function has no parameters.


    terminal.saveState()

    Saves the current state of the terminal

    Parameters diff --git a/versions/doc-improvements/index.xml b/versions/doc-improvements/index.xml index 096d0bc..8439722 100644 --- a/versions/doc-improvements/index.xml +++ b/versions/doc-improvements/index.xml @@ -18,18 +18,19 @@ For the latest stable release, check here: https://github.com/Rosettea/Hilbish/r Usage of the Bait module consists of userstanding event-driven architecture, but it&rsquo;s pretty simple: If you want to act on a certain event, you can catch it. You can act on events via callback functions.Module commanderhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/Introduction Commander is a library for writing custom commands in Lua. In order to make it easier to write commands for Hilbish, not require separate scripts and to be able to use in a config, the Commander library exists. This is like a very simple wrapper that works with Hilbish for writing commands. Example: local commander = require &#39;commander&#39; commander.register(&#39;hello&#39;, function(args, sinks) sinks.out:writeln &#39;Hello world!&#39; end) In this example, a command with the name of hello is created that will print Hello world!Module fshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/Introduction The fs module provides easy and simple access to filesystem functions and other things, and acts an addition to the Lua standard library&rsquo;s I/O and filesystem functions. Functions abs(path) -&gt; string Gives an absolute version of path. basename(path) -&gt; string Gives the basename of path. For the rules, cd(dir) Changes directory to dir dir(path) -&gt; string Returns the directory part of path. For the rules, see Go&rsquo;s glob(pattern) -&gt; matches (table) Glob all files and directories that match the pattern.Module hilbish.aliaseshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/Introduction The alias interface deals with all command aliases in Hilbish. -Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&gt; table&lt;string, string&gt; Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&gt; command (string) Tries to resolve an alias to its command. Functions hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.Module hilbish.completionshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Introduction The completions interface deals with tab completions. +Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&gt; table&lt;string, string&gt; Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&gt; command (string) Tries to resolve an alias to its command. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.Module hilbish.completionshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completions/Introduction The completions interface deals with tab completions. Functions call(name, query, ctx, fields) -&gt; completionGroups (table), prefix (string) Calls a completer function. This is mainly used to call handler(line, pos) The handler function is the callback for tab completion in Hilbish. bins(query, ctx, fields) -&gt; entries (table), prefix (string) Returns binary/executale completion candidates based on the provided query. files(query, ctx, fields) -&gt; entries (table), prefix (string) Returns file completion candidates based on the provided query.Module hilbish.editorhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/Introduction The hilbish.editor interface provides functions to directly interact with the line editor in use. -Functions getLine() -&gt; string Returns the current input line. getVimRegister(register) -&gt; string Returns the text that is at the register. 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 Returns the current input line. -Parameters This function has no parameters.Module hilbish.historyhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history. -Functions add(cmd) Adds a command to the history. all() -&gt; table Retrieves all history. clear() Deletes all commands from the history. get(idx) Retrieves a command from the history based on the idx. size() -&gt; number Returns the amount of commands in the history. Functions hilbish.history.add(cmd) Adds a command to the history.Module hilbish.jobshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Introduction Manage interactive jobs in Hilbish via Lua. +Functions getLine() -&gt; string Returns the current input line. getVimRegister(register) -&gt; string Returns the text that is at the register. insert(text) Inserts text into the line. setVimRegister(register, text) Sets the vim register at register to hold the passed text. hilbish.editor.getLine() -> string Returns the current input line. +Parameters This function has no parameters. +hilbish.editor.getVimRegister(register) -> string Returns the text that is at the register.Module hilbish.historyhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history. +Functions add(cmd) Adds a command to the history. all() -&gt; table Retrieves all history. clear() Deletes all commands from the history. get(idx) Retrieves a command from the history based on the idx. size() -&gt; number Returns the amount of commands in the history. hilbish.history.add(cmd) Adds a command to the history.Module hilbish.jobshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/Introduction Manage interactive jobs in Hilbish via Lua. Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners. Functions add(cmdstr, args, execPath) Adds a new job to the job table. Note that this does not immediately run it. all() -&gt; table&lt;@Job&gt; Returns a table of all job objects. disown(id) Disowns a job. This deletes it from the job table.Module hilbish.oshttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/ Introduction The os interface provides simple text information properties about the current OS on the systen. This mainly includes the name and version. Static module fields family Family name of the current OS name Pretty name of the current OS version Version of the current OSModule hilbish.runnerhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/Introduction The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel. Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, lua(cmd) Evaluates cmd as Lua input. This is the same as using dofile sh(cmd) Runs a command in Hilbish&rsquo;s shell script interpreter.Module hilbish.timershttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don&rsquo;t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts. These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish). But if you want slightly more control over them, there is the hilbish.timers interface. It allows you to get a timer via ID and control them.Module hilbish.userDirhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/ Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user&rsquo;s preferred directories for configs and data. Static module fields config The user&rsquo;s config directory data The user&rsquo;s directory for program dataModule terminalhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/Introduction The terminal library is a simple and lower level library for certain terminal interactions. -Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal setRaw() Puts the terminal in raw mode size() Gets the dimensions of the terminal. Returns a table with width and height Functions terminal.restoreState() Restores the last saved state of the terminal +Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal setRaw() Puts the terminal in raw mode size() Gets the dimensions of the terminal. Returns a table with width and height terminal.restoreState() Restores the last saved state of the terminal Parameters This function has no parameters.Notificationhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/notifications/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/notifications/Hilbish features a simple notification system which can be used by other plugins and parts of the shell to notify the user of various actions. This is used via the hilbish.message interface. A message is defined as a table with the following properties: icon: A unicode/emoji icon for the notification. title: The title of the message text: Message text/body channel: The source of the message. This should be a unique and easily readable text identifier.Runner Modehttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/runner-mode/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/runner-mode/Hilbish allows you to change how interactive text can be interpreted. This is mainly due to the fact that the default method Hilbish uses is that it runs Lua first and then falls back to shell script.