mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-01 00:32:03 +00:00
fix: descriptions
This commit is contained in:
parent
4b28efe639
commit
1cbfc35c70
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bait",
|
||||
"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": [],
|
||||
"fields": [],
|
||||
"docs": [
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "commander",
|
||||
"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": [],
|
||||
"fields": [],
|
||||
"docs": [
|
||||
|
@ -1,147 +1,9 @@
|
||||
{
|
||||
"name": "hilbish",
|
||||
"shortDescription": "the core Hilbish API",
|
||||
"description": "The Hilbish module includes the core API, containing\ninterfaces and functions which directly relate to shell functionality.",
|
||||
"shortDescription": "",
|
||||
"description": "",
|
||||
"properties": [],
|
||||
"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
|
||||
}
|
||||
],
|
||||
"fields": [],
|
||||
"types": [
|
||||
{
|
||||
"name": "Sink",
|
||||
@ -164,127 +26,6 @@
|
||||
}
|
||||
],
|
||||
"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",
|
||||
"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": {
|
||||
|
@ -15,16 +15,13 @@ its `events` system, many actions in Hilbish emit events.
|
||||
Unlike Node.js, Hilbish events are global. So make sure to
|
||||
pick a unique name!\
|
||||
\
|
||||
|
||||
Usage of the Bait module consists of userstanding
|
||||
event-driven architecture, but it's pretty simple:
|
||||
If you want to act on a certain event, you can `catch` it.
|
||||
You can act on events via callback functions.\
|
||||
\
|
||||
|
||||
Examples of this are in the Hilbish default config!
|
||||
Consider this part of it:\
|
||||
\
|
||||
Consider this part of it:
|
||||
|
||||
```lua
|
||||
bait.catch('command.exit', function(code)
|
||||
|
@ -13,8 +13,8 @@ menu:
|
||||
Commander is the library which handles Hilbish commands. This makes
|
||||
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
|
||||
library in your Hilbish config.\
|
||||
\
|
||||
library in your Hilbish config.
|
||||
|
||||
```lua
|
||||
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.
|
||||
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.
|
||||
- `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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Module hilbish
|
||||
description: the core Hilbish API
|
||||
description:
|
||||
layout: doc
|
||||
menu:
|
||||
docs:
|
||||
@ -9,8 +9,7 @@ menu:
|
||||
|
||||
## Introduction
|
||||
|
||||
The Hilbish module includes the core API, containing
|
||||
interfaces and functions which directly relate to shell functionality.
|
||||
|
||||
|
||||
## Functions
|
||||
|
||||
@ -87,53 +86,6 @@ interfaces and functions which directly relate to shell functionality.
|
||||
</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
|
||||
|
||||
``` =html
|
||||
|
@ -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.
|
||||
You can act on events via callback functions.<nl>
|
||||
Examples of this are in the Hilbish default config!
|
||||
Consider this part of it:<nl>
|
||||
Consider this part of it:
|
||||
|
||||
```lua
|
||||
bait.catch('command.exit', function(code)
|
||||
|
@ -3,7 +3,8 @@
|
||||
Commander is the library which handles Hilbish commands. This makes
|
||||
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
|
||||
library in your Hilbish config.<nl>
|
||||
library in your Hilbish config.
|
||||
|
||||
```lua
|
||||
local commander = require 'commander'
|
||||
|
||||
|
@ -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 {
|
||||
base_url <> cont
|
||||
|
Loading…
x
Reference in New Issue
Block a user