refactor: move misc docs for use in hilbish and website

pull/260/head
sammyette 2023-11-11 22:28:18 -04:00
parent 0607a90c30
commit 5be470521f
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
12 changed files with 48 additions and 11 deletions

View File

@ -15,11 +15,12 @@ It compiles for Windows (CI ensures it does), but otherwise it is not
directly supported. If you'd like to improve this situation,
checkout [the discussion](https://github.com/Rosettea/Hilbish/discussions/165).
# Where is the API documentation?
The builtin `doc` command supplies all documentation of Hilbish provided
APIs. You can also check the sidebar.
# Why?
Hilbish emerged from the desire of a Lua configured shell.
It was the initial reason that it was created, but now it's more:
to be hyper extensible, simpler and more user friendly.
# Does it have "autocompletion" or "tab completion"
Of course! This is a modern shell. Hilbish provides a way for users
to write tab completion for any command and/or the whole shell.
Inline hinting and syntax highlighting are also available.

View File

@ -1,10 +1,19 @@
---
title: Hooks
description:
layout: doc
weight: -50
menu:
docs
---
Here is a list of bait hooks that are thrown by Hilbish. If a hook is related
to a command, it will have the `command` scope, as example.
Here is the format for a doc for a hook:
+ <hook name> -> <args> > <description>
+ {hook name} -> args > description
`<args>` just means the arguments of the hook. If a hook doc has the format
`{args}` just means the arguments of the hook. If a hook doc has the format
of `arg...`, it means the hook can take/recieve any number of `arg`.
+ error -> eventName, handler, err > Emitted when there is an error in

View File

@ -1,12 +1,21 @@
+ `command.preexec` -> input, cmdStr > Thrown before a command
---
title: Command
description:
layout: doc
menu:
docs:
parent: "Hooks"
---
- `command.preexec` -> input, cmdStr > Thrown before a command
is executed. The `input` is the user written command, while `cmdStr`
is what will be executed (`input` will have aliases while `cmdStr`
will have alias resolved input).
+ `command.exit` -> code, cmdStr > Thrown when a command exits.
- `command.exit` -> code, cmdStr > Thrown when a command exits.
`code` is the exit code of the command, and `cmdStr` is the command that was run.
+ `command.not-found` -> cmdStr > Thrown when a command is not found.
- `command.not-found` -> cmdStr > Thrown when a command is not found.
+ `command.not-executable` -> cmdStr > Thrown when Hilbish attempts to run a file
- `command.not-executable` -> cmdStr > Thrown when Hilbish attempts to run a file
that is not executable.

View File

@ -1,3 +1,12 @@
---
title: Hilbish
description:
layout: doc
menu:
docs:
parent: "Hooks"
---
+ `hilbish.exit` > Sent when Hilbish is about to exit.
+ `hilbish.vimMode` -> modeName > Sent when Hilbish's Vim mode is changed (example insert to normal mode),

View File

@ -1,3 +1,12 @@
---
title: Signal
description:
layout: doc
menu:
docs:
parent: "Hooks"
---
+ `signal.sigint` > Sent when Hilbish receives SIGINT (on Ctrl-C).
+ `signal.resize` > Sent when the terminal is resized.

View File

@ -0,0 +1 @@
../../docs

View File

@ -1 +0,0 @@
../../../docs/api/