mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-07 03:22:03 +00:00
Compare commits
No commits in common. "fa92729288207e8b1cc33154002e71318c40c709" and "da5a1d0e34928c7c64447893b08eb726fd817bc0" have entirely different histories.
fa92729288
...
da5a1d0e34
@ -403,7 +403,7 @@ func main() {
|
||||
shortDesc := piece.Doc[0]
|
||||
desc := piece.Doc[1:]
|
||||
interfaceModules[modname].ShortDescription = shortDesc
|
||||
interfaceModules[modname].Description = strings.Replace(strings.Join(desc, "\n"), "<nl>", "\\\n \\", -1)
|
||||
interfaceModules[modname].Description = strings.Join(desc, "\n")
|
||||
interfaceModules[modname].Fields = piece.Fields
|
||||
interfaceModules[modname].Properties = piece.Properties
|
||||
continue
|
||||
@ -441,7 +441,7 @@ func main() {
|
||||
Types: filteredTypePieces,
|
||||
Docs: filteredPieces,
|
||||
ShortDescription: shortDesc,
|
||||
Description: strings.Replace(strings.Join(desc, "\n"), "<nl>", "\\\n \\", -1),
|
||||
Description: strings.Join(desc, "\n"),
|
||||
HasInterfaces: hasInterfaces,
|
||||
Properties: docPieceTag("property", tags),
|
||||
Fields: docPieceTag("field", tags),
|
||||
@ -627,7 +627,6 @@ func generateFile(v module) {
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
`, htmlSig, dps.FuncName))
|
||||
f.WriteString("```\n\n")
|
||||
@ -724,7 +723,7 @@ func table(elems [][]string) string {
|
||||
for _, line := range elems {
|
||||
b.WriteString("<tr class='bg-white border-b dark:bg-neutral-800 dark:border-neutral-700 border-neutral-200'>\n")
|
||||
for _, col := range line {
|
||||
b.WriteString("<td class='p-3 font-medium text-black dark:text-white'>")
|
||||
b.WriteString("<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>")
|
||||
b.WriteString(col)
|
||||
b.WriteString("</td>\n")
|
||||
}
|
||||
|
@ -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 \\\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.",
|
||||
"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```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- `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.\nYou may use the read functions on this sink to get input from the user.\n- `out` is standard output.\nThis is usually where command output should go.\n- `err` is standard error.\nThis sink is for writing errors, as the name would suggest.",
|
||||
"properties": [],
|
||||
"fields": [],
|
||||
"docs": [
|
||||
|
@ -13,16 +13,15 @@ menu:
|
||||
Bait is the event emitter for Hilbish. Much like Node.js and
|
||||
its `events` system, many actions in Hilbish emit events.
|
||||
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
|
||||
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.\
|
||||
\
|
||||
You can act on events via callback functions.
|
||||
|
||||
Examples of this are in the Hilbish default config!
|
||||
Consider this part of it:
|
||||
|
||||
```lua
|
||||
bait.catch('command.exit', function(code)
|
||||
running = false
|
||||
@ -41,24 +40,24 @@ this function will set the user prompt.
|
||||
<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 dark:text-white'><a href="#catch">catch(name, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Catches an event. This function can be used to act on events.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#catch">catch(name, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Catches an event. This function can be used to act on events.</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 dark:text-white'><a href="#catchOnce">catchOnce(name, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Catches an event, but only once. This will remove the hook immediately after it runs for the first time.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#catchOnce">catchOnce(name, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Catches an event, but only once. This will remove the hook immediately after it runs for the first time.</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 dark:text-white'><a href="#hooks">hooks(name) -> table</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns a table of functions that are hooked on an event with the corresponding `name`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#hooks">hooks(name) -> table</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns a table of functions that are hooked on an event with the corresponding `name`.</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 dark:text-white'><a href="#release">release(name, catcher)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Removes the `catcher` for the event with `name`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#release">release(name, catcher)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Removes the `catcher` for the event with `name`.</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 dark:text-white'><a href="#throw">throw(name, ...args)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Throws a hook with `name` with the provided `args`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#throw">throw(name, ...args)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Throws a hook with `name` with the provided `args`.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -76,7 +75,6 @@ bait.catch(name, cb)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -108,7 +106,6 @@ bait.catchOnce(name, cb)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -133,7 +130,6 @@ bait.hooks(name) -> table
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -155,7 +151,6 @@ bait.release(name, catcher)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -193,7 +188,6 @@ bait.throw(name, ...args)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -25,17 +25,20 @@ end)
|
||||
|
||||
In this example, a command with the name of `hello` is created
|
||||
that will print `Hello world!` to output. One question you may
|
||||
have is: What is the `sinks` parameter?\
|
||||
\
|
||||
have is: What is the `sinks` parameter?
|
||||
|
||||
The `sinks` parameter is a table with 3 keys: `input`, `out`, and `err`.
|
||||
There is an `in` alias to `input`, but it requires using the string accessor syntax (`sinks['in']`)
|
||||
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.
|
||||
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.
|
||||
|
||||
## Functions
|
||||
|
||||
@ -44,16 +47,16 @@ In the future, `sinks.in` will be removed.\
|
||||
<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 dark:text-white'><a href="#deregister">deregister(name)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Removes the named command. Note that this will only remove Commander-registered commands.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#deregister">deregister(name)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Removes the named command. Note that this will only remove Commander-registered commands.</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 dark:text-white'><a href="#register">register(name, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Adds a new command with the given `name`. When Hilbish has to run a command with a name,</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#register">register(name, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Adds a new command with the given `name`. When Hilbish has to run a command with a name,</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 dark:text-white'><a href="#registry">registry() -> table</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns all registered commanders. Returns a list of tables with the following keys:</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#registry">registry() -> table</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns all registered commanders. Returns a list of tables with the following keys:</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -71,7 +74,6 @@ commander.deregister(name)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -93,7 +95,6 @@ commander.register(name, cb)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -131,7 +132,6 @@ commander.registry() -> table
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,44 +21,44 @@ library offers more functions and will work on any operating system Hilbish does
|
||||
<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 dark:text-white'><a href="#abs">abs(path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns an absolute version of the `path`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#abs">abs(path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns an absolute version of the `path`.</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 dark:text-white'><a href="#basename">basename(path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns the "basename," or the last part of the provided `path`. If path is empty,</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#basename">basename(path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns the "basename," or the last part of the provided `path`. If path is empty,</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 dark:text-white'><a href="#cd">cd(dir)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Changes Hilbish's directory to `dir`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#cd">cd(dir)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Changes Hilbish's directory to `dir`.</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 dark:text-white'><a href="#dir">dir(path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns the directory part of `path`. If a file path like</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#dir">dir(path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns the directory part of `path`. If a file path like</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 dark:text-white'><a href="#glob">glob(pattern) -> matches (table)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Match all files based on the provided `pattern`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#glob">glob(pattern) -> matches (table)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Match all files based on the provided `pattern`.</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 dark:text-white'><a href="#join">join(...path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Takes any list of paths and joins them based on the operating system's path separator.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#join">join(...path) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Takes any list of paths and joins them based on the operating system's path separator.</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 dark:text-white'><a href="#mkdir">mkdir(name, recursive)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Creates a new directory with the provided `name`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#mkdir">mkdir(name, recursive)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Creates a new directory with the provided `name`.</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 dark:text-white'><a href="#pipe">fpipe() -> File, File</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns a pair of connected files, also known as a pipe.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#pipe">fpipe() -> File, File</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns a pair of connected files, also known as a pipe.</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 dark:text-white'><a href="#readdir">readdir(path) -> table[string]</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns a list of all files and directories in the provided path.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#readdir">readdir(path) -> table[string]</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns a list of all files and directories in the provided path.</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 dark:text-white'><a href="#stat">stat(path) -> {}</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns the information about a given `path`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#stat">stat(path) -> {}</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns the information about a given `path`.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -72,8 +72,8 @@ library offers more functions and will work on any operating system Hilbish does
|
||||
<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 dark:text-white'>pathSep</td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>The operating system's path separator.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>pathSep</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>The operating system's path separator.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -91,7 +91,6 @@ fs.abs(path) -> string
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -114,7 +113,6 @@ fs.basename(path) -> string
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -137,7 +135,6 @@ fs.cd(dir)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -159,7 +156,6 @@ fs.dir(path) -> string
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -182,7 +178,6 @@ fs.glob(pattern) -> matches (table)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -219,7 +214,6 @@ fs.join(...path) -> string
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -248,7 +242,6 @@ fs.mkdir(name, recursive)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -281,7 +274,6 @@ fs.fpipe() -> File, File
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -302,7 +294,6 @@ fs.readdir(path) -> table[string]
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -324,7 +315,6 @@ fs.stat(path) -> {}
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -18,68 +18,68 @@ menu:
|
||||
<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 dark:text-white'><a href="#alias">alias(cmd, orig)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Sets an alias, with a name of `cmd` to another command.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#alias">alias(cmd, orig)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Sets an alias, with a name of `cmd` to another command.</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 dark:text-white'><a href="#appendPath">appendPath(dir)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Appends the provided dir to the command path (`$PATH`)</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#appendPath">appendPath(dir)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Appends the provided dir to the command path (`$PATH`)</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 dark:text-white'><a href="#complete">complete(scope, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Registers a completion handler for the specified scope.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#complete">complete(scope, cb)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Registers a completion handler for the specified scope.</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 dark:text-white'><a href="#cwd">cwd() -> string</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Returns the current directory of the shell.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#cwd">cwd() -> string</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Returns the current directory of the 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 dark:text-white'><a href="#exec">exec(cmd)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Replaces the currently running Hilbish instance with the supplied command.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#exec">exec(cmd)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Replaces the currently running Hilbish instance with the supplied command.</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 dark:text-white'><a href="#goro">goro(fn)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Puts `fn` in a Goroutine.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#goro">goro(fn)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Puts `fn` in a Goroutine.</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 dark:text-white'><a href="#highlighter">highlighter(line)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Line highlighter handler.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#highlighter">highlighter(line)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Line highlighter handler.</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 dark:text-white'><a href="#hinter">hinter(line, pos)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>The command line hint handler. It gets called on every key insert to</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#hinter">hinter(line, pos)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>The command line hint handler. It gets called on every key insert to</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 dark:text-white'><a href="#inputMode">inputMode(mode)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Sets the input mode for Hilbish's line reader.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#inputMode">inputMode(mode)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Sets the input mode for Hilbish's line reader.</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 dark:text-white'><a href="#interval">interval(cb, time) -> @Timer</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Runs the `cb` function every specified amount of `time`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#interval">interval(cb, time) -> @Timer</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Runs the `cb` function every specified amount of `time`.</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 dark:text-white'><a href="#multiprompt">multiprompt(str)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Changes the text prompt when Hilbish asks for more input.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#multiprompt">multiprompt(str)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Changes the text prompt when Hilbish asks for more input.</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 dark:text-white'><a href="#prependPath">prependPath(dir)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Prepends `dir` to $PATH.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#prependPath">prependPath(dir)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Prepends `dir` to $PATH.</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 dark:text-white'><a href="#prompt">prompt(str, typ)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Changes the shell prompt to the provided string.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#prompt">prompt(str, typ)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Changes the shell prompt to the provided string.</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 dark:text-white'><a href="#read">read(prompt) -> input (string)</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Read input from the user, using Hilbish's line editor/input reader.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#read">read(prompt) -> input (string)</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Read input from the user, using Hilbish's line editor/input reader.</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 dark:text-white'><a href="#timeout">timeout(cb, time) -> @Timer</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Executed the `cb` function after a period of `time`.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#timeout">timeout(cb, time) -> @Timer</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Executed the `cb` function after a period of `time`.</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 dark:text-white'><a href="#which">which(name) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Checks if `name` is a valid command.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#which">which(name) -> string</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Checks if `name` is a valid command.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -97,7 +97,6 @@ hilbish.alias(cmd, orig)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -132,7 +131,6 @@ hilbish.appendPath(dir)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -166,7 +164,6 @@ hilbish.complete(scope, cb)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -222,7 +219,6 @@ hilbish.cwd() -> string
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -242,7 +238,6 @@ hilbish.exec(cmd)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -265,7 +260,6 @@ hilbish.goro(fn)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -290,7 +284,6 @@ hilbish.highlighter(line)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -326,7 +319,6 @@ hilbish.hinter(line, pos)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -363,7 +355,6 @@ hilbish.inputMode(mode)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -387,7 +378,6 @@ hilbish.interval(cb, time) -> @Timer
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -413,7 +403,6 @@ hilbish.multiprompt(str)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -455,7 +444,6 @@ hilbish.prependPath(dir)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -477,7 +465,6 @@ hilbish.prompt(str, typ)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -516,7 +503,6 @@ hilbish.read(prompt) -> input (string)
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -540,7 +526,6 @@ hilbish.timeout(cb, time) -> @Timer
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -566,7 +551,6 @@ hilbish.which(name) -> string
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -22,8 +22,8 @@ is usable at `hilbish.editor`.
|
||||
<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 dark:text-white'><a href="#New">new() -> @Readline</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Creates a new readline instance.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#New">new() -> @Readline</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Creates a new readline instance.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -41,7 +41,6 @@ readline.new() -> @Readline
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -21,8 +21,8 @@ Hilbish functions.
|
||||
<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 dark:text-white'><a href="#new">new() -> @Snail</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Creates a new Snail instance.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#new">new() -> @Snail</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Creates a new Snail instance.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -40,7 +40,6 @@ snail.new() -> @Snail
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -18,20 +18,20 @@ The terminal library is a simple and lower level library for certain terminal in
|
||||
<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 dark:text-white'><a href="#restoreState">restoreState()</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Restores the last saved state of the terminal</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#restoreState">restoreState()</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Restores the last saved state of the terminal</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 dark:text-white'><a href="#saveState">saveState()</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Saves the current state of the terminal.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#saveState">saveState()</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Saves the current state of the terminal.</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 dark:text-white'><a href="#setRaw">setRaw()</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Puts the terminal into raw mode.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#setRaw">setRaw()</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Puts the terminal into raw 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 dark:text-white'><a href="#size">size()</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Gets the dimensions of the terminal. Returns a table with `width` and `height`</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#size">size()</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Gets the dimensions of the terminal. Returns a table with `width` and `height`</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -49,7 +49,6 @@ terminal.restoreState()
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -69,7 +68,6 @@ terminal.saveState()
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -89,7 +87,6 @@ terminal.setRaw()
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
@ -109,7 +106,6 @@ terminal.size()
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -30,8 +30,8 @@ t 'printing from another lua state!'
|
||||
<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 dark:text-white'><a href="#thread">thread(fun) -> @Thread</a></td>
|
||||
<td class='p-3 font-medium text-black dark:text-white'>Creates a new, fresh Yarn thread.</td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'><a href="#thread">thread(fun) -> @Thread</a></td>
|
||||
<td class='p-3 font-medium text-black whitespace-nowrap dark:text-white'>Creates a new, fresh Yarn thread.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -49,7 +49,6 @@ yarn.thread(fun) -> @Thread
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
```
|
||||
|
||||
|
@ -3,14 +3,15 @@
|
||||
Bait is the event emitter for Hilbish. Much like Node.js and
|
||||
its `events` system, many actions in Hilbish emit events.
|
||||
Unlike Node.js, Hilbish events are global. So make sure to
|
||||
pick a unique name!<nl>
|
||||
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.<nl>
|
||||
You can act on events via callback functions.
|
||||
|
||||
Examples of this are in the Hilbish default config!
|
||||
Consider this part of it:
|
||||
|
||||
```lua
|
||||
bait.catch('command.exit', function(code)
|
||||
running = false
|
||||
@ -29,12 +30,11 @@ import (
|
||||
|
||||
"hilbish/util"
|
||||
|
||||
"github.com/arnodel/golua/lib/packagelib"
|
||||
rt "github.com/arnodel/golua/runtime"
|
||||
"github.com/arnodel/golua/lib/packagelib"
|
||||
)
|
||||
|
||||
type listenerType int
|
||||
|
||||
const (
|
||||
goListener listenerType = iota
|
||||
luaListener
|
||||
@ -93,10 +93,8 @@ func (b *Bait) Emit(event string, args ...interface{}) []rt.Value {
|
||||
for _, arg := range args {
|
||||
var luarg rt.Value
|
||||
switch arg.(type) {
|
||||
case rt.Value:
|
||||
luarg = arg.(rt.Value)
|
||||
default:
|
||||
luarg = rt.AsValue(arg)
|
||||
case rt.Value: luarg = arg.(rt.Value)
|
||||
default: luarg = rt.AsValue(arg)
|
||||
}
|
||||
luaArgs = append(luaArgs, luarg)
|
||||
}
|
||||
@ -210,6 +208,7 @@ func (b *Bait) addListener(event string, listener *Listener) {
|
||||
b.handlers[event] = append(b.handlers[event], listener)
|
||||
}
|
||||
|
||||
|
||||
func (b *Bait) removeListener(event string, idx int) {
|
||||
b.handlers[event][idx] = b.handlers[event][len(b.handlers[event]) - 1]
|
||||
|
||||
@ -295,9 +294,7 @@ func (b *Bait) bhooks(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
|
||||
luaHandlers := rt.NewTable()
|
||||
for _, handler := range handlers {
|
||||
if handler.typ != luaListener {
|
||||
continue
|
||||
}
|
||||
if handler.typ != luaListener { continue }
|
||||
luaHandlers.Set(rt.IntValue(luaHandlers.Len() + 1), rt.FunctionValue(handler.luaCaller))
|
||||
}
|
||||
|
||||
|
@ -15,24 +15,29 @@ end)
|
||||
|
||||
In this example, a command with the name of `hello` is created
|
||||
that will print `Hello world!` to output. One question you may
|
||||
have is: What is the `sinks` parameter?<nl>
|
||||
have is: What is the `sinks` parameter?
|
||||
|
||||
The `sinks` parameter is a table with 3 keys: `input`, `out`, and `err`.
|
||||
There is an `in` alias to `input`, but it requires using the string accessor syntax (`sinks['in']`)
|
||||
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.<nl>
|
||||
- `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.
|
||||
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.
|
||||
*/
|
||||
package commander
|
||||
|
||||
import (
|
||||
"hilbish/golibs/bait"
|
||||
"hilbish/util"
|
||||
"hilbish/golibs/bait"
|
||||
|
||||
"github.com/arnodel/golua/lib/packagelib"
|
||||
rt "github.com/arnodel/golua/runtime"
|
||||
"github.com/arnodel/golua/lib/packagelib"
|
||||
)
|
||||
|
||||
type Commander struct{
|
||||
|
@ -4,17 +4,23 @@ description: Steps on how to install Hilbish on all the OSes and distros support
|
||||
layout: page
|
||||
---
|
||||
|
||||
There are a small amount of ways to grab Hilbish. You can download the releases from GitHub, use your package manager, or build from source.
|
||||
|
||||
## Official Binaries
|
||||
|
||||
The easiest way to get Hilbish is to get a build directly from GitHub.
|
||||
At any time, there are 2 versions of Hilbish available to install:
|
||||
the latest stable release, and development builds from the master branch.\
|
||||
You can download both at any time, but note that the development builds may have breaking changes.\
|
||||
To download the latest stable release, [see here](https://github.com/Rosettea/Hilbish/releases/latest)
|
||||
The best way to get Hilbish is to get a build directly from GitHub.
|
||||
|
||||
For the latest development build, [click here](https://nightly.link/Rosettea/Hilbish/workflows/build/master)
|
||||
At any time, there are 2 versions of Hilbish available to install:
|
||||
the latest stable release, and development builds from the master branch.
|
||||
|
||||
You can download both at any time, but note that the development builds may
|
||||
have breaking changes.
|
||||
|
||||
For the latest *stable release*, check here: https://github.com/Rosettea/Hilbish/releases/latest
|
||||
|
||||
For a *development build*: https://nightly.link/Rosettea/Hilbish/workflows/build/master
|
||||
|
||||
## Compiling
|
||||
|
||||
To read the steps for compiling Hilbish, head over to the [GitHub repository.](https://github.com/Rosettea/Hilbish#build)
|
||||
|
||||
## Package Repositories
|
||||
|
||||
@ -41,7 +47,3 @@ Or, from master branch: `yay -S hilbish-git`
|
||||
|
||||
Hilbish is currentlty in the testing/edge repository for Alpine.
|
||||
Follow the steps [here](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository) (using testing repositories) and install: `apk add hilbish`
|
||||
|
||||
## Compiling From Source
|
||||
|
||||
To see steps on compiling Hilbish from source, [visit the GitHub repository](https://github.com/Rosettea/Hilbish#build)
|
||||
|
@ -21,7 +21,7 @@ pub fn page(
|
||||
this_slug: String,
|
||||
doc_pages_list,
|
||||
) -> element.Element(a) {
|
||||
html.div([attribute.class("flex-1 flex flex-col overflow-hidden")], [
|
||||
html.div([attribute.class("flex-auto flex flex-col overflow-none")], [
|
||||
html.div(
|
||||
[
|
||||
attribute.class(
|
||||
@ -43,7 +43,7 @@ pub fn page(
|
||||
html.span([attribute.class("font-bold")], [element.text(p.title)]),
|
||||
],
|
||||
),
|
||||
html.div([attribute.class("flex-1 sm:flex grid overflow-hidden")], [
|
||||
html.div([attribute.class("h-full sm:flex grid")], [
|
||||
html.input([
|
||||
attribute.type_("checkbox"),
|
||||
attribute.id("sidebar-toggle"),
|
||||
@ -52,7 +52,7 @@ pub fn page(
|
||||
html.div(
|
||||
[
|
||||
attribute.class(
|
||||
"overflow-y-scroll p-4 sm:border-r sm:border-r-zinc-300 col-start-1 row-start-1 bg-neutral-100 dark:bg-neutral-950 basis-2/10 transition-transform duration-300 -translate-x-full peer-checked:translate-x-0 sm:translate-x-0 z-30",
|
||||
"p-4 sm:border-r sm:border-r-zinc-300 col-start-1 row-start-1 bg-neutral-100 dark:bg-neutral-950 basis-2/10 transition-transform duration-300 -translate-x-full peer-checked:translate-x-0 sm:translate-x-0 z-30",
|
||||
),
|
||||
],
|
||||
[
|
||||
@ -187,24 +187,18 @@ pub fn page(
|
||||
html.main(
|
||||
[
|
||||
attribute.class(
|
||||
"flex-1 flex justify-center basis-7/7 col-start-1 row-start-1 transition-all duration-300 peer-checked:filter peer-checked:blur-sm peer-checked:bg-black/30",
|
||||
"mb-4 h-full overflow-y-auto basis-7/7 col-start-1 row-start-1 transition-all duration-300 peer-checked:filter peer-checked:blur-sm peer-checked:bg-black/30 px-4 pt-2",
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div([attribute.class("flex-1 flex flex-col overflow-y-auto")], [
|
||||
html.h1([attribute.class("my-3 font-bold text-4xl")], [
|
||||
element.text(p.title),
|
||||
]),
|
||||
// todo: add date of publishing
|
||||
//html.time([], [])
|
||||
//html.small([], [element.text({{p.contents |> string.split(" ") |> list.length} / 200} |> int.to_string <> " min read")]),
|
||||
//element.unsafe_raw_html("namespace", "Tag", [], render_doc(p.contents))
|
||||
html.div([attribute.class("flex-1 w-3/4 self-center p-8")], [
|
||||
html.h1([attribute.class("my-3 font-bold text-4xl")], [
|
||||
element.text(p.title),
|
||||
]),
|
||||
html.i([], [element.text(p.description)]),
|
||||
..render_doc(p.contents)
|
||||
]),
|
||||
util.footer(),
|
||||
]),
|
||||
],
|
||||
),
|
||||
]),
|
||||
@ -224,8 +218,7 @@ fn render_doc(md: String) {
|
||||
}
|
||||
|
||||
let margin = case level {
|
||||
1 -> "my-4"
|
||||
2 -> "my-2"
|
||||
1 -> "my-2"
|
||||
_ -> "my-1"
|
||||
}
|
||||
|
||||
|
@ -14,9 +14,7 @@ pub fn page() -> element.Element(a) {
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div(
|
||||
[attribute.class("gap-1 flex flex-col items-center text-center")],
|
||||
[
|
||||
html.div([attribute.class("gap-1 flex flex-col items-center")], [
|
||||
html.span(
|
||||
[attribute.class("flex flex-row items-center justify-center")],
|
||||
[
|
||||
@ -32,8 +30,7 @@ pub fn page() -> element.Element(a) {
|
||||
html.p([attribute.class("text-6xl font-light")], [
|
||||
element.text("Something Unique."),
|
||||
]),
|
||||
],
|
||||
),
|
||||
]),
|
||||
html.p([attribute.class("text-center")], [
|
||||
element.text(
|
||||
"Hilbish is the new Moon-powered interactive shell for Lua fans!",
|
||||
@ -58,7 +55,7 @@ pub fn page() -> element.Element(a) {
|
||||
]),
|
||||
],
|
||||
),
|
||||
html.div([attribute.class("py-4 text-center border-b border-b-zinc-300")], [
|
||||
html.div([attribute.class("text-center")], [
|
||||
html.span(
|
||||
[
|
||||
attribute.class(
|
||||
@ -71,14 +68,14 @@ pub fn page() -> element.Element(a) {
|
||||
html.div(
|
||||
[
|
||||
attribute.class(
|
||||
"min-h-screen flex flex-col justify-around items-center gap-6",
|
||||
"flex flex-col justify-center items-center gap-6 mt-4",
|
||||
),
|
||||
],
|
||||
[
|
||||
html.h1(
|
||||
[
|
||||
attribute.class(
|
||||
"mt-3 text-5xl gap-2 font-bold inline-flex flex-wrap justify-center items-center",
|
||||
"mt-3 text-5xl gap-2 font-bold inline-flex justify-center items-center",
|
||||
),
|
||||
],
|
||||
[
|
||||
@ -136,7 +133,7 @@ pub fn page() -> element.Element(a) {
|
||||
html.div(
|
||||
[
|
||||
attribute.class(
|
||||
"-mx-4 px-4 py-8 -mt-4 text-center border-b border-b-zinc-300 bg-neutral-100 dark:bg-neutral-900",
|
||||
"border-t border-t-zinc-300 text-center bg-neutral-100 dark:bg-neutral-900 -mx-4 p-4",
|
||||
),
|
||||
],
|
||||
[
|
||||
@ -148,15 +145,12 @@ pub fn page() -> element.Element(a) {
|
||||
],
|
||||
[element.text("Download It Now!")],
|
||||
),
|
||||
html.div(
|
||||
[attribute.class("h-full flex flex-col items-center mt-8 gap-6")],
|
||||
[
|
||||
html.div([attribute.class("flex flex-col items-center mt-4 gap-2")], [
|
||||
html.p([attribute.class("md:w-3/6")], [
|
||||
element.text(
|
||||
"To find out all that Hilbish can do, you should just try it out! It's officially available on Linux, MacOS, Windows, and probably builds on anything Go is available on!",
|
||||
),
|
||||
]),
|
||||
html.div([attribute.class("sm:w-1/2 text-center")], [
|
||||
html.h2([attribute.class("text-3xl font-semibold")], [
|
||||
element.text("Featured Downloads"),
|
||||
]),
|
||||
@ -165,7 +159,6 @@ pub fn page() -> element.Element(a) {
|
||||
"These are \"portable\" binary releases of Hilbish from GitHub. All the required files are in the archive. Put it somewhere, add the directory to your $PATH, and use Hilbish.",
|
||||
),
|
||||
]),
|
||||
]),
|
||||
html.div(
|
||||
[
|
||||
attribute.class(
|
||||
@ -173,12 +166,12 @@ pub fn page() -> element.Element(a) {
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div([attribute.class("flex flex-col gap-2 items-center")], [
|
||||
html.div([attribute.class("flex flex-col gap-2")], [
|
||||
html.img([
|
||||
attribute.src(
|
||||
"https://upload.wikimedia.org/wikipedia/commons/thumb/3/35/Tux.svg/1200px-Tux.svg.png",
|
||||
),
|
||||
attribute.class("h-28 w-fit"),
|
||||
attribute.class("h-36"),
|
||||
]),
|
||||
button(
|
||||
"Linux (64-bit)",
|
||||
@ -186,12 +179,12 @@ pub fn page() -> element.Element(a) {
|
||||
download_link("linux", "amd64"),
|
||||
),
|
||||
]),
|
||||
html.div([attribute.class("flex flex-col gap-2 items-center")], [
|
||||
html.div([attribute.class("flex flex-col gap-2")], [
|
||||
html.img([
|
||||
attribute.src(
|
||||
"https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Unofficial_Windows_logo_variant_-_2002%E2%80%932012_%28Multicolored%29.svg/2321px-Unofficial_Windows_logo_variant_-_2002%E2%80%932012_%28Multicolored%29.svg.png",
|
||||
),
|
||||
attribute.class("h-28 h-28 w-fit"),
|
||||
attribute.class("h-36"),
|
||||
]),
|
||||
button(
|
||||
"Windows (64-bit)",
|
||||
@ -210,7 +203,7 @@ pub fn page() -> element.Element(a) {
|
||||
attribute.src(
|
||||
"https://images.seeklogo.com/logo-png/38/2/apple-mac-os-logo-png_seeklogo-381401.png",
|
||||
),
|
||||
attribute.class("h-28 h-28 w-fit"),
|
||||
attribute.class("h-36"),
|
||||
]),
|
||||
button(
|
||||
"MacOS (64-bit)",
|
||||
@ -230,7 +223,7 @@ pub fn page() -> element.Element(a) {
|
||||
attribute.src(
|
||||
"https://images.seeklogo.com/logo-png/38/2/apple-mac-os-logo-png_seeklogo-381401.png",
|
||||
),
|
||||
attribute.class("h-28 h-28 w-fit"),
|
||||
attribute.class("h-36"),
|
||||
]),
|
||||
button(
|
||||
"MacOS (ARM)",
|
||||
@ -242,8 +235,7 @@ pub fn page() -> element.Element(a) {
|
||||
],
|
||||
),
|
||||
util.link(conf.base_url_join("/install"), "Other Downloads", True),
|
||||
],
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
])
|
||||
|
@ -4,7 +4,6 @@ import gleam/option
|
||||
pub type Post {
|
||||
Post(
|
||||
name: String,
|
||||
description: String,
|
||||
title: String,
|
||||
slug: String,
|
||||
metadata: option.Option(glaml.Document),
|
||||
|
@ -6,7 +6,6 @@ import lustre/attribute
|
||||
import lustre/element
|
||||
import lustre/element/html
|
||||
|
||||
import conf
|
||||
import glaml
|
||||
import post
|
||||
|
||||
@ -69,77 +68,3 @@ pub fn link(url: String, text: String, out: Bool) {
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
pub fn nav() -> element.Element(a) {
|
||||
html.nav(
|
||||
[
|
||||
attribute.class(
|
||||
"bg-stone-100/80 dark:bg-neutral-950/80 flex justify-around sticky items-center top-0 w-full z-50 border-b border-b-zinc-300 backdrop-blur-md h-12",
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div([attribute.class("flex my-auto px-2")], [
|
||||
html.div([], [
|
||||
html.a(
|
||||
[
|
||||
attribute.href(conf.base_url_join("/")),
|
||||
attribute.class("flex items-center gap-1"),
|
||||
],
|
||||
[
|
||||
html.img([
|
||||
attribute.src(conf.base_url_join("/hilbish-flower.png")),
|
||||
attribute.class("h-8"),
|
||||
]),
|
||||
html.span([attribute.class("self-center text-3xl font-medium")], [
|
||||
element.text("Hilbish"),
|
||||
]),
|
||||
],
|
||||
),
|
||||
]),
|
||||
]),
|
||||
html.div([attribute.class("flex gap-3")], [
|
||||
link(conf.base_url_join("/install"), "Install", False),
|
||||
link(conf.base_url_join("/docs"), "Docs", False),
|
||||
link(conf.base_url_join("/blog"), "Blog", False),
|
||||
]),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
pub fn footer() -> element.Element(a) {
|
||||
html.footer(
|
||||
[
|
||||
attribute.class(
|
||||
"py-4 px-6 flex flex-row justify-around border-t border-t-zinc-300",
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div([attribute.class("flex flex-col")], [
|
||||
html.a(
|
||||
[
|
||||
attribute.href(conf.base_url),
|
||||
attribute.class("flex items-center gap-1"),
|
||||
],
|
||||
[
|
||||
html.img([
|
||||
attribute.src(conf.base_url_join("/hilbish-flower.png")),
|
||||
attribute.class("h-24"),
|
||||
]),
|
||||
html.span([attribute.class("self-center text-6xl")], [
|
||||
element.text("Hilbish"),
|
||||
]),
|
||||
],
|
||||
),
|
||||
html.span([attribute.class("text-xl")], [
|
||||
element.text("The Moon-powered shell!"),
|
||||
]),
|
||||
html.span([attribute.class("text-light text-neutral-500")], [
|
||||
element.text("MIT License, copyright sammyette 2025"),
|
||||
]),
|
||||
]),
|
||||
html.div([attribute.class("flex flex-col")], [
|
||||
link("https://github.com/Rosettea/Hilbish", "GitHub", True),
|
||||
]),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
@ -56,20 +56,8 @@ pub fn main() {
|
||||
option.None -> ""
|
||||
}
|
||||
|
||||
let description = case metadata {
|
||||
option.Some(metadata) -> {
|
||||
case
|
||||
glaml.select_sugar(glaml.document_root(metadata), "description")
|
||||
{
|
||||
Ok(glaml.NodeStr(s)) -> s
|
||||
_ -> ""
|
||||
}
|
||||
}
|
||||
option.None -> ""
|
||||
}
|
||||
|
||||
let assert Ok(filename) = path |> string.split("/") |> list.last
|
||||
#(slug, post.Post(name, description, title, slug, metadata, content))
|
||||
#(slug, post.Post(name, title, slug, metadata, content))
|
||||
})
|
||||
|
||||
let doc_pages =
|
||||
@ -90,18 +78,14 @@ pub fn main() {
|
||||
let build =
|
||||
ssg.new("./public")
|
||||
|> ssg.add_static_dir("static")
|
||||
|> ssg.add_static_route("/", create_page(index.page(), False))
|
||||
|> ssg.add_static_route("/", create_page(index.page()))
|
||||
|> list.fold(posts, _, fn(config, post) {
|
||||
let page = case is_doc_page(post.0) {
|
||||
True -> doc.page(post.1, post.0, doc_pages)
|
||||
False -> doc.page(post.1, post.0, doc_pages)
|
||||
}
|
||||
//io.debug(post.0)
|
||||
ssg.add_static_route(
|
||||
config,
|
||||
post.0,
|
||||
create_page(page, is_doc_page(post.0)),
|
||||
)
|
||||
ssg.add_static_route(config, post.0, create_page(page))
|
||||
})
|
||||
|> ssg.use_index_routes
|
||||
|> ssg.build
|
||||
@ -122,10 +106,78 @@ fn is_doc_page(slug: String) {
|
||||
}
|
||||
}
|
||||
|
||||
fn create_page(
|
||||
content: element.Element(a),
|
||||
doc_page: Bool,
|
||||
) -> element.Element(a) {
|
||||
fn nav() -> element.Element(a) {
|
||||
html.nav(
|
||||
[
|
||||
attribute.class(
|
||||
"bg-stone-100/80 dark:bg-neutral-950/80 flex justify-around sticky items-center top-0 w-full z-50 border-b border-b-zinc-300 backdrop-blur-md h-12",
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div([attribute.class("flex my-auto px-2")], [
|
||||
html.div([], [
|
||||
html.a(
|
||||
[attribute.href("/"), attribute.class("flex items-center gap-1")],
|
||||
[
|
||||
html.img([
|
||||
attribute.src(conf.base_url_join("/hilbish-flower.png")),
|
||||
attribute.class("h-8"),
|
||||
]),
|
||||
html.span([attribute.class("self-center text-3xl font-medium")], [
|
||||
element.text("Hilbish"),
|
||||
]),
|
||||
],
|
||||
),
|
||||
]),
|
||||
]),
|
||||
html.div([attribute.class("flex gap-3")], [
|
||||
util.link(conf.base_url_join("/install"), "Install", False),
|
||||
util.link(conf.base_url_join("/docs"), "Docs", False),
|
||||
util.link(conf.base_url_join("/blog"), "Blog", False),
|
||||
]),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
fn footer() -> element.Element(a) {
|
||||
html.footer(
|
||||
[
|
||||
attribute.class(
|
||||
"py-4 px-6 flex flex-row justify-around border-t border-t-zinc-300",
|
||||
),
|
||||
],
|
||||
[
|
||||
html.div([attribute.class("flex flex-col")], [
|
||||
html.a(
|
||||
[
|
||||
attribute.href(conf.base_url),
|
||||
attribute.class("flex items-center gap-1"),
|
||||
],
|
||||
[
|
||||
html.img([
|
||||
attribute.src(conf.base_url_join("/hilbish-flower.png")),
|
||||
attribute.class("h-24"),
|
||||
]),
|
||||
html.span([attribute.class("self-center text-6xl")], [
|
||||
element.text("Hilbish"),
|
||||
]),
|
||||
],
|
||||
),
|
||||
html.span([attribute.class("text-xl")], [
|
||||
element.text("The Moon-powered shell!"),
|
||||
]),
|
||||
html.span([attribute.class("text-light text-neutral-500")], [
|
||||
element.text("MIT License, copyright sammyette 2025"),
|
||||
]),
|
||||
]),
|
||||
html.div([attribute.class("flex flex-col")], [
|
||||
util.link("https://github.com/Rosettea/Hilbish", "GitHub", True),
|
||||
]),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
fn create_page(content: element.Element(a)) -> element.Element(a) {
|
||||
let description =
|
||||
"Something Unique. Hilbish is the new interactive shell for Lua fans. Extensible, scriptable, configurable: All in Lua."
|
||||
|
||||
@ -184,13 +236,10 @@ fn create_page(
|
||||
attribute.attribute("property", "og:url"),
|
||||
]),
|
||||
]),
|
||||
html.body([attribute.class("h-screen flex flex-col")], [
|
||||
util.nav(),
|
||||
html.body([attribute.class("min-h-screen flex flex-col")], [
|
||||
nav(),
|
||||
content,
|
||||
case doc_page {
|
||||
True -> element.none()
|
||||
False -> util.footer()
|
||||
},
|
||||
footer(),
|
||||
]),
|
||||
],
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user