From 237b306eb84ceab3a543f1b96c9ce77337a7d0ea Mon Sep 17 00:00:00 2001 From: sammyette Date: Fri, 14 Apr 2023 00:52:45 -0400 Subject: [PATCH 1/5] ci: fix branch name var --- .github/workflows/website.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 08e68d9..dd71799 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -39,5 +39,5 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./website/public - destination_dir: versions/${( steps.branch.outputs.BRANCH_NAME }} + destination_dir: versions/${{ steps.branch.outputs.BRANCH_NAME }} keep_files: true From d7dde44a0c501d0187a74a12f8372b96e9169063 Mon Sep 17 00:00:00 2001 From: sammyette Date: Fri, 14 Apr 2023 01:23:24 -0400 Subject: [PATCH 2/5] ci: (attempt to) fix base url on non-master versions --- .github/workflows/website.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index dd71799..f5c116d 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -19,13 +19,17 @@ jobs: hugo-version: 'latest' extended: true - - name: Build - run: 'cd website && hugo --minify' - - 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/'%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 From 480d4de75039eea58f8927e88e3a8b658e6649bf Mon Sep 17 00:00:00 2001 From: sammyette Date: Fri, 14 Apr 2023 01:25:14 -0400 Subject: [PATCH 3/5] ci: set baseurl properly --- .github/workflows/website.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index f5c116d..6ee4349 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -25,7 +25,7 @@ jobs: - 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/'%https://rosettea.github.io/Hilbish/versions/${{ steps.branch.outputs.BRANCH_NAME }}%" website/config.toml + 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' From 485306fbe2855a3f8c2a73f8673fcd6cc0998c72 Mon Sep 17 00:00:00 2001 From: sammyette Date: Sat, 15 Apr 2023 10:36:21 -0400 Subject: [PATCH 4/5] docs: clarify use of highlighter function --- api.go | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From 6729ecddea9379f2c2b65ec70e20d36da13e626a Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Sat, 15 Apr 2023 14:36:56 +0000 Subject: [PATCH 5/5] docs: [ci] generate new docs --- docs/api/hilbish/_index.md | 8 ++++++++ emmyLuaDocs/hilbish.lua | 8 ++++++++ 2 files changed, 16 insertions(+) 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