From 21d644e2f2ed5dc87b39d7aacff8223b7c4839c4 Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Fri, 22 Apr 2022 02:22:20 +0000 Subject: [PATCH] docs: [ci] generate new docs --- docs/hilbish.txt | 19 ++++++++++--------- emmyLuaDocs/hilbish.lua | 28 +++++++++++++++------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/docs/hilbish.txt b/docs/hilbish.txt index 80dad96..7b8dfea 100644 --- a/docs/hilbish.txt +++ b/docs/hilbish.txt @@ -7,7 +7,7 @@ A `scope` is currently only expected to be `command.`, replacing with the name of the command (for example `command.git`). `cb` must be a function that returns a table of "completion groups." A completion group is a table with the keys `items` and `type`. -`items` being a table of items and `type` being the display type of +`items` being a table of items and `type` being the display type, which is `grid` (the normal file completion display) or `list` (with a description) cwd() > Returns the current directory of the shell @@ -16,15 +16,16 @@ exec(cmd) > Replaces running hilbish with `cmd` goro(fn) > Puts `fn` in a goroutine -highlighter(cb) > Sets the highlighter function. This is mainly for syntax hightlighting, but in -reality could set the input of the prompt to display anything. The callback -is passed the current line as typed and is expected to return a line that will -be used to display in the line. +highlighter(line) > 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. -hinter(cb) > Sets the hinter function. This will be called on every key insert to determine -what text to use as an inline hint. The callback is passed 2 arguments: -the current line and the position. It is expected to return a string -which will be used for the hint. +hinter(line, pos) > The command line hint handler. It gets called on every key insert to +determine what text to use as an inline hint. It is passed the current +line and cursor position. It is expected to return a string which is used +as the text for the hint. This is by default a shim. To set hints, +override this function with your custom handler. inputMode(mode) > Sets the input mode for Hilbish's line reader. Accepts either emacs or vim diff --git a/emmyLuaDocs/hilbish.lua b/emmyLuaDocs/hilbish.lua index 64f6f9c..b2848d1 100644 --- a/emmyLuaDocs/hilbish.lua +++ b/emmyLuaDocs/hilbish.lua @@ -16,7 +16,7 @@ function hilbish.appendPath(dir) end --- replacing with the name of the command (for example `command.git`). --- `cb` must be a function that returns a table of "completion groups." --- A completion group is a table with the keys `items` and `type`. ---- `items` being a table of items and `type` being the display type of +--- `items` being a table of items and `type` being the display type, which is --- `grid` (the normal file completion display) or `list` (with a description) --- @param scope string --- @param cb function @@ -33,19 +33,21 @@ function hilbish.exec(cmd) end --- @param fn function function hilbish.goro(fn) end ---- Sets the highlighter function. This is mainly for syntax hightlighting, but in ---- reality could set the input of the prompt to display anything. The callback ---- is passed the current line as typed and is expected to return a line that will ---- be used to display in the line. ---- @param cb function -function hilbish.highlighter(cb) end +--- 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. +--- @param line string +function hilbish.highlighter(line) end ---- Sets the hinter function. This will be called on every key insert to determine ---- what text to use as an inline hint. The callback is passed 2 arguments: ---- the current line and the position. It is expected to return a string ---- which will be used for the hint. ---- @param cb function -function hilbish.hinter(cb) end +--- The command line hint handler. It gets called on every key insert to +--- determine what text to use as an inline hint. It is passed the current +--- line and cursor position. It is expected to return a string which is used +--- as the text for the hint. This is by default a shim. To set hints, +--- override this function with your custom handler. +--- @param line string +--- @param pos int +function hilbish.hinter(line, pos) end --- Sets the input mode for Hilbish's line reader. Accepts either emacs or vim --- @param mode string