diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 547673b..6ee4349 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -1,10 +1,8 @@ name: Build website on: - push: - branches: - - master - - docs-refactor + - push + - pull_request jobs: deploy: @@ -21,11 +19,29 @@ jobs: hugo-version: 'latest' extended: true + - name: Set branch name + id: branch + run: echo "::set-output name=BRANCH_NAME::${GITHUB_REF##*/}" + + - name: Fix base URL + if: steps.branch.outputs.BRANCH_NAME != 'master' && github.repository_owner == 'Rosettea' + run: sed -i "s%baseURL = 'https://rosettea.github.io/Hilbish/'%baseURL = 'https://rosettea.github.io/Hilbish/versions/${{ steps.branch.outputs.BRANCH_NAME }}'%" website/config.toml + - name: Build run: 'cd website && hugo --minify' - name: Deploy + if: steps.branch.outputs.BRANCH_NAME == 'master' && github.repository_owner == 'Rosettea' uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./website/public + keep_files: true + - name: Deploy + if: steps.branch.outputs.BRANCH_NAME != 'master' && github.repository_owner == 'Rosettea' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./website/public + destination_dir: versions/${{ steps.branch.outputs.BRANCH_NAME }} + keep_files: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 858c15d..4742feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,21 @@ - `flush()` and `autoFlush()` related to flushing outputs - `pipe` property to check if a sink with input is a pipe (like stdin) - Add fuzzy search to history search (enable via `hilbish.opts.fuzzy = true`) +- Show indexes on cdr list ### Fixed - Replaced `sed` in-place editing with `grep` and `mv` for compatibility with BSD utils +## [2.1.2] - 2022-04-10 +### Removed +- Bad april fools code ;( + +## [2.1.1] - 2022-04-01 +### Added +- Validation checks for command input +- Improved runtime performance +- Validate Lua code + ## [2.1.0] - 2022-02-10 ### Added - Documented custom userdata types (Job and Timer Objects) diff --git a/README.md b/README.md index 3a3dbbb..469630b 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,35 @@ -
-
-
-
- 🌺 The flower shell. A comfy and nice little shell for Lua fans! -
-

- GitHub commit activity - GitHub commits since latest release (by date) - GitHub contributors
- help wanted - GitHub license - Discord -

-
+
+
+🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨ +
-Hilbish is a extensible shell (framework). It was made to be very customizable -via the Lua programming language. It aims to be easy to use for the casual -people but powerful for those who want to tinker more with their shell, -the thing used to interface with most of the system. +GitHub commit activityGitHub commits since latest release (by date)GitHub contributors
+help wanted +GitHub license +Discord +
+ +Hilbish is an extensible shell designed to be highly customizable. +It is configured in Lua and provides a good range of features. +It aims to be easy to use for anyone but powerful enough for +those who need it. The motivation for choosing Lua was that its simpler and better to use than old shell script. It's fine for basic interactive shell uses, but that's the only place Hilbish has shell script; everything else is Lua and aims to be infinitely configurable. If something isn't, open an issue! -# Table of Contents -- [Screenshots](#Screenshots) -- [Getting Hilbish](#Getting-Hilbish) -- [Contributing](#Contributing) - # Screenshots
-

-

+
# Getting Hilbish **NOTE:** Hilbish is not guaranteed to work properly on Windows, starting from the 2.0 version. It will still be able to compile, but functionality -may be lacking. +may be lacking. If you want to contribute to make the situation better, +comment on the Windows discussion. You can check the [install page](https://rosettea.github.io/Hilbish/install/) on the website for distributed binaries from GitHub or other package repositories. diff --git a/api.go b/api.go index 3920e6f..a440693 100644 --- a/api.go +++ b/api.go @@ -639,6 +639,14 @@ func hlhinter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { // 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. // --- @param line string func hlhighlighter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { return c.Next(), nil diff --git a/assets/hilbish-flower.png b/assets/hilbish-flower.png index b4fb0f7..866e57e 100644 Binary files a/assets/hilbish-flower.png and b/assets/hilbish-flower.png differ diff --git a/assets/hilbish-logo-and-text.png b/assets/hilbish-logo-and-text.png new file mode 100644 index 0000000..325034c Binary files /dev/null and b/assets/hilbish-logo-and-text.png differ diff --git a/assets/hilbish-text.png b/assets/hilbish-text.png deleted file mode 100644 index 16412c4..0000000 Binary files a/assets/hilbish-text.png and /dev/null differ diff --git a/docs/api/hilbish/_index.md b/docs/api/hilbish/_index.md index d2d13c8..8fb587a 100644 --- a/docs/api/hilbish/_index.md +++ b/docs/api/hilbish/_index.md @@ -49,6 +49,14 @@ 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. ### hinter(line, pos) The command line hint handler. It gets called on every key insert to diff --git a/emmyLuaDocs/hilbish.lua b/emmyLuaDocs/hilbish.lua index 8d46276..c26c7ec 100644 --- a/emmyLuaDocs/hilbish.lua +++ b/emmyLuaDocs/hilbish.lua @@ -79,6 +79,14 @@ function hilbish.goro(fn) end --- 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. --- @param line string function hilbish.highlighter(line) end diff --git a/nature/commands/cdr.lua b/nature/commands/cdr.lua index 288ae22..e6aba36 100644 --- a/nature/commands/cdr.lua +++ b/nature/commands/cdr.lua @@ -10,7 +10,7 @@ cdr: change directory to one which has been recently visied usage: cdr -to get a list of recent directories, use {green}{underline}cdr list{reset}]]) +to get a list of recent directories, use {green}cdr list{reset}]]) return end @@ -20,7 +20,10 @@ to get a list of recent directories, use {green}{underline}cdr list{reset}]]) sinks.out:writeln 'No directories have been visited.' return 1 end - sinks.out:writeln(table.concat(recentDirs, '\n')) + for idx, d in ipairs(dirs.recentDirs) do + if d:find(hilbish.home, 1, true) then d = fs.join('~', d:sub(hilbish.home:len() + 1)) end + sinks.out:writeln(lunacolors.format(string.format('{cyan}%d{reset} %s', idx, d))) + end return end diff --git a/vars.go b/vars.go index 7cbc768..583db71 100644 --- a/vars.go +++ b/vars.go @@ -13,6 +13,7 @@ var ( var ( ver = "v2.2.0" releaseName = "Poppy" + gitCommit string gitBranch string ) diff --git a/website/content/_index.md b/website/content/_index.md index 2b1087b..4421798 100644 --- a/website/content/_index.md +++ b/website/content/_index.md @@ -8,11 +8,11 @@ description: 'Something Unique. Hilbish is the new interactive shell for Lua fan

Something Unique.

- Hilbish is the new interactive shell for Lua fans.
- Extensible, scriptable, configurable: All in Lua. + 🌺 Hilbish is the new Moon-powered interactive shell for Lua fans!
+ Extensible, scriptable, configurable: All in Lua. ✨

Install - Github + GitHub

@@ -108,14 +108,28 @@ description: 'Something Unique. Hilbish is the new interactive shell for Lua fan
+

Screenshots

+
+
+ +
+
+ +
+
+ +
+
+
+

Why not just Lua?

Hilbish is your interactive shell as well as a just a Lua interpreter and enhanced REPL.

-