From 804e303bb829ec4bd404caee2e585e77413f86c2 Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Sat, 2 Dec 2023 12:24:04 +0000 Subject: [PATCH] deploy: f40ce3c8f71f54cbd722d562c83ed2f1c1d66f4a --- .../doc-improvements/docs/api/bait/index.html | 4 +- .../docs/api/commander/index.html | 3 +- .../doc-improvements/docs/api/fs/index.html | 84 ++++++++++++------- .../hilbish/hilbish.completions/index.html | 8 +- .../api/hilbish/hilbish.editor/index.html | 3 +- .../api/hilbish/hilbish.module/index.html | 3 +- .../api/hilbish/hilbish.runner/index.html | 11 +-- .../api/hilbish/hilbish.timers/index.html | 17 ++-- .../docs/api/hilbish/index.html | 55 +++--------- versions/doc-improvements/docs/api/index.xml | 4 +- .../docs/api/terminal/index.html | 3 +- .../docs/getting-started/index.html | 4 +- versions/doc-improvements/index.xml | 4 +- versions/doc-improvements/install/index.html | 18 ++-- 14 files changed, 99 insertions(+), 122 deletions(-) diff --git a/versions/doc-improvements/docs/api/bait/index.html b/versions/doc-improvements/docs/api/bait/index.html index b672271..d3eb9f4 100644 --- a/versions/doc-improvements/docs/api/bait/index.html +++ b/versions/doc-improvements/docs/api/bait/index.html @@ -27,9 +27,7 @@ this function will set the user prompt.

Functi

string name
The name of the event

function cb
The function that will be called when the event is thrown.


bait.hooks(name) -> table

Returns a list of callbacks that are hooked on an event with the corresponding name.

Parameters

string name
The name of the function


bait.release(name, catcher) -

Removes the catcher for the event with name. -For this to work, catcher has to be the same function used to catch -an event, like one saved to a variable.

Parameters +

Removes the catcher for the event with name.
For this to work, catcher has to be the same function used to catch
an event, like one saved to a variable.

Parameters

string name
Name of the event the hook is on

function catcher
Hook function to remove

Example
1local hookCallback = function() print 'hi' end
 2
diff --git a/versions/doc-improvements/docs/api/commander/index.html b/versions/doc-improvements/docs/api/commander/index.html
index 582a5f8..e11ebd0 100644
--- a/versions/doc-improvements/docs/api/commander/index.html
+++ b/versions/doc-improvements/docs/api/commander/index.html
@@ -20,8 +20,7 @@ This sink is for writing errors, as the name would suggest.
deregister(name)Removes the named command. Note that this will only remove Commander-registered commands.
register(name, cb)Adds a new command with the given name. When Hilbish has to run a command with a name,

commander.deregister(name)

Removes the named command. Note that this will only remove Commander-registered commands.

Parameters

string name
Name of the command to remove.


commander.register(name, cb) -

Adds a new command with the given name. When Hilbish has to run a command with a name, -it will run the function providing the arguments and sinks.

Parameters +

Adds a new command with the given name. When Hilbish has to run a command with a name,
it will run the function providing the arguments and sinks.

Parameters

string name
Name of the command

function cb
Callback to handle command invocation

Example
1-- When you run the command `hello` in the shell, it will print `Hello world`.
 2-- If you run it with, for example, `hello Hilbish`, it will print 'Hello Hilbish'
diff --git a/versions/doc-improvements/docs/api/fs/index.html b/versions/doc-improvements/docs/api/fs/index.html
index 07b211d..1077634 100644
--- a/versions/doc-improvements/docs/api/fs/index.html
+++ b/versions/doc-improvements/docs/api/fs/index.html
@@ -2,34 +2,56 @@
 

Module fs

filesystem interaction and functionality library

Introduction -

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.

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, -see Go’s filepath.Base

Parameters -

This function has no parameters.


fs.cd(dir) -

Changes directory to dir

Parameters -

This function has no parameters.


fs.dir(path) -> string -

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

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 -

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

Makes a directory called name. If recursive is true, it will create its parent directories.

Parameters -

This function has no parameters.


fs.readdir(dir) -> {} -

Returns a table of files in dir.

Parameters -

This function has no parameters.


fs.stat(path) -> {} -

Returns a table of info about the path. -It contains the following keys: -name (string) - Name of the path -size (number) - Size of the path -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 +

The fs module provides filesystem functions to Hilbish. While Lua’s standard +library has some I/O functions, they’re missing a lot of the basics. The fs +library offers more functions and will work on any operating system Hilbish does.

Functions +

abs(path) -> stringReturns an absolute version of the path.
basename(path) -> stringReturns the “basename,” or the last part of the provided path. If path is empty,
cd(dir)Changes Hilbish’s directory to dir.
dir(path) -> stringReturns the directory part of path. If a file path like
glob(pattern) -> matches (table)Match all files based on the provided pattern.
join(…path) -> stringTakes any list of paths and joins them based on the operating system’s path separator.
mkdir(name, recursive)Creates a new directory with the provided name.
readdir(path) -> table[string]Returns a list of all files and directories in the provided path.
stat(path) -> {}Returns the information about a given path.

Static module fields +

pathSepThe operating system’s path separator.

fs.abs(path) -> string +

Returns an absolute version of the path.
This can be used to resolve short paths like .. to /home/user.

Parameters +

string path


fs.basename(path) -> string +

Returns the “basename,” or the last part of the provided path. If path is empty,
. will be returned.

Parameters +

string path
Path to get the base name of.


fs.cd(dir) +

Changes Hilbish’s directory to dir.

Parameters +

string dir
Path to change directory to.


fs.dir(path) -> string +

Returns the directory part of path. If a file path like
~/Documents/doc.txt then this function will return ~/Documents.

Parameters +

string path
Path to get the directory for.


fs.glob(pattern) -> matches (table) +

Match all files based on the provided pattern.
For the syntax’ refer to Go’s filepath.Match function: https://pkg.go.dev/path/filepath#Match

Parameters +

string pattern
Pattern to compare files with.

Example +
 1--[[
+ 2	Within a folder that contains the following files:
+ 3	a.txt
+ 4	init.lua
+ 5	code.lua
+ 6	doc.pdf
+ 7]]--
+ 8local matches = fs.glob './*.lua'
+ 9print(matches)
+10-- -> {'init.lua', 'code.lua'}
+

fs.join(...path) -> string +

Takes any list of paths and joins them based on the operating system’s path separator.

Parameters +

string path (This type is variadic. You can pass an infinite amount of parameters with this type.)
Paths to join together

Example +
1-- This prints the directory for Hilbish's config!
+2print(fs.join(hilbish.userDir.config, 'hilbish'))
+3-- -> '/home/user/.config/hilbish' on Linux
+

fs.mkdir(name, recursive) +

Creates a new directory with the provided name.
With recursive, mkdir will create parent directories.

– This will create the directory foo, then create the directory bar in the
– foo directory. If recursive is false in this case, it will fail.
fs.mkdir(’./foo/bar’, true)

Parameters +

string name
Name of the directory

boolean recursive
Whether to create parent directories for the provided name

Example +

fs.readdir(path) -> table[string] +

Returns a list of all files and directories in the provided path.

Parameters +

string dir


fs.stat(path) -> {} +

Returns the information about a given path.
The returned table contains the following values:
name (string) - Name of the path
size (number) - Size of the path in bytes
mode (string) - Unix permission mode in an octal format string (with leading 0)
isDir (boolean) - If the path is a directory

Parameters +

string path

Example +
 1local inspect = require 'inspect'
+ 2
+ 3local stat = fs.stat '~'
+ 4print(inspect(stat))
+ 5--[[
+ 6Would print the following:
+ 7{
+ 8  isDir = true,
+ 9  mode = "0755",
+10  name = "username",
+11  size = 12288
+12}
+13]]--
+
\ No newline at end of file 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 0397ca5..606ea0d 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.completions/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.completions/index.html @@ -4,13 +4,9 @@

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.

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. -You can check doc completions for info on the completionGroups return value.

Parameters +

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.
You can check doc completions for info on the completionGroups return value.

Parameters

This function has no parameters.


hilbish.completions.handler(line, pos) -

The handler function is the callback for tab completion in Hilbish. -You can check the completions doc for more info.

Parameters +

The handler function is the callback for tab completion in Hilbish.
You can check the completions doc for more info.

Parameters

This function has no parameters.


hilbish.completions.bins(query, ctx, fields) -> entries (table), prefix (string)

Returns binary/executale completion candidates based on the provided query.

Parameters

This function has no parameters.


hilbish.completions.files(query, ctx, fields) -> entries (table), prefix (string) 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 47c15da..ded8c3b 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.editor/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.editor/index.html @@ -11,8 +11,7 @@ directly interact with the line editor in use.

This function has no parameters.


hilbish.editor.insert(text)

Inserts text into the line.

Parameters

This function has no parameters.


hilbish.editor.getChar() -> string -

Reads a keystroke from the user. This is in a format -of something like Ctrl-L..

Parameters +

Reads a keystroke from the user. This is in a format
of something like Ctrl-L..

Parameters

This function has no parameters.


hilbish.editor.setVimRegister(register, text)

Sets the vim register at register to hold the passed text.

Parameters

This function has no parameters.

\ No newline at end of file diff --git a/versions/doc-improvements/docs/api/hilbish/hilbish.module/index.html b/versions/doc-improvements/docs/api/hilbish/hilbish.module/index.html index 61437da..dbfcca5 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.module/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.module/index.html @@ -24,6 +24,5 @@ it to use it for a native plugin.

Here is some code for an example plugin: If you attempt to require and print the result (print(require 'plugin')), it will show “hello world!”

Functions

load(path)Loads a module at the designated path.

Static module fields

pathsA list of paths to search when loading native modules. This is in the style of Lua search paths and will be used when requiring native modules. Example: ?.so;?/?.so

hilbish.module.load(path) -

Loads a module at the designated path. -It will throw if any error occurs.

Parameters +

Loads a module at the designated path.
It will throw if any error occurs.

Parameters

This function has no parameters.

\ No newline at end of file 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 a488f7d..013b496 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.runner/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.runner/index.html @@ -8,14 +8,9 @@ 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.

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, -as the higher level functions listed below this will handle it.

Parameters +

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,
as the higher level functions listed below this will handle it.

Parameters

This function has no parameters.


hilbish.runner.lua(cmd) -

Evaluates cmd as Lua input. This is the same as using dofile -or load, but is appropriated for the runner interface.

Parameters +

Evaluates cmd as Lua input. This is the same as using dofile
or load, but is appropriated for the runner interface.

Parameters

This function has no parameters.


hilbish.runner.sh(cmd) -

Runs a command in Hilbish’s shell script interpreter. -This is the equivalent of using source.

Parameters +

Runs a command in Hilbish’s shell script interpreter.
This is the equivalent of using source.

Parameters

This function has no parameters.

\ No newline at end of file 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 462d684..eccdd5c 100644 --- a/versions/doc-improvements/docs/api/hilbish/hilbish.timers/index.html +++ b/versions/doc-improvements/docs/api/hilbish/hilbish.timers/index.html @@ -7,17 +7,16 @@ a few seconds, you don’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.

All functions documented with the Timer type refer to a Timer object.

An example of usage:

local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function()
-	print 'hello!'
-end)
-
-t:start()
-print(t.running) // true
-

Functions +a timer via ID and control them.

All functions documented with the Timer type refer to a Timer object.

An example of usage:

1local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function()
+2	print 'hello!'
+3end)
+4
+5t:start()
+6print(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

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 +

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

Retrieves a timer via its ID.

Parameters

This function has no parameters.

Types diff --git a/versions/doc-improvements/docs/api/hilbish/index.html b/versions/doc-improvements/docs/api/hilbish/index.html index bca386c..33b1a0c 100644 --- a/versions/doc-improvements/docs/api/hilbish/index.html +++ b/versions/doc-improvements/docs/api/hilbish/index.html @@ -10,11 +10,7 @@ interfaces and functions which directly relate to shell functionality.

This function has no parameters.


hilbish.appendPath(dir)

Appends dir to $PATH

Parameters

This function has no parameters.


hilbish.complete(scope, cb) -

Registers a completion handler for scope. -A scope is currently only expected to be command.<cmd>, -replacing with the name of the command (for example command.git). -cb must be a function that returns a table of “completion groups.” -Check doc completions for more information.

Parameters +

Registers a completion handler for scope.
A scope is currently only expected to be command.<cmd>,
replacing with the name of the command (for example command.git).
cb must be a function that returns a table of “completion groups.”
Check doc completions for more information.

Parameters

This function has no parameters.


hilbish.cwd() -> string

Returns the current directory of the shell

Parameters

This function has no parameters.


hilbish.exec(cmd) @@ -22,57 +18,32 @@ Check doc completions for more information.

This function has no parameters.


hilbish.goro(fn)

Puts fn in a goroutine

Parameters

This function has no parameters.


hilbish.highlighter(line) -

Line highlighter handler. This is mainly for syntax highlighting, but in -reality could set the input of the prompt to display anything. The -callback is passed the current line and is expected to return a line that -will be used as the input display. -Note that to set a highlighter, one has to override this function. -Example:

function hilbish.highlighter(line)
-   return line:gsub('"%w+"', function(c) return lunacolors.green(c) end)
-end
-

This code will highlight all double quoted strings in green.

Parameters +

Line highlighter handler. This is mainly for syntax highlighting, but in
reality could set the input of the prompt to display anything. The
callback is passed the current line and is expected to return a line that
will be used as the input display.
Note that to set a highlighter, one has to override this function.
Example:

1function hilbish.highlighter(line)  
+2   return line:gsub('"%w+"', function(c) return lunacolors.green(c) end)  
+3end  
+

This code will highlight all double quoted strings in green.

Parameters

This function has no parameters.


hilbish.hinter(line, pos) -

The command line hint handler. It gets called on every key insert to -determine what text to use as an inline hint. It is passed the current -line and cursor position. It is expected to return a string which is used -as the text for the hint. This is by default a shim. To set hints, -override this function with your custom handler.

Parameters +

The command line hint handler. It gets called on every key insert to
determine what text to use as an inline hint. It is passed the current
line and cursor position. It is expected to return a string which is used
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)

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 -

Runs the cb function every time milliseconds. -This creates a timer that starts immediately.

Parameters +

Runs the cb function every time milliseconds.
This creates a timer that starts immediately.

Parameters

This function has no parameters.


hilbish.multiprompt(str)

Changes the continued line prompt to str

Parameters

This function has no parameters.


hilbish.prependPath(dir)

Prepends dir to $PATH

Parameters

This function has no parameters.


hilbish.prompt(str, typ) -

Changes the shell prompt to str -There are a few verbs that can be used in the prompt text. -These will be formatted and replaced with the appropriate values. -%d - Current working directory -%u - Name of current user -%h - Hostname of device

Parameters +

Changes the shell prompt to str
There are a few verbs that can be used in the prompt text.
These will be formatted and replaced with the appropriate values.
%d - Current working directory
%u - Name of current user
%h - Hostname of device

Parameters

This function has no parameters.


hilbish.read(prompt) -> input (string) -

Read input from the user, using Hilbish’s line editor/input reader. -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 +

Read input from the user, using Hilbish’s line editor/input reader.
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) -

Runs cmd in Hilbish’s sh interpreter. -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 +

Runs cmd in Hilbish’s sh interpreter.
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) -

Sets the execution/runner mode for interactive Hilbish. This determines whether -Hilbish wll try to run input as Lua and/or sh or only do one of either. -Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua), -sh, and lua. It also accepts a function, to which if it is passed one -will call it to execute user input instead.

Parameters +

Sets the execution/runner mode for interactive Hilbish. This determines whether
Hilbish wll try to run input as Lua and/or sh or only do one of either.
Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua),
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 -

Runs the cb function after time in milliseconds. -This creates a timer that starts immediately.

Parameters +

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 -

Checks if name is a valid command. -Will return the path of the binary, or a basename if it’s a commander.

Parameters +

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.

Types


Sink

A sink is a structure that has input and/or output to/from diff --git a/versions/doc-improvements/docs/api/index.xml b/versions/doc-improvements/docs/api/index.xml index 8a03c20..d41d045 100644 --- a/versions/doc-improvements/docs/api/index.xml +++ b/versions/doc-improvements/docs/api/index.xml @@ -1,6 +1,6 @@ API on Hilbishhttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/Recent content in API on HilbishHugo -- gohugo.ioen-usModule baithttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/bait/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/bait/Introduction Bait is the event emitter for Hilbish. Much like Node.js and its events system, many actions in Hilbish emit events. Unlike Node.js, Hilbish events are global. So make sure to pick a unique name! 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 the library which handles Hilbish commands. This makes the user able to add Lua-written commands to their shell without making a separate script in a bin folder. Instead, you may simply use the Commander library in your Hilbish config. -1local commander = require &#39;commander&#39; 2 3commander.register(&#39;hello&#39;, function(args, sinks) 4 sinks.out:writeln &#39;Hello world!&#39; 5end) 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. +1local commander = require &#39;commander&#39; 2 3commander.register(&#39;hello&#39;, function(args, sinks) 4 sinks.out:writeln &#39;Hello world!&#39; 5end) 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 filesystem functions to Hilbish. While Lua&rsquo;s standard library has some I/O functions, they&rsquo;re missing a lot of the basics. The fs library offers more functions and will work on any operating system Hilbish does. +Functions abs(path) -&gt; string Returns an absolute version of the path. basename(path) -&gt; string Returns the &ldquo;basename,&rdquo; or the last part of the provided path. If path is empty, cd(dir) Changes Hilbish&rsquo;s directory to dir.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 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 95820c7..1474dec 100644 --- a/versions/doc-improvements/docs/api/terminal/index.html +++ b/versions/doc-improvements/docs/api/terminal/index.html @@ -10,6 +10,5 @@

This function has no parameters.


terminal.setRaw()

Puts the terminal in raw mode

Parameters

This function has no parameters.


terminal.size() -

Gets the dimensions of the terminal. Returns a table with width and height -Note: this is not the size in relation to the dimensions of the display

Parameters +

Gets the dimensions of the terminal. Returns a table with width and height
Note: this is not the size in relation to the dimensions of the display

Parameters

This function has no parameters.

\ No newline at end of file diff --git a/versions/doc-improvements/docs/getting-started/index.html b/versions/doc-improvements/docs/getting-started/index.html index 84b7dea..5544f8b 100644 --- a/versions/doc-improvements/docs/getting-started/index.html +++ b/versions/doc-improvements/docs/getting-started/index.html @@ -18,8 +18,8 @@ When prompted, you can put the path for Hilbish.

The simpler way is to set the default shell for your terminal. The way of doing this depends on how your terminal settings are configured.

Run after login shell

Some shells (like zsh) have an rc file, like .zlogin, which is ran when the shell session -is a login shell. In that file, you can run Hilbish. Example:

exec hilbish -S -l
-

This will replace the shell with Hilbish, set $SHELL to Hilbish and launch it as a login shell.

Configuration +is a login shell. In that file, you can run Hilbish. Example:

1exec hilbish -S -l
+

This will replace the shell with Hilbish, set $SHELL to Hilbish and launch it as a login shell.

Configuration

Once installation and setup has been done, you can then configure Hilbish. It is configured and scripted via Lua, so the config file is a Lua file. You can use any pure Lua library to do whatever you want.

Hilbish’s sample configuration is usually located in hilbish.dataDir .. '/.hilbishrc.lua'. diff --git a/versions/doc-improvements/index.xml b/versions/doc-improvements/index.xml index 7c878b6..dd0f649 100644 --- a/versions/doc-improvements/index.xml +++ b/versions/doc-improvements/index.xml @@ -32,8 +32,8 @@ hilbish.cancel &gt; Sent when the user cancels their input with Ctrl-C.Module baithttps://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/bait/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/bait/Introduction Bait is the event emitter for Hilbish. Much like Node.js and its events system, many actions in Hilbish emit events. Unlike Node.js, Hilbish events are global. So make sure to pick a unique name! 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 the library which handles Hilbish commands. This makes the user able to add Lua-written commands to their shell without making a separate script in a bin folder. Instead, you may simply use the Commander library in your Hilbish config. -1local commander = require &#39;commander&#39; 2 3commander.register(&#39;hello&#39;, function(args, sinks) 4 sinks.out:writeln &#39;Hello world!&#39; 5end) 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. +1local commander = require &#39;commander&#39; 2 3commander.register(&#39;hello&#39;, function(args, sinks) 4 sinks.out:writeln &#39;Hello world!&#39; 5end) 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 filesystem functions to Hilbish. While Lua&rsquo;s standard library has some I/O functions, they&rsquo;re missing a lot of the basics. The fs library offers more functions and will work on any operating system Hilbish does. +Functions abs(path) -&gt; string Returns an absolute version of the path. basename(path) -&gt; string Returns the &ldquo;basename,&rdquo; or the last part of the provided path. If path is empty, cd(dir) Changes Hilbish&rsquo;s directory to dir.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. 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. getChar() -&gt; string Reads a keystroke from the user. This is in a format setVimRegister(register, text) Sets the vim register at register to hold the passed text. hilbish.editor.getLine() -> string Returns the current input line.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. diff --git a/versions/doc-improvements/install/index.html b/versions/doc-improvements/install/index.html index a45242c..0d0427b 100644 --- a/versions/doc-improvements/install/index.html +++ b/versions/doc-improvements/install/index.html @@ -9,15 +9,15 @@ have breaking changes.

For the latest stable release, che

To read the steps for compiling Hilbish, head over to the GitHub repository.

Package Repositories

Methods of installing Hilbish for your Linux distro.

Fedora (COPR)

An official COPR is offered to install Hilbish easily on Fedora. -Enable the repo:

sudo dnf copr enable sammyette/Hilbish
-

And install Hilbish:

sudo dnf install hilbish
-

Or for the latest development build from master:

sudo dnf install hilbish-git
-

Arch Linux (AUR) +Enable the repo:

1sudo dnf copr enable sammyette/Hilbish
+

And install Hilbish:

1sudo dnf install hilbish
+

Or for the latest development build from master:

1sudo dnf install hilbish-git
+

Arch Linux (AUR)

Hilbish is on the AUR. Setup an AUR helper, and install. -Example with yay:

yay -S hilbish
-

Or, from master branch:

yay -S hilbish-git
-

Alpine Linux +Example with yay:

1yay -S hilbish
+

Or, from master branch:

1yay -S hilbish-git
+

Alpine Linux

Hilbish is currentlty in the testing/edge repository for Alpine. Follow the steps here -(Using testing repositories) and install:

apk add hilbish
-
\ No newline at end of file +(Using testing repositories) and install:

1apk add hilbish
+
\ No newline at end of file