mirror of https://github.com/Hilbis/Hilbish
Compare commits
2 Commits
105b4dd3ce
...
16721713db
Author | SHA1 | Date |
---|---|---|
sammyette | 16721713db | |
sammyette | cd93e7f6fc |
|
@ -2,6 +2,7 @@ baseURL = 'https://rosettea.github.io/Hilbish/'
|
||||||
languageCode = 'en-us'
|
languageCode = 'en-us'
|
||||||
title = 'Hilbish'
|
title = 'Hilbish'
|
||||||
theme = 'hsh'
|
theme = 'hsh'
|
||||||
|
enableGitInfo = true
|
||||||
|
|
||||||
[menu]
|
[menu]
|
||||||
[[menu.nav]]
|
[[menu.nav]]
|
||||||
|
|
|
@ -5,4 +5,7 @@ weight: -40
|
||||||
menu: docs
|
menu: docs
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Hilbish has a wide range of features to enhance the user's experience and
|
||||||
|
is always adding new ones. If there is something missing here or something
|
||||||
|
you would like to see, please [start a discussion](https://github.com/Rosettea/Hilbish/discussions)
|
||||||
|
or comment on any existing ones which match your request.
|
||||||
|
|
|
@ -7,61 +7,11 @@ menu:
|
||||||
parent: "Features"
|
parent: "Features"
|
||||||
---
|
---
|
||||||
|
|
||||||
Hilbish is *unique,* when interactive it first attempts to run input as
|
Hilbish allows you to change how interactive text can be interpreted.
|
||||||
Lua and then tries shell script. But if you're normal, you wouldn't
|
This is mainly due to the fact that the default method Hilbish uses
|
||||||
really be using Hilbish anyway but you'd also not want this
|
is that it runs Lua first and then falls back to shell script.
|
||||||
(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:
|
|
||||||
```lua
|
|
||||||
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 `name`d 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.
|
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
|
@ -3,14 +3,20 @@ title: Install
|
||||||
description: Steps on how to install Hilbish on all the OSes and distros supported.
|
description: Steps on how to install Hilbish on all the OSes and distros supported.
|
||||||
layout: page
|
layout: page
|
||||||
---
|
---
|
||||||
# Github Prebuilt Binaries
|
|
||||||
The easiest and best way to get Hilbish is directly from Github.
|
|
||||||
For official stable releases, check out the latest [Github release.](https://github.com/Rosettea/Hilbish/releases/latest)
|
|
||||||
|
|
||||||
# Linux Repositories
|
## Official Binaries
|
||||||
Hilbish is packaged in a *few* repositories for some distros.
|
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.
|
||||||
|
|
||||||
## Arch Linux (AUR)
|
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. Setup an AUR helper, and install.
|
Hilbish is on the AUR. Setup an AUR helper, and install.
|
||||||
Example with yay:
|
Example with yay:
|
||||||
|
|
||||||
|
@ -23,10 +29,10 @@ Or, from master branch:
|
||||||
yay -S hilbish-git
|
yay -S hilbish-git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Alpine Linux
|
### Alpine Linux
|
||||||
Hilbish is currentlty in the testing/edge repository for Alpine.
|
Hilbish is currentlty in the testing/edge repository for Alpine.
|
||||||
Follow the steps [here](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository)
|
Follow the steps [here](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository)
|
||||||
(Using testing repositories) and install:
|
(Using testing repositories) and install:
|
||||||
```
|
```
|
||||||
apk install hilbish
|
apk add hilbish
|
||||||
```
|
```
|
||||||
|
|
|
@ -25,14 +25,28 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col" style="max-width: 80em; margin: auto;">
|
<div class="p-3 col">
|
||||||
<div>
|
<div>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
{{ if .Description }}
|
<p><em>
|
||||||
<p><i>{{ .Description }}</i></p>
|
{{ $date := .Date.UTC.Format "Jan 2, 2006" }}
|
||||||
|
{{ $lastmod := .Lastmod.UTC.Format "Jan 2, 2006" }}
|
||||||
|
{{ if and (ne $lastmod $date) (gt .Lastmod .Date) }}
|
||||||
|
Last updated {{ $lastmod }}<br>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Description }}
|
||||||
|
{{ .Description }}<br>
|
||||||
|
{{ end}}
|
||||||
|
</em></p>
|
||||||
{{.Content}}
|
{{.Content}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="footer mt-auto">
|
||||||
|
<p class="card-small text-muted">
|
||||||
|
Want to help improve this page? <a href="https://github.com/Rosettea/Hilbish/issues/new/choose">Create an issue.</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue