diff --git a/docs/features/index.xml b/docs/features/index.xml index c9a4e66..fdaa448 100644 --- a/docs/features/index.xml +++ b/docs/features/index.xml @@ -1,2 +1,2 @@ -Features on Hilbishhttps://rosettea.github.io/Hilbish/docs/features/Recent content in Features on HilbishHugo -- gohugo.ioen-usRunner Modehttps://rosettea.github.io/Hilbish/docs/features/runner-mode/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/features/runner-mode/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. \ No newline at end of file +Features on Hilbishhttps://rosettea.github.io/Hilbish/docs/features/Recent content in Features on HilbishHugo -- gohugo.ioen-usRunner Modehttps://rosettea.github.io/Hilbish/docs/features/runner-mode/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/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. +In some cases, someone might want to switch to just shell script to avoid it while interactive but still have a Lua config, or go full Lua to use Hilbish as a REPL. This also allows users to add alternative languages, instead of either like Fennel. \ No newline at end of file diff --git a/docs/features/runner-mode/index.html b/docs/features/runner-mode/index.html index 03ebce9..7aa99ac 100644 --- a/docs/features/runner-mode/index.html +++ b/docs/features/runner-mode/index.html @@ -2,36 +2,9 @@

Runner Mode

Last updated Dec 13, 2022
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.

Functions

These are the “low level” functions for the hilbish.runner interface.

  • setMode(mode) > The same as hilbish.runnerMode
  • sh(input) -> input, code, err > Runs input in Hilbish’s sh interpreter
  • lua(input) -> input, code, err > Evals input as Lua code

The others here are defined in Lua and have EmmyLua documentation. -These functions should be preferred over the previous ones.

  • setCurrent(mode) > The same as setMode, but works with runners managed -via the functions below.
  • add(name, runner) > Adds a runner to a table of available runners. The runner -argument is either a function or a table with a run callback.
  • set(name, runner) > The same as add but requires passing a table and -overwrites if the named runner already exists.
  • get(name) > runner > Gets a runner by name. It is a table with at least a -run function, to run input.
  • exec(cmd, runnerName) > Runs cmd with a runner. If runnerName isn’t passed, -the current runner mode is used.
\ No newline at end of file +

Runner Mode

Last updated Dec 13, 2022
Customize the interactive script/command runner.

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.

In some cases, someone might want to switch to just shell script to avoid +it while interactive but still have a Lua config, or go full Lua to use +Hilbish as a REPL. This also allows users to add alternative languages, +instead of either like Fennel.

\ No newline at end of file diff --git a/index.xml b/index.xml index 10ae09f..43cb3b0 100644 --- a/index.xml +++ b/index.xml @@ -3,5 +3,5 @@ Windows Support? It compiles for Windows (CI ensures it does), but otherwise it Where is the API documentation?Getting Startedhttps://rosettea.github.io/Hilbish/docs/getting-started/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/getting-started/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. Setting as Default Login shell There are a few ways to make Hilbish your default shell. A simple way is to make it your user/login shell.Installhttps://rosettea.github.io/Hilbish/install/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/install/Official Binaries The best way to get Hilbish is to get a build directly from GitHub. At any time, there are 2 versions of Hilbish recommended for download: the latest stable release, and development builds from the master branch. You can download both at any time, but note that the development builds may have breaking changes. -For the latest stable release, check here: https://github.com/Rosettea/Hilbish/releases/latest For a development build: https://nightly.link/Rosettea/Hilbish/workflows/build/master Package Repositories Arch Linux (AUR) Hilbish is on the AUR.Runner Modehttps://rosettea.github.io/Hilbish/docs/features/runner-mode/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/docs/features/runner-mode/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. \ No newline at end of file +For the latest stable release, check here: https://github.com/Rosettea/Hilbish/releases/latest For a development build: https://nightly.link/Rosettea/Hilbish/workflows/build/master Package Repositories Arch Linux (AUR) Hilbish is on the AUR.Runner Modehttps://rosettea.github.io/Hilbish/docs/features/runner-mode/Mon, 01 Jan 0001 00:00:00 +0000https://rosettea.github.io/Hilbish/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. +In some cases, someone might want to switch to just shell script to avoid it while interactive but still have a Lua config, or go full Lua to use Hilbish as a REPL. This also allows users to add alternative languages, instead of either like Fennel. \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 29cb52b..bbaa858 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://rosettea.github.io/Hilbish/docs/features/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/faq/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/getting-started/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/categories/https://rosettea.github.io/Hilbish/install/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/features/runner-mode/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/tags/ \ No newline at end of file +https://rosettea.github.io/Hilbish/docs/features/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/faq/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/getting-started/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/categories/https://rosettea.github.io/Hilbish/install/2022-12-13T15:08:03-04:00https://rosettea.github.io/Hilbish/docs/features/runner-mode/2022-12-13T15:14:30-04:00https://rosettea.github.io/Hilbish/tags/ \ No newline at end of file