From 6729ecddea9379f2c2b65ec70e20d36da13e626a Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Sat, 15 Apr 2023 14:36:56 +0000 Subject: [PATCH] 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