2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-01 16:52:03 +00:00

fix: descriptions

This commit is contained in:
sammyette 2025-06-22 18:55:56 -04:00
parent 4b28efe639
commit 1cbfc35c70
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
9 changed files with 136 additions and 325 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "bait", "name": "bait",
"shortDescription": "the event emitter", "shortDescription": "the event emitter",
"description": "\nBait is the event emitter for Hilbish. Much like Node.js and\nits `events` system, many actions in Hilbish emit events.\nUnlike Node.js, Hilbish events are global. So make sure to\npick a unique name!\\\n \\\n\nUsage of the Bait module consists of userstanding\nevent-driven architecture, but it's pretty simple:\nIf you want to act on a certain event, you can `catch` it.\nYou can act on events via callback functions.\\\n \\\n\nExamples of this are in the Hilbish default config!\nConsider this part of it:\\\n \\\n\n```lua\nbait.catch('command.exit', function(code)\n\trunning = false\n\tdoPrompt(code ~= 0)\n\tdoNotifyPrompt()\nend)\n```\n\nWhat this does is, whenever the `command.exit` event is thrown,\nthis function will set the user prompt.", "description": "\nBait is the event emitter for Hilbish. Much like Node.js and\nits `events` system, many actions in Hilbish emit events.\nUnlike Node.js, Hilbish events are global. So make sure to\npick a unique name!\\\n \\\nUsage of the Bait module consists of userstanding\nevent-driven architecture, but it's pretty simple:\nIf you want to act on a certain event, you can `catch` it.\nYou can act on events via callback functions.\\\n \\\nExamples of this are in the Hilbish default config!\nConsider this part of it:\n\n```lua\nbait.catch('command.exit', function(code)\n\trunning = false\n\tdoPrompt(code ~= 0)\n\tdoNotifyPrompt()\nend)\n```\n\nWhat this does is, whenever the `command.exit` event is thrown,\nthis function will set the user prompt.",
"properties": [], "properties": [],
"fields": [], "fields": [],
"docs": [ "docs": [

View File

@ -1,7 +1,7 @@
{ {
"name": "commander", "name": "commander",
"shortDescription": "library for custom commands", "shortDescription": "library for custom commands",
"description": "\nCommander is the library which handles Hilbish commands. This makes\nthe user able to add Lua-written commands to their shell without making\na separate script in a bin folder. Instead, you may simply use the Commander\nlibrary in your Hilbish config.\\\n \\\n```lua\nlocal commander = require 'commander'\n\ncommander.register('hello', function(args, sinks)\n\tsinks.out:writeln 'Hello world!'\nend)\n```\n\nIn this example, a command with the name of `hello` is created\nthat will print `Hello world!` to output. One question you may\nhave is: What is the `sinks` parameter?\\\n \\\nThe `sinks` parameter is a table with 3 keys: `input`, `out`, and `err`.\nThere is an `in` alias to `input`, but it requires using the string accessor syntax (`sinks['in']`)\nas `in` is also a Lua keyword, so `input` is preferred for use.\nAll of them are a @Sink.\nIn the future, `sinks.in` will be removed.\\\n \\\n\n- `in` is the standard input. You may use the read functions on this sink to get input from the user.\n- `out` is standard output. This is usually where command output should go.\n- `err` is standard error. This sink is for writing errors, as the name would suggest.", "description": "\nCommander is the library which handles Hilbish commands. This makes\nthe user able to add Lua-written commands to their shell without making\na separate script in a bin folder. Instead, you may simply use the Commander\nlibrary in your Hilbish config.\n\n```lua\nlocal commander = require 'commander'\n\ncommander.register('hello', function(args, sinks)\n\tsinks.out:writeln 'Hello world!'\nend)\n```\n\nIn this example, a command with the name of `hello` is created\nthat will print `Hello world!` to output. One question you may\nhave is: What is the `sinks` parameter?\\\n \\\nThe `sinks` parameter is a table with 3 keys: `input`, `out`, and `err`.\nThere is an `in` alias to `input`, but it requires using the string accessor syntax (`sinks['in']`)\nas `in` is also a Lua keyword, so `input` is preferred for use.\nAll of them are a @Sink.\nIn the future, `sinks.in` will be removed.\\\n \\\n- `in` is the standard input. You may use the read functions on this sink to get input from the user.\n- `out` is standard output. This is usually where command output should go.\n- `err` is standard error. This sink is for writing errors, as the name would suggest.",
"properties": [], "properties": [],
"fields": [], "fields": [],
"docs": [ "docs": [

View File

@ -1,147 +1,9 @@
{ {
"name": "hilbish", "name": "hilbish",
"shortDescription": "the core Hilbish API", "shortDescription": "",
"description": "The Hilbish module includes the core API, containing\ninterfaces and functions which directly relate to shell functionality.", "description": "",
"properties": [], "properties": [],
"fields": [ "fields": [],
{
"name": "ver",
"description": [
"The",
"version",
"of",
"Hilbish"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "goVersion",
"description": [
"The",
"version",
"of",
"Go",
"that",
"Hilbish",
"was",
"compiled",
"with"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "user",
"description": [
"Username",
"of",
"the",
"user"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "host",
"description": [
"Hostname",
"of",
"the",
"machine"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "dataDir",
"description": [
"Directory",
"for",
"Hilbish",
"data",
"files,",
"including",
"the",
"docs",
"and",
"default",
"modules"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "interactive",
"description": [
"Is",
"Hilbish",
"in",
"an",
"interactive",
"shell?"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "login",
"description": [
"Is",
"Hilbish",
"the",
"login",
"shell?"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "vimMode",
"description": [
"Current",
"Vim",
"input",
"mode",
"of",
"Hilbish",
"(will",
"be",
"nil",
"if",
"not",
"in",
"Vim",
"input",
"mode)"
],
"isInterface": false,
"isMember": false,
"isType": false
},
{
"name": "exitCode",
"description": [
"Exit",
"code",
"of",
"the",
"last",
"executed",
"command"
],
"isInterface": false,
"isMember": false,
"isType": false
}
],
"types": [ "types": [
{ {
"name": "Sink", "name": "Sink",
@ -164,127 +26,6 @@
} }
], ],
"docs": [ "docs": [
{
"name": "luaSinkAutoFlush",
"description": [
"Sets/toggles the option of automatically flushing output.",
"A call with no argument will toggle the value."
],
"signature": "autoFlush(auto)",
"goFuncName": "luasinkautoflush",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkFlush",
"description": [
"Flush writes all buffered input to the sink."
],
"signature": "flush()",
"goFuncName": "luasinkflush",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkRead",
"description": [
"Reads a liine of input from the sink."
],
"signature": "read() -\u003e string",
"goFuncName": "luasinkread",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkReadAll",
"description": [
"Reads all input from the sink."
],
"signature": "readAll() -\u003e string",
"goFuncName": "luasinkreadall",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkWrite",
"description": [
"Writes data to a sink."
],
"signature": "write(str)",
"goFuncName": "luasinkwrite",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkWriteln",
"description": [
"Writes data to a sink with a newline at the end."
],
"signature": "writeln(str)",
"goFuncName": "luasinkwriteln",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{ {
"name": "alias", "name": "alias",
"description": [ "description": [
@ -1128,6 +869,127 @@
} }
] ]
} }
},
{
"name": "luaSinkAutoFlush",
"description": [
"Sets/toggles the option of automatically flushing output.",
"A call with no argument will toggle the value."
],
"signature": "autoFlush(auto)",
"goFuncName": "luasinkautoflush",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkFlush",
"description": [
"Flush writes all buffered input to the sink."
],
"signature": "flush()",
"goFuncName": "luasinkflush",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkRead",
"description": [
"Reads a liine of input from the sink."
],
"signature": "read() -\u003e string",
"goFuncName": "luasinkread",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkReadAll",
"description": [
"Reads all input from the sink."
],
"signature": "readAll() -\u003e string",
"goFuncName": "luasinkreadall",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkWrite",
"description": [
"Writes data to a sink."
],
"signature": "write(str)",
"goFuncName": "luasinkwrite",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
},
{
"name": "luaSinkWriteln",
"description": [
"Writes data to a sink with a newline at the end."
],
"signature": "writeln(str)",
"goFuncName": "luasinkwriteln",
"isInterface": false,
"isMember": true,
"isType": false,
"tags": {
"member": [
{
"id": "",
"fields": null,
"startIdx": 0
}
]
}
} }
], ],
"interfaces": { "interfaces": {

View File

@ -15,16 +15,13 @@ its `events` system, many actions in Hilbish emit events.
Unlike Node.js, Hilbish events are global. So make sure to Unlike Node.js, Hilbish events are global. So make sure to
pick a unique name!\ pick a unique name!\
\ \
Usage of the Bait module consists of userstanding Usage of the Bait module consists of userstanding
event-driven architecture, but it's pretty simple: event-driven architecture, but it's pretty simple:
If you want to act on a certain event, you can `catch` it. If you want to act on a certain event, you can `catch` it.
You can act on events via callback functions.\ You can act on events via callback functions.\
\ \
Examples of this are in the Hilbish default config! Examples of this are in the Hilbish default config!
Consider this part of it:\ Consider this part of it:
\
```lua ```lua
bait.catch('command.exit', function(code) bait.catch('command.exit', function(code)

View File

@ -13,8 +13,8 @@ menu:
Commander is the library which handles Hilbish commands. This makes Commander is the library which handles Hilbish commands. This makes
the user able to add Lua-written commands to their shell without making the user able to add Lua-written commands to their shell without making
a separate script in a bin folder. Instead, you may simply use the Commander a separate script in a bin folder. Instead, you may simply use the Commander
library in your Hilbish config.\ library in your Hilbish config.
\
```lua ```lua
local commander = require 'commander' local commander = require 'commander'
@ -33,7 +33,6 @@ as `in` is also a Lua keyword, so `input` is preferred for use.
All of them are a @Sink. All of them are a @Sink.
In the future, `sinks.in` will be removed.\ In the future, `sinks.in` will be removed.\
\ \
- `in` is the standard input. You may use the read functions on this sink to get input from the user. - `in` is the standard input. You may use the read functions on this sink to get input from the user.
- `out` is standard output. This is usually where command output should go. - `out` is standard output. This is usually where command output should go.
- `err` is standard error. This sink is for writing errors, as the name would suggest. - `err` is standard error. This sink is for writing errors, as the name would suggest.

View File

@ -1,6 +1,6 @@
--- ---
title: Module hilbish title: Module hilbish
description: the core Hilbish API description:
layout: doc layout: doc
menu: menu:
docs: docs:
@ -9,8 +9,7 @@ menu:
## Introduction ## Introduction
The Hilbish module includes the core API, containing
interfaces and functions which directly relate to shell functionality.
## Functions ## Functions
@ -87,53 +86,6 @@ interfaces and functions which directly relate to shell functionality.
</div> </div>
``` ```
## Static module fields
``` =html
<div class='relative overflow-x-auto sm:rounded-lg my-4'>
<table class='w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400'>
<tbody>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>ver</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>The version of Hilbish</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>goVersion</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>The version of Go that Hilbish was compiled with</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>user</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Username of the user</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>host</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Hostname of the machine</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>dataDir</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Directory for Hilbish data files, including the docs and default modules</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>interactive</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Is Hilbish in an interactive shell?</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>login</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Is Hilbish the login shell?</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>vimMode</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Current Vim input mode of Hilbish (will be nil if not in Vim input mode)</td>
</tr>
<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>exitCode</td>
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Exit code of the last executed command</td>
</tr>
</tbody>
</table>
</div>
```
## Functions ## Functions
``` =html ``` =html

View File

@ -9,7 +9,7 @@ event-driven architecture, but it's pretty simple:
If you want to act on a certain event, you can `catch` it. If you want to act on a certain event, you can `catch` it.
You can act on events via callback functions.<nl> You can act on events via callback functions.<nl>
Examples of this are in the Hilbish default config! Examples of this are in the Hilbish default config!
Consider this part of it:<nl> Consider this part of it:
```lua ```lua
bait.catch('command.exit', function(code) bait.catch('command.exit', function(code)

View File

@ -3,7 +3,8 @@
Commander is the library which handles Hilbish commands. This makes Commander is the library which handles Hilbish commands. This makes
the user able to add Lua-written commands to their shell without making the user able to add Lua-written commands to their shell without making
a separate script in a bin folder. Instead, you may simply use the Commander a separate script in a bin folder. Instead, you may simply use the Commander
library in your Hilbish config.<nl> library in your Hilbish config.
```lua ```lua
local commander = require 'commander' local commander = require 'commander'

View File

@ -1,6 +1,6 @@
pub const base_url = "https://rosettea.github.io/Hilbish/versions/new-website" //pub const base_url = "https://rosettea.github.io/Hilbish/versions/new-website"
//pub const base_url = "http://localhost:9080" pub const base_url = "http://localhost:9080"
pub fn base_url_join(cont: String) -> String { pub fn base_url_join(cont: String) -> String {
base_url <> cont base_url <> cont