diff --git a/docs/faq/index.html b/docs/faq/index.html index 09a0566..eaf6cba 100644 --- a/docs/faq/index.html +++ b/docs/faq/index.html @@ -6,7 +6,7 @@ Where is the API documentation?" name=description>
No, it is not. POSIX compliance is a non-goal. Perhaps in the future, +
No, it is not. POSIX compliance is a non-goal. Perhaps in the future, someone would be able to write a native plugin to support shell scripting (which would be against it’s main goal, but ….)
It compiles for Windows (CI ensures it does), but otherwise it is not directly supported. If you’d like to improve this situation, diff --git a/docs/features/index.html b/docs/features/index.html new file mode 100644 index 0000000..e4c3025 --- /dev/null +++ b/docs/features/index.html @@ -0,0 +1,5 @@ +
Customize the interactive script/command runner.
Hilbish is unique, when interactive it first attempts to run input as +Lua and then tries shell script. But if you’re normal, you wouldn’t +really be using Hilbish anyway but you’d also not want this +(or maybe want Lua only in some cases.)
The “runner mode” of Hilbish is customizable via hilbish.runnerMode
,
+which determines how Hilbish will run user input. By default, this is
+set to hybrid
which is the previously mentioned behaviour of running Lua
+first then going to shell script. If you want the reverse order, you can
+set it to hybridRev
and for isolated modes there is sh
and lua
+respectively.
You can also set it to a function, which will be called everytime Hilbish +needs to run interactive input. For example, you can set this to a simple +function to compile and evaluate Fennel, and now you can run Fennel. +You can even mix it with sh to make a hybrid mode with Lua replaced by +Fennel.
An example:
hilbish.runnerMode(function(input)
+ local ok = pcall(fennel.eval, input)
+ if ok then
+ return input, 0, nil
+ end
+
+ return hilbish.runner.sh(input)
+end)
+
The hilbish.runner
interface is an alternative to using hilbish.runnerMode
+and also provides the sh and Lua runner functions that Hilbish itself uses.
+A runner function is expected to return 3 values: the input, exit code, and an error.
+The input return is there incase you need to prompt for more input.
+If you don’t, just return the input passed to the runner function.
+The exit code has to be a number, it will be 0 otherwise and the error can be
+nil
to indicate no error.
These are the “low level” functions for the hilbish.runner
interface.
hilbish.runnerMode
input
in Hilbish’s sh interpreterinput
as Lua codeThe others here are defined in Lua and have EmmyLua documentation. +These functions should be preferred over the previous ones.
setMode
, but works with runners managed
+via the functions below.runner
+argument is either a function or a table with a run callback.add
but requires passing a table and
+overwrites if the name
d runner already exists.cmd
with a runner. If runnerName
isn’t passed,
+the current runner mode is used.To start Hilbish, open a terminal. If Hilbish has been installed and is not the +
To start Hilbish, open a terminal. If Hilbish has been installed and is not the
default shell, you can simply run hilbish
to start it. This will launch
a normal interactive session.
To exit, you can either run the exit
command or hit Ctrl+D.
There are a few ways to make Hilbish your default shell. A simple way is diff --git a/docs/index.html b/docs/index.html index 9d47344..6a294bf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@ Completion and history search menus Hinting and syntax highlighting (scripted by
Here lies the documentation for Hilbish, the hyper extensible Lua shell.
Hilbish provides you with a few quality of life features and useful
+
Here lies the documentation for Hilbish, the hyper extensible Lua shell.
Hilbish provides you with a few quality of life features and useful
functions to ensure you can make the shell fully yours.
These features include:
Steps on installing Hilbish will be at the Install page in the navigation bar at the top. This also included getting development builds from the GitHub repository.