From c76fc279b848835a64f10ced196942ffeee9eb81 Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Tue, 13 Dec 2022 00:51:31 +0000 Subject: [PATCH] deploy: 05570ec29a0a90b96f1098251b2674f7064d57e9 --- docs/faq/index.html | 2 +- docs/features/index.html | 5 ++++ docs/features/index.xml | 2 ++ docs/features/runner-mode/index.html | 37 ++++++++++++++++++++++++++++ docs/getting-started/index.html | 2 +- docs/index.html | 2 +- index.xml | 3 ++- sitemap.xml | 2 +- 8 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 docs/features/index.html create mode 100644 docs/features/index.xml create mode 100644 docs/features/runner-mode/index.html 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>

Frequently Asked Questions

Is Hilbish POSIX compliant?

No, it is not. POSIX compliance is a non-goal. Perhaps in the future, +

Frequently Asked Questions

Is Hilbish POSIX compliant?

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

Windows Support?

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 @@ +Features — Hilbish +

\ No newline at end of file diff --git a/docs/features/index.xml b/docs/features/index.xml new file mode 100644 index 0000000..c9a4e66 --- /dev/null +++ b/docs/features/index.xml @@ -0,0 +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 diff --git a/docs/features/runner-mode/index.html b/docs/features/runner-mode/index.html new file mode 100644 index 0000000..eb9a6f0 --- /dev/null +++ b/docs/features/runner-mode/index.html @@ -0,0 +1,37 @@ +Runner Mode — Hilbish +

Runner Mode

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 diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 08f3f3a..5566c7f 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -4,7 +4,7 @@ Setting as Default Login shell There are a few ways to make Hilbish your default

Getting Started

To start Hilbish, open a terminal. If Hilbish has been installed and is not the +

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

Introduction

Here lies the documentation for Hilbish, the hyper extensible Lua shell.
Hilbish provides you with a few quality of life features and useful +

Introduction

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:

  • Completion and history search menus
  • Hinting and syntax highlighting (scripted by user)

Installation

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.

\ No newline at end of file diff --git a/index.xml b/index.xml index 7c0a25f..3b0e322 100644 --- a/index.xml +++ b/index.xml @@ -5,4 +5,5 @@ Setting as Default Login shell There are a few ways to make Hilbish your default For official stable releases, check out the latest Github release. Linux Repositories Hilbish is packaged in a few repositories for some distros. 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 Hilbish is currentlty in the testing/edge repository for Alpine. \ No newline at end of file +yay -S hilbish-git Alpine Linux Hilbish is currentlty in the testing/edge repository for Alpine.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 diff --git a/sitemap.xml b/sitemap.xml index 71a56c9..4a065c3 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://rosettea.github.io/Hilbish/docs/faq/https://rosettea.github.io/Hilbish/docs/getting-started/https://rosettea.github.io/Hilbish/docs/https://rosettea.github.io/Hilbish/https://rosettea.github.io/Hilbish/categories/https://rosettea.github.io/Hilbish/install/https://rosettea.github.io/Hilbish/tags/ \ No newline at end of file +https://rosettea.github.io/Hilbish/docs/features/https://rosettea.github.io/Hilbish/docs/faq/https://rosettea.github.io/Hilbish/docs/getting-started/https://rosettea.github.io/Hilbish/docs/https://rosettea.github.io/Hilbish/https://rosettea.github.io/Hilbish/categories/https://rosettea.github.io/Hilbish/install/https://rosettea.github.io/Hilbish/docs/features/runner-mode/https://rosettea.github.io/Hilbish/tags/ \ No newline at end of file