2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-01 08:42:04 +00:00

Compare commits

...

6 Commits

40 changed files with 468 additions and 711 deletions

View File

@ -486,7 +486,7 @@ func main() {
f.WriteString(`---
title: API
layout: doc
weight: -100
weight: -70
menu: docs
---
@ -649,7 +649,7 @@ func generateFile(v module) {
typ = p.Type[3:]
}
f.WriteString(fmt.Sprintf("`%s` `*%s*`", typ, p.Name))
f.WriteString(fmt.Sprintf("`%s` _%s_", typ, p.Name))
if isVariadic {
f.WriteString(" (This type is variadic. You can pass an infinite amount of parameters with this type.)")
}

View File

@ -1,7 +1,7 @@
---
title: API
layout: doc
weight: -100
weight: -70
menu: docs
---

View File

@ -82,10 +82,10 @@ Catches an event. This function can be used to act on events.
#### Parameters
`string` `*name*`
`string` _name_
The name of the hook.
`function` `*cb*`
`function` _cb_
The function that will be called when the hook is thrown.
#### Example
@ -113,10 +113,10 @@ Catches an event, but only once. This will remove the hook immediately after it
#### Parameters
`string` `*name*`
`string` _name_
The name of the event
`function` `*cb*`
`function` _cb_
The function that will be called when the event is thrown.
@ -137,7 +137,7 @@ Returns a table of functions that are hooked on an event with the corresponding
#### Parameters
`string` `*name*`
`string` _name_
The name of the hook
@ -160,10 +160,10 @@ an event, like one saved to a variable.
#### Parameters
`string` `*name*`
`string` _name_
Name of the event the hook is on
`function` `*catcher*`
`function` _catcher_
Hook function to remove
#### Example
@ -195,10 +195,10 @@ Throws a hook with `name` with the provided `args`.
#### Parameters
`string` `*name*`
`string` _name_
The name of the hook.
`any` `*args*` (This type is variadic. You can pass an infinite amount of parameters with this type.)
`any` _args_ (This type is variadic. You can pass an infinite amount of parameters with this type.)
The arguments to pass to the hook.
#### Example

View File

@ -81,7 +81,7 @@ Removes the named command. Note that this will only remove Commander-registered
#### Parameters
`string` `*name*`
`string` _name_
Name of the command to remove.
@ -103,10 +103,10 @@ it will run the function providing the arguments and sinks.
#### Parameters
`string` `*name*`
`string` _name_
Name of the command
`function` `*cb*`
`function` _cb_
Callback to handle command invocation
#### Example

View File

@ -99,7 +99,7 @@ This can be used to resolve short paths like `..` to `/home/user`.
#### Parameters
`string` `*path*`
`string` _path_
@ -121,7 +121,7 @@ Returns the "basename," or the last part of the provided `path`. If path is empt
#### Parameters
`string` `*path*`
`string` _path_
Path to get the base name of.
@ -142,7 +142,7 @@ Changes Hilbish's directory to `dir`.
#### Parameters
`string` `*dir*`
`string` _dir_
Path to change directory to.
@ -164,7 +164,7 @@ Returns the directory part of `path`. If a file path like
#### Parameters
`string` `*path*`
`string` _path_
Path to get the directory for.
@ -186,7 +186,7 @@ For the syntax' refer to Go's filepath.Match function: https://pkg.go.dev/path/f
#### Parameters
`string` `*pattern*`
`string` _pattern_
Pattern to compare files with.
#### Example
@ -221,7 +221,7 @@ Takes any list of paths and joins them based on the operating system's path sepa
#### Parameters
`string` `*path*` (This type is variadic. You can pass an infinite amount of parameters with this type.)
`string` _path_ (This type is variadic. You can pass an infinite amount of parameters with this type.)
Paths to join together
#### Example
@ -250,10 +250,10 @@ With `recursive`, mkdir will create parent directories.
#### Parameters
`string` `*name*`
`string` _name_
Name of the directory
`boolean` `*recursive*`
`boolean` _recursive_
Whether to create parent directories for the provided name
#### Example
@ -301,7 +301,7 @@ Returns a list of all files and directories in the provided path.
#### Parameters
`string` `*dir*`
`string` _dir_
@ -327,7 +327,7 @@ isDir (boolean) - If the path is a directory
#### Parameters
`string` `*path*`
`string` _path_
#### Example

View File

@ -104,10 +104,10 @@ Sets an alias, with a name of `cmd` to another command.
#### Parameters
`string` `*cmd*`
`string` _cmd_
Name of the alias
`string` `*orig*`
`string` _orig_
Command that will be aliased
#### Example
@ -138,7 +138,7 @@ Appends the provided dir to the command path (`$PATH`)
#### Parameters
`string|table` `*dir*`
`string|table` _dir_
Directory (or directories) to append to path
#### Example
@ -175,10 +175,10 @@ provides more details.
#### Parameters
`string` `*scope*`
`string` _scope_
`function` `*cb*`
`function` _cb_
#### Example
@ -246,7 +246,7 @@ This can be used to do an in-place restart.
#### Parameters
`string` `*cmd*`
`string` _cmd_
@ -270,7 +270,7 @@ This can be used to run any function in another thread at the same time as other
#### Parameters
`function` `*fn*`
`function` _fn_
@ -295,7 +295,7 @@ Note that to set a highlighter, one has to override this function.
#### Parameters
`string` `*line*`
`string` _line_
#### Example
@ -330,10 +330,10 @@ override this function with your custom handler.
#### Parameters
`string` `*line*`
`string` _line_
`number` `*pos*`
`number` _pos_
Position of cursor in line. Usually equals string.len(line)
#### Example
@ -364,7 +364,7 @@ Vim-like with modes and Vim keybinds.
#### Parameters
`string` `*mode*`
`string` _mode_
Can be set to either `emacs` or `vim`
@ -386,10 +386,10 @@ This creates a timer that ticking immediately.
#### Parameters
`function` `*cb*`
`function` _cb_
`number` `*time*`
`number` _time_
Time in milliseconds.
@ -411,7 +411,7 @@ This will show up when text is incomplete, like a missing quote
#### Parameters
`string` `*str*`
`string` _str_
#### Example
@ -451,7 +451,7 @@ Prepends `dir` to $PATH.
#### Parameters
`string` `*dir*`
`string` _dir_
@ -477,10 +477,10 @@ These will be formatted and replaced with the appropriate values.
#### Parameters
`string` `*str*`
`string` _str_
`string` `*typ?*`
`string` _typ?_
Type of prompt, being left or right. Left by default.
#### Example
@ -512,7 +512,7 @@ Returns `input`, will be nil if Ctrl-D is pressed, or an error occurs.
#### Parameters
`string` `*prompt?*`
`string` _prompt?_
Text to print before input, can be empty.
@ -534,10 +534,10 @@ This creates a Timer that starts ticking immediately.
#### Parameters
`function` `*cb*`
`function` _cb_
`number` `*time*`
`number` _time_
Time to run in milliseconds.
@ -559,7 +559,7 @@ Will return the path of the binary, or a basename if it's a commander.
#### Parameters
`string` `*name*`
`string` _name_

View File

@ -12,31 +12,35 @@ function. See the link for how to use it.
To create completions for a command is simple.
The callback will be passed 3 parameters:
- `query` (string): The text that the user is currently trying to complete.
This should be used to match entries.
- `ctx` (string): Contains the entire line. Use this if
more text is needed to be parsed for context.
- `query` (string): The text that the user is currently trying to complete. This should be used to match entries.
- `ctx` (string): Contains the entire line. Use this if more text is needed to be parsed for context.
- `fields` (string): The `ctx` split up by spaces.
\
In most cases, the completer just uses `fields` to check the amount
and `query` on what to match entries on.
and `query` on what to match entries on.\
\
In order to return your results, it has to go within a "completion group."
Then you return a table of completion groups and a prefix. The prefix will
usually just be the `query`.
usually just be the `query`.\
\
Hilbish allows one to mix completion menus of different types, so
a grid menu and a list menu can be used and complete and display at the same time.
A completion group is a table with these keys:
- `type` (string): type of completion menu, either `grid` or `list`.
- `items` (table): a list of items.
\
The requirements of the `items` table is different based on the
`type`. If it is a `grid`, it can simply be a table of strings.
`type`. If it is a `grid`, it can simply be a table of strings.\
Otherwise if it is a `list` then each entry can
either be a string or a table.
either be a string or a table.\
\
Example:
```lua
local cg = {
items = {
@ -57,11 +61,14 @@ Which looks like this:
{{< video src="https://safe.saya.moe/t4CiLK6dgPbD.mp4" >}}
# Completion Group Types
### grid
Grid is the simplest completion group type. All items are strings and when
completion is done is displayed in a grid based on size.
### grid
Grid is the simplest completion group type. All items are strings and when
completion is done is displayed in a grid based on size.\
\
Example:
```lua
{
items = {'just', 'a bunch', 'of items', 'here', 'hehe'},
@ -70,17 +77,16 @@ Example:
```
### list
The list completion group type displays in a list. A list item can either be a string, or a table for additional display options.
The list completion group type displays in a list. A list item can either be a string, or a table for additional display options.\
A completion alias can be specified either as the `2nd` entry in the options table
or te `alias` key.
or te `alias` key.\
A description can optionally be displayed for a list item, which is either the `1st`
entry or the `description` key.
Lastly, list entries can be styled. This is done with the `display` key. If this is present, this
overrides what the completion item *looks* like.
entry or the `description` key.\
Lastly, list entries can be styled. This is done with the `display` key. If this is present, this overrides what the completion item _looks_ like.\
\
Example:
```lua
{
items = {
@ -101,18 +107,22 @@ Example:
```
# Completion Handler
Like most parts of Hilbish, it's made to be extensible and
customizable. The default handler for completions in general can
be overwritten to provide more advanced completions if needed.
This usually doesn't need to be done though, unless you know
what you're doing.
The default completion handler provides 3 things:
binaries (with a plain name requested to complete, those in
$PATH), files, or command completions. It will try to run a handler
for the command or fallback to file completions.
what you're doing.\
\
The default completion handler provides 3 things:\
binaries (with a plain name requested to complete, those in $PATH)\
files\
or command completions.\
\
It will try to run a handler for the command or fallback to file completions.\
\
To overwrite it, just assign a function to `hilbish.completion.handler` like so:
```lua
-- line is the entire line as a string
-- pos is the position of the cursor.

View File

@ -6,21 +6,25 @@ menu: docs
---
# Is Hilbish POSIX compliant?
No, it is not. POSIX compliance is a non-goal. Perhaps in the future,
someone would be able to write a native plugin to support shell scripting
(which would be against it's main goal, but ....)
# Windows Support?
It compiles for Windows (CI ensures it does), but otherwise it is not
directly supported. If you'd like to improve this situation,
checkout [the discussion](https://github.com/Rosettea/Hilbish/discussions/165).
# Why?
Hilbish emerged from the desire of a Lua configured shell.
It was the initial reason that it was created, but now it's more:
to be hyper extensible, simpler and more user friendly.
# Does it have "autocompletion" or "tab completion"
Of course! This is a modern shell. Hilbish provides a way for users
to write tab completion for any command and/or the whole shell.
Inline hinting and syntax highlighting are also available.

View File

@ -9,31 +9,30 @@ menu:
Hilbish features a simple notification system which can be
used by other plugins and parts of the shell to notify the user
of various actions. This is used via the `hilbish.message` interface.
of various actions. This is used via the `hilbish.message` interface.\
\
A `message` is defined as a table with the following properties:
- `icon`: A unicode/emoji icon for the notification.
- `title`: The title of the message
- `text`: Message text/body
- `channel`: The source of the message. This should be a
unique and easily readable text identifier.
- `summary`: A short summary of the notification and message.
If this is not present and you are using this to display messages,
you should take part of the `text` instead.
- `channel`: The source of the message. This should be a unique and easily readable text identifier.
- `summary`: A short summary of the notification and message. If this is not present and you are using this to display messages, you should take part of the `text` instead.
\
The `hilbish.message` interface provides the following functions:
- `send(message)`: Sends a message and emits the `hilbish.notification`
signal. DO NOT emit the `hilbish.notification` signal directly, or
the message will not be stored by the message handler.
- `send(message)`: Sends a message and emits the `hilbish.notification` signal. DO NOT emit the `hilbish.notification` signal directly, or the message will not be stored by the message handler.
- `read(idx)`: Marks message at `idx` as read.
- `delete(idx)`: Removes message at `idx`.
- `readAll()`: Marks all messages as read.
- `clear()`: Deletes all messages.
\
There are a few simple use cases of this notification/messaging system.
It could also be used as some "inter-shell" messaging system (???) but
is intended to display to users.
is intended to display to users.\
\
An example is notifying users of completed jobs/commands ran in the background.
Any Hilbish-native command (think the upcoming Greenhouse pager) can display
it.

View File

@ -9,19 +9,22 @@ menu:
Opts are simple toggle or value options a user can set in Hilbish.
As toggles, there are things like `autocd` or history saving. As values,
there is the `motd` which the user can either change to a custom string or disable.
there is the `motd` which the user can either change to a custom string or disable.\
\
Opts are accessed from the `hilbish.opts` table. Here they can either
be read or modified
be read or modified.
### `autocd`
#### Value: `boolean`
#### Default: `false`
The autocd opt makes it so that lone directories attempted to be executed are
instead set as the shell's directory.
Example:
```
~/Directory
∆ ~
@ -33,51 +36,81 @@ Example:
```
<hr>
``` =html
<hr class="my-4">
```
### `history`
#### Value: `boolean`
#### Default: `true`
Sets whether command history will be saved or not.
<hr>
### `greeting`
#### Value: `boolean` or `string`
The greeting is the message that Hilbish shows on startup
(the one which says Welcome to Hilbish).
``` =html
<hr class="my-4">
```
### `greeting`
#### Value: `boolean` or `string`
The greeting is the message that Hilbish shows on startup
(the one which says Welcome to Hilbish).\
This can be set to either true/false to enable/disable or a custom greeting string.
<hr>
``` =html
<hr class="my-4">
```
### `motd`
#### Value: `boolean`
#### Default: `true`
The message of the day shows the current major.minor version and
includes a small range of things added in the current release.
#### Value: `boolean`
#### Default: `true`
The message of the day shows the current major.minor version and
includes a small range of things added in the current release.\
\
This can be set to `false` to disable the message.
<hr>
``` =html
<hr class="my-4">
```
### `fuzzy`
#### Value: `boolean`
#### Default: `false`
Toggles the functionality of fuzzy history searching, usable
via the menu in Ctrl-R. Fuzzy searching is an approximate searching
method, which means results that match *closest* will be shown instead
of an exact match.
<hr>
``` =html
<hr class="my-4">
```
### `notifyJobFinish`
#### Value: `boolean`
#### Default: `true`
If this is enabled, when a background job is finished,
a [notification](../notifications) will be sent.
``` =html
<hr class="my-4">
```
### `processorSkipList`
#### Value: `table`
#### Default: `{}`
A table listing the names of command processors to skip.

View File

@ -9,45 +9,42 @@ menu:
Hilbish allows you to change how interactive text can be interpreted.
This is mainly due to the fact that the default method Hilbish uses
is that it runs Lua first and then falls back to shell script.
is that it runs Lua first and then falls back to shell script.\
\
In some cases, someone might want to switch to just shell script to avoid
it while interactive but still have a Lua config, or go full Lua to use
Hilbish as a REPL. This also allows users to add alternative languages like
Fennel as the interactive script runner.
Fennel as the interactive script runner.\
\
Runner mode can also be used to handle specific kinds of input before
evaluating like normal, which is how [Link.hsh](https://github.com/TorchedSammy/Link.hsh)
handles links.
handles links.\
\
The "runner mode" of Hilbish is customizable via `hilbish.runnerMode`,
which determines how Hilbish will run user input. By default, this is
set to `hybrid` which is the previously mentioned behaviour of running Lua
first then going to shell script. If you want the reverse order, you can
set it to `hybridRev` and for isolated modes there is `sh` and `lua`
respectively.
respectively.\
\
You can also set it to a function, which will be called everytime Hilbish
needs to run interactive input. For more detail, see the [API documentation](../../api/hilbish/hilbish.runner)
needs to run interactive input. For more detail, see the [API documentation](../../api/hilbish/hilbish.runner)\
\
The `hilbish.runner` interface is an alternative to using `hilbish.runnerMode`
and also provides the shell script and Lua runner functions that Hilbish itself uses.
## Functions
These are the "low level" functions for the `hilbish.runner` interface.
+ setMode(mode) > The same as `hilbish.runnerMode`
+ sh(input) -> table > Runs `input` in Hilbish's sh interpreter
+ lua(input) -> table > Evals `input` as Lua code
- setMode(mode) > The same as `hilbish.runnerMode`
- sh(input) -> table > Runs `input` in Hilbish's sh interpreter
- lua(input) -> table > Evals `input` as Lua code
These functions should be preferred over the previous ones.
+ setCurrent(mode) > The same as `setMode`, but works with runners managed
via the functions below.
+ add(name, runner) > Adds a runner to a table of available runners. The `runner`
argument is either a function or a table with a run callback.
+ set(name, runner) > The same as `add` but requires passing a table and
overwrites if the `name`d runner already exists.
+ get(name) > runner > Gets a runner by name. It is a table with at least a
run function, to run input.
+ exec(cmd, runnerName) > Runs `cmd` with a runner. If `runnerName` isn't passed,
the current runner mode is used.
- setCurrent(mode) > The same as `setMode`, but works with runners managed via the functions below.
- add(name, runner) > Adds a runner to a table of available runners. The `runner` argument is either a function or a table with a run callback.
- set(name, runner) > The same as `add` but requires passing a table and overwrites if the `name`d runner already exists.
- get(name) > runner > Gets a runner by name. It is a table with at least a run function, to run input.
- exec(cmd, runnerName) > Runs `cmd` with a runner. If `runnerName` isn't passed, the current runner mode is used.

View File

@ -11,7 +11,9 @@ a normal interactive session.
To exit, you can either run the `exit` command or hit Ctrl+D.
# Setting as Default
## Login shell
There are a few ways to make Hilbish your default shell. A simple way is
to make it your user/login shell.
@ -21,41 +23,40 @@ you still decide to do it, there will just be a few variables missing in
your environment` >}}
To do that, simply run `chsh -s /usr/bin/hilbish`.
Some distros (namely Fedora) might have `lchsh` instead, which is used like `lchsh <user>`.
When prompted, you can put the path for Hilbish.
## Default with terminal
The simpler way is to set the default shell for your terminal. The way of
doing this depends on how your terminal settings are configured.
## Run after login shell
Some shells (like zsh) have an rc file, like `.zlogin`, which is ran when the shell session
is a login shell. In that file, you can run Hilbish. Example:
```
exec hilbish -S -l
```
Some shells (like zsh) have an rc file, like `.zlogin`, which is ran when the shell session
is a login shell. In that file, you can run Hilbish with this command: `exec hilbish -S -l`
This will replace the shell with Hilbish, set $SHELL to Hilbish and launch it as a login shell.
# Configuration
Once installation and setup has been done, you can then configure Hilbish.
It is configured and scripted via Lua, so the config file is a Lua file.
You can use any pure Lua library to do whatever you want.
You can use any pure Lua library to do whatever you want.\
\
Hilbish's sample configuration is usually located in `hilbish.dataDir .. '/.hilbishrc.lua'`.
You can print that path via Lua to see what it is: `print(hilbish.dataDir .. '/.hilbishrc.lua')`.
As an example, it will usually will result in `/usr/share/hilbish/.hilbishrc.lua` on Linux.
To edit your user configuration, you can copy that file to `hilbish.userDir.config .. '/hilbish/init.lua'`,
which follows XDG on Linux and MacOS, and is located in %APPDATA% on Windows.
You can print that path via Lua to see what it is: `print(hilbish.dataDir .. '/.hilbishrc.lua')`.\
\
As an example, it will usually will result in `/usr/share/hilbish/.hilbishrc.lua` on Linux.\
\
To edit your user configuration, you can copy that file to `hilbish.userDir.config .. '/hilbish/init.lua'`, which follows XDG on Linux and MacOS, and is located in %APPDATA% on Windows.\
\
As the directory is usually `~/.config` on Linux, you can run this command to copy it:
`cp /usr/share/hilbish/.hilbishrc.lua ~/.config/hilbish/init.lua`
`cp /usr/share/hilbish/.hilbishrc.lua ~/.config/hilbish/init.lua`. Now we can get to customization!\
\
If we closely examine a small snippet of the default config:
Now we can get to customization!
If we closely examine a small snippet of the default config:
```lua
-- Default Hilbish config
-- .. with some omitted code .. --
@ -72,20 +73,19 @@ bait.catch('command.exit', function(code)
doPrompt(code ~= 0)
end)
```
\
We see a whopping **three** Hilbish libraries being used in this part of code.
First is of course, named after the shell itself, [`hilbish`](../api/hilbish). This is kind of a
"catch-all" namespace for functions that directly related to shell functionality/settings.
"catch-all" namespace for functions that directly related to shell functionality/settings.\
\
And as we can see, the [hilbish.prompt](../api/hilbish/#prompt) function is used
to change our prompt. Change our prompt to what, exactly?
The doc for the function states that the verbs `%u` and `%d`are used for username and current directory
of the shell, respectively.
to change our prompt. Change our prompt to what, exactly?\
The doc for the function states that the verbs `%u` and `%d` are used for username and current directory of the shell, respectively.\
We wrap this in the [`lunacolors.format`](../lunacolors) function, to give
our prompt some nice color.
our prompt some nice color.\
\
But you might have also noticed that this is in the `doPrompt` function, which is called once,
and then used again in a [bait](../api/bait) hook. Specifically, the `command.exit` hook,
which is called after a command exits, so when it finishes running.

View File

@ -8,35 +8,46 @@ menu:
---
## command.preexec
Thrown right before a command is executed.
#### Variables
`string` **`input`**
`string` _input_
The raw string that the user typed. This will include the text
without changes applied to it (argument substitution, alias expansion,
etc.)
`string` **`cmdStr`**
`string` _cmdStr_
The command that will be directly executed by the current runner.
<hr>
``` =html
<hr class="my-4">
```
## command.exit
Thrown after the user's ran command is finished.
#### Variables
`number` **`code`**
`number` _code_
The exit code of what was executed.
`string` **`cmdStr`**
`string` _cmdStr_
The command or code that was executed
<hr>
``` =html
<hr class="my-4">
```
## command.not-found
Thrown if the command attempted to execute was not found.
This can be used to customize the text printed when a command is not found.
Example:
```lua
local bait = require 'bait'
-- Remove any present handlers on `command.not-found`
@ -53,15 +64,20 @@ end)
```
#### Variables
`string` **`cmdStr`**
`string` _cmdStr_
The name of the command.
<hr>
``` =html
<hr class="my-4">
```
## command.not-executable
Thrown when the user attempts to run a file that is not executable
(like a text file, or Unix binary without +x permission).
#### Variables
`string` **`cmdStr`**
`string` _cmdStr_
The name of the command.

View File

@ -8,64 +8,87 @@ menu:
---
## hilbish.exit
Sent when Hilbish is going to exit.
#### Variables
This signal returns no variables.
<hr>
``` =html
<hr class="my-4">
```
## hilbish.vimMode
Sent when the Vim mode of Hilbish is changed (like from insert to normal mode).
This can be used to change the prompt and notify based on Vim mode.
#### Variables
`string` **`modeName`**
`string` _modeName_
The mode that has been set.
Can be these values: `insert`, `normal`, `delete` or `replace`
<hr>
``` =html
<hr class="my-4">
```
## hilbish.cancel
Sent when the user cancels their command input with Ctrl-C
#### Variables
This signal returns no variables.
<hr>
``` =html
<hr class="my-4">
```
## hilbish.notification
Thrown when a [notification](../../features/notifications) is sent.
#### Variables
`table` **`notification`**
`table` _notification_
The notification. The properties are defined in the link above.
<hr>
``` =html
<hr class="my-4">
```
## hilbish.cd
Sent when the current directory of the shell is changed (via interactive means.)
If you are implementing a custom command that changes the directory of the shell,
you must throw this hook manually for correctness.
~~If you are implementing a custom command that changes the directory of the shell, you must throw this hook manually for correctness.~~ Since 3.0, `hilbish.cd` is thrown when `fs.cd` is called.
#### Variables
`string` **`path`**
`string` _path_
Absolute path of the directory that was changed to.
`string` **`oldPath`**
`string` _oldPath_
Absolute path of the directory Hilbish *was* in.
<hr>
``` =html
<hr class="my-4">
```
## hilbish.vimAction
Sent when the user does a "vim action," being something like yanking or pasting text.
See `doc vim-mode actions` for more info.
#### Variables
`string` **`actionName`**
`string` _actionName_
Absolute path of the directory that was changed to.
`table` **`args`**
`table` _args_
Table of args relating to the Vim action.
<hr>
``` =html
<hr class="my-4">
```

View File

@ -1,7 +1,6 @@
Note: `job` refers to a job object. You can check `doc jobs` for more
detail.
+ `job.start` -> job > Thrown when a new background job starts.
+ `job.done` -> job > Thrown when a background jobs exits.
- `job.start` -> job > Thrown when a new background job starts.
- `job.done` -> job > Thrown when a background jobs exits.

View File

@ -8,33 +8,46 @@ menu:
---
## signal.sigint
Thrown when Hilbish receive the SIGINT signal,
aka when Ctrl-C is pressed.
#### Variables
This signal returns no variables.
<hr>
``` =html
<hr class="my-4">
```
## signal.resize
Thrown when the terminal is resized.
#### Variables
This signal returns no variables.
<hr>
``` =html
<hr class="my-4">
```
## signal.sigusr1
Thrown when SIGUSR1 is sent to Hilbish.
#### Variables
This signal returns no variables.
<hr>
``` =html
<hr class="my-4">
```
## signal.sigusr2
Thrown when SIGUSR2 is sent to Hilbish.
#### Variables
This signal returns no variables.
This signal returns no variables.

View File

@ -8,12 +8,12 @@ menu: docs
A bit after creation, we have the outside nature. Little plants, seeds,
growing to their final phase: a full plant. A lot of Hilbish itself is
written in Go, but there are parts made in Lua, being most builtins
(`doc`, `cd`, cdr), completions, and other things.
(`doc`, `cd`, cdr), completions, and other things.\
Hilbish's Lua core module is called `nature`.
It runs after Hilbish's Go core does.
# Nature Modules
Currently, `nature` provides 1 intended public module: `nature.dirs`.
Currently, `nature` provides 1 intended public module: `nature.dirs`.\
It is a simple API for managing recent directories and old
current working directory.

View File

@ -9,12 +9,12 @@ menu:
Vim actions are essentially just when a user uses a Vim keybind.
Things like yanking and pasting are Vim actions.
This is not an "offical Vim thing," just a Hilbish thing.
This is not an "offical Vim thing," just a Hilbish thing.\
\
The `hilbish.vimAction` hook is thrown whenever a Vim action occurs.
It passes 2 arguments: the action name, and an array (table) of args
relating to it.
relating to it.\
\
Here is documentation for what the table of args will hold for an
appropriate Vim action.

View File

@ -16,7 +16,11 @@ import jot
import post
import util
pub fn page(p: post.Post, doc_pages_list) -> element.Element(a) {
pub fn page(
p: post.Post,
this_slug: String,
doc_pages_list,
) -> element.Element(a) {
html.div([attribute.class("flex-auto flex flex-col overflow-none")], [
html.div(
[
@ -103,16 +107,37 @@ pub fn page(p: post.Post, doc_pages_list) -> element.Element(a) {
})
|> list.first()
[
html.li([attribute.class("font-bold")], [
html.a(
[
attribute.href(conf.base_url_join(
{ parent_post.1 }.slug,
)),
],
[element.text({ parent_post.1 }.title)],
),
]),
html.li(
[
attribute.class(
"font-bold"
<> case this_slug == { parent_post.1 }.slug {
False -> {
""
}
True -> " text-pink-400"
},
),
],
[
html.a(
[
attribute.href(conf.base_url_join(
{ parent_post.1 }.slug,
)),
],
[
element.text(
case this_slug == { parent_post.1 }.slug {
False -> ""
True -> " -> "
}
<> { parent_post.1 }.title,
),
],
),
],
),
case list.length(group.1) {
1 -> element.none()
_ ->
@ -123,12 +148,33 @@ pub fn page(p: post.Post, doc_pages_list) -> element.Element(a) {
{ p1.1 }.title != { parent_post.1 }.title
})
|> list.map(fn(post: #(String, post.Post)) {
html.li([attribute.class("mb-2")], [
html.a(
[attribute.href(conf.base_url_join(post.0))],
[element.text({ post.1 }.title)],
),
])
html.li(
[
attribute.class(
"mb-2"
<> case this_slug == { post.1 }.slug {
False -> {
""
}
True -> " text-pink-400"
},
),
],
[
html.a(
[attribute.href(conf.base_url_join(post.0))],
[
element.text(
case this_slug == { post.1 }.slug {
False -> ""
True -> " -> "
}
<> { post.1 }.title,
),
],
),
],
)
}),
)
},

View File

@ -1,4 +1,5 @@
import conf
import util
import lustre/attribute
import lustre/element
@ -38,10 +39,14 @@ pub fn page() -> element.Element(a) {
element.text("Extensible, scriptable, configurable: All in Lua."),
]),
html.div([attribute.class("flex flex-row gap-2 mt-2")], [
button("Install", "bg-pink-500/30", conf.base_url_join("/install")),
button(
"Install",
"bg-pink-500/30 hover:bg-pink-500/80",
conf.base_url_join("/install"),
),
button(
"GitHub",
"bg-stone-500/30",
"bg-stone-500/30 hover:bg-stone-500/80",
"https://github.com/Rosettea/Hilbish",
),
]),
@ -60,31 +65,6 @@ pub fn page() -> element.Element(a) {
[element.text("Feature Overview")],
),
html.br([]),
html.h1(
[
attribute.class(
"mt-3 text-5xl gap-2 font-bold inline-flex justify-center items-center",
),
],
[
element.text("What Makes "),
html.span(
[
attribute.class(
"inline-flex text-pink-500 items-center justify-center h-8",
),
],
[
html.img([
attribute.class("h-8"),
attribute.src(conf.base_url_join("/hilbish-flower.png")),
]),
element.text("Hilbish"),
],
),
element.text(" Great?"),
],
),
html.div(
[
attribute.class(
@ -92,6 +72,31 @@ pub fn page() -> element.Element(a) {
),
],
[
html.h1(
[
attribute.class(
"mt-3 text-5xl gap-2 font-bold inline-flex justify-center items-center",
),
],
[
element.text("What Makes "),
html.span(
[
attribute.class(
"inline-flex text-pink-500 items-center justify-center h-8",
),
],
[
html.img([
attribute.class("h-8"),
attribute.src(conf.base_url_join("/hilbish-flower.png")),
]),
element.text("Hilbish"),
],
),
element.text(" Great?"),
],
),
feature_section(
"The Moon-powered shell",
"https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Lua-Logo.svg/2048px-Lua-Logo.svg.png",
@ -128,7 +133,7 @@ pub fn page() -> element.Element(a) {
html.div(
[
attribute.class(
"text-center bg-neutral-100 dark:bg-neutral-900 -mx-4 p-4",
"border-t border-t-zinc-300 text-center bg-neutral-100 dark:bg-neutral-900 -mx-4 p-4",
),
],
[
@ -151,7 +156,7 @@ pub fn page() -> element.Element(a) {
]),
html.p([], [
element.text(
"These are binary releases of Hilbish from GitHub. Install instructions are located at an INSTALL.md file.",
"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(
@ -168,7 +173,11 @@ pub fn page() -> element.Element(a) {
),
attribute.class("h-36"),
]),
button("Linux (64-bit)", "bg-stone-500/30", ""),
button(
"Linux (64-bit)",
"bg-stone-500/30 hover:bg-stone-500/80",
download_link("linux", "amd64"),
),
]),
html.div([attribute.class("flex flex-col gap-2")], [
html.img([
@ -177,7 +186,11 @@ pub fn page() -> element.Element(a) {
),
attribute.class("h-36"),
]),
button("Windows (64-bit)", "bg-stone-500/30", ""),
button(
"Windows (64-bit)",
"bg-stone-500/30 hover:bg-stone-500/80",
download_link("windows", "amd64"),
),
]),
html.div(
[
@ -192,7 +205,11 @@ pub fn page() -> element.Element(a) {
),
attribute.class("h-36"),
]),
button("MacOS (64-bit)", "bg-stone-500/30", ""),
button(
"MacOS (64-bit)",
"bg-stone-500/30 hover:bg-stone-500/80",
download_link("darwin", "amd64"),
),
],
),
html.div(
@ -208,11 +225,16 @@ pub fn page() -> element.Element(a) {
),
attribute.class("h-36"),
]),
button("MacOS (ARM)", "bg-stone-500/30", ""),
button(
"MacOS (ARM)",
"bg-stone-500/30 hover:bg-stone-500/80",
download_link("darwin", "arm64"),
),
],
),
],
),
util.link(conf.base_url_join("/install"), "Other Downloads", True),
]),
],
),
@ -234,7 +256,8 @@ fn feature_section(
html.div(
[
attribute.class(
"flex flex-col gap-2 md:w-3/6 text-start xl:items-" <> align,
"flex flex-col gap-2 md:w-3/6 text-start xl:items-",
// <> align,
),
],
[
@ -242,8 +265,8 @@ fn feature_section(
html.div(
[
attribute.class(
"flex flex-row flex-wrap xl:flex-nowrap justify-center items-center gap-4 "
<> reverse,
"flex flex-row flex-wrap xl:flex-nowrap justify-center items-center gap-4 ",
//<> reverse,
),
],
[html.p([], [element.text(text)])],
@ -264,3 +287,12 @@ fn button(text: String, color: String, link: String) -> element.Element(a) {
),
])
}
fn download_link(os: String, arch: String) -> String {
// TODO: remove version in asset name when 3.0 drops
"https://github.com/Rosettea/Hilbish/releases/download/latest/hilbish-v2.3.4-"
<> os
<> "-"
<> arch
<> ".tar.gz"
}

View File

@ -2,6 +2,10 @@ import gleam/int
import gleam/option
import gleam/string
import lustre/attribute
import lustre/element
import lustre/element/html
import glaml
import post
@ -27,3 +31,40 @@ pub fn sort_weight(p1: #(String, post.Post), p2: #(String, post.Post)) {
False -> int.compare(p1_weight, p2_weight)
}
}
pub fn link(url: String, text: String, out: Bool) {
html.a(
[
attribute.href(url),
case out {
False -> attribute.none()
True -> attribute.target("_blank")
},
],
[
html.span(
[
attribute.class(
"inline-flex text-light dark:text-pink-300 dark:hover:text-pink-200 text-pink-600 hover:text-pink-500 hover:underline",
),
],
[
case out {
False -> element.none()
True ->
element.unsafe_raw_html(
"",
"tag",
[],
"<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"size-6\">
<path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25\" />
</svg>
",
)
},
element.text(text),
],
),
],
)
}

View File

@ -35,7 +35,6 @@ pub fn main() {
_ -> slug
}
io.debug(path)
let assert Ok(content) = simplifile.read(path)
let frontmatter = djot.frontmatter(content)
let metadata = case frontmatter {
@ -82,10 +81,10 @@ pub fn main() {
|> 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, doc_pages)
False -> doc.page(post.1, doc_pages)
True -> doc.page(post.1, post.0, doc_pages)
False -> doc.page(post.1, post.0, doc_pages)
}
io.debug(post.0)
//io.debug(post.0)
ssg.add_static_route(config, post.0, create_page(page))
})
|> ssg.use_index_routes
@ -131,23 +130,11 @@ fn nav() -> element.Element(a) {
),
]),
]),
html.div(
[attribute.class("flex gap-3 dark:text-pink-300 text-pink-600")],
[
html.a([attribute.href(conf.base_url_join("/"))], [
element.text("Home"),
]),
html.a([attribute.href(conf.base_url_join("/install"))], [
element.text("Install"),
]),
html.a([attribute.href(conf.base_url_join("/docs"))], [
element.text("Docs"),
]),
html.a([attribute.href(conf.base_url_join("/blog"))], [
element.text("Blog"),
]),
],
),
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),
]),
],
)
}
@ -184,7 +171,7 @@ fn footer() -> element.Element(a) {
]),
]),
html.div([attribute.class("flex flex-col")], [
link("https://github.com/Rosettea/Hilbish", "GitHub"),
util.link("https://github.com/Rosettea/Hilbish", "GitHub", True),
]),
],
)
@ -257,11 +244,3 @@ fn create_page(content: element.Element(a)) -> element.Element(a) {
],
)
}
fn link(url: String, text: String) {
html.a([attribute.href(url)], [
html.span([attribute.class("text-pink-300 text-light")], [
element.text(text),
]),
])
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 Rosettea
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,2 +0,0 @@
+++
+++

View File

@ -1,89 +0,0 @@
.chroma {
display: inline-block;
padding: 0.5em;
}
/* Background */ .bg { background-color: #F7F7F7; }
/* PreWrapper */ .chroma { background-color: #F7F7F7; }
/* Other */ .chroma .x { }
/* Error */ .chroma .err { color: #a61717; background-color: #e3d2d2 }
/* CodeLine */ .chroma .cl { }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
/* LineHighlight */ .chroma .hl { background-color: #F7F7F7 }
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
/* Line */ .chroma .line { display: flex; }
/* Keyword */ .chroma .k { color: #008800; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #008800; font-weight: bold }
/* KeywordDeclaration */ .chroma .kd { color: #008800; font-weight: bold }
/* KeywordNamespace */ .chroma .kn { color: #008800; font-weight: bold }
/* KeywordPseudo */ .chroma .kp { color: #008800 }
/* KeywordReserved */ .chroma .kr { color: #008800; font-weight: bold }
/* KeywordType */ .chroma .kt { color: #888888; font-weight: bold }
/* Name */ .chroma .n { }
/* NameAttribute */ .chroma .na { color: #336699 }
/* NameBuiltin */ .chroma .nb { color: #003388 }
/* NameBuiltinPseudo */ .chroma .bp { }
/* NameClass */ .chroma .nc { color: #bb0066; font-weight: bold }
/* NameConstant */ .chroma .no { color: #003366; font-weight: bold }
/* NameDecorator */ .chroma .nd { color: #555555 }
/* NameEntity */ .chroma .ni { }
/* NameException */ .chroma .ne { color: #bb0066; font-weight: bold }
/* NameFunction */ .chroma .nf { color: #0066bb; font-weight: bold }
/* NameFunctionMagic */ .chroma .fm { }
/* NameLabel */ .chroma .nl { color: #336699; font-style: italic }
/* NameNamespace */ .chroma .nn { color: #bb0066; font-weight: bold }
/* NameOther */ .chroma .nx { }
/* NameProperty */ .chroma .py { color: #336699; font-weight: bold }
/* NameTag */ .chroma .nt { color: #bb0066; font-weight: bold }
/* NameVariable */ .chroma .nv { color: #336699 }
/* NameVariableClass */ .chroma .vc { color: #336699 }
/* NameVariableGlobal */ .chroma .vg { color: #dd7700 }
/* NameVariableInstance */ .chroma .vi { color: #3333bb }
/* NameVariableMagic */ .chroma .vm { }
/* Literal */ .chroma .l { }
/* LiteralDate */ .chroma .ld { }
/* LiteralString */ .chroma .s { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringAffix */ .chroma .sa { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringBacktick */ .chroma .sb { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringChar */ .chroma .sc { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringDelimiter */ .chroma .dl { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringDoc */ .chroma .sd { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringDouble */ .chroma .s2 { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringEscape */ .chroma .se { color: #0044dd; background-color: #fff0f0 }
/* LiteralStringHeredoc */ .chroma .sh { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringInterpol */ .chroma .si { color: #3333bb; background-color: #fff0f0 }
/* LiteralStringOther */ .chroma .sx { color: #22bb22; background-color: #f0fff0 }
/* LiteralStringRegex */ .chroma .sr { color: #008800; background-color: #fff0ff }
/* LiteralStringSingle */ .chroma .s1 { color: #dd2200; background-color: #fff0f0 }
/* LiteralStringSymbol */ .chroma .ss { color: #aa6600; background-color: #fff0f0 }
/* LiteralNumber */ .chroma .m { color: #0000dd; font-weight: bold }
/* LiteralNumberBin */ .chroma .mb { color: #0000dd; font-weight: bold }
/* LiteralNumberFloat */ .chroma .mf { color: #0000dd; font-weight: bold }
/* LiteralNumberHex */ .chroma .mh { color: #0000dd; font-weight: bold }
/* LiteralNumberInteger */ .chroma .mi { color: #0000dd; font-weight: bold }
/* LiteralNumberIntegerLong */ .chroma .il { color: #0000dd; font-weight: bold }
/* LiteralNumberOct */ .chroma .mo { color: #0000dd; font-weight: bold }
/* Operator */ .chroma .o { }
/* OperatorWord */ .chroma .ow { color: #008800 }
/* Punctuation */ .chroma .p { }
/* Comment */ .chroma .c { color: #888888 }
/* CommentHashbang */ .chroma .ch { color: #888888 }
/* CommentMultiline */ .chroma .cm { color: #888888 }
/* CommentSingle */ .chroma .c1 { color: #888888 }
/* CommentSpecial */ .chroma .cs { color: #cc0000; background-color: #fff0f0; font-weight: bold }
/* CommentPreproc */ .chroma .cp { color: #cc0000; font-weight: bold }
/* CommentPreprocFile */ .chroma .cpf { color: #cc0000; font-weight: bold }
/* Generic */ .chroma .g { }
/* GenericDeleted */ .chroma .gd { color: #000000; background-color: #ffdddd }
/* GenericEmph */ .chroma .ge { font-style: italic }
/* GenericError */ .chroma .gr { color: #aa0000 }
/* GenericHeading */ .chroma .gh { color: #333333 }
/* GenericInserted */ .chroma .gi { color: #000000; background-color: #ddffdd }
/* GenericOutput */ .chroma .go { color: #888888 }
/* GenericPrompt */ .chroma .gp { color: #555555 }
/* GenericStrong */ .chroma .gs { font-weight: bold }
/* GenericSubheading */ .chroma .gu { color: #666666 }
/* GenericTraceback */ .chroma .gt { color: #aa0000 }
/* GenericUnderline */ .chroma .gl { text-decoration: underline }
/* TextWhitespace */ .chroma .w { color: #bbbbbb }

View File

@ -1,7 +0,0 @@
{{ define "main"}}
<main id="main">
<div>
<h1><a href="{{ "/" | relURL }}">Go Home</a></h1>
</div>
</main>
{{ end }}

View File

@ -1,11 +0,0 @@
<h{{ (add .Level 1) }} id="{{ .Anchor | safeURL }}" class="heading">
{{ .Text | safeHTML }}
<a href="#{{ .Anchor | safeURL }}" class='heading-link'>
<i class="fas fa-paperclip"></i>
</a>
</h{{ (add .Level 1) }}>
{{ if eq .Text ""}}
<hr>
{{ end }}

View File

@ -1 +0,0 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if eq (substr .Destination 0 4) "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>

View File

@ -1,21 +0,0 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body class="d-flex flex-column min-vh-100" style="overflow-x: hidden;">
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="check-circle-fill" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
</symbol>
<symbol id="info-fill" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</symbol>
<symbol id="exclamation-triangle-fill" fill="currentColor" viewBox="0 0 16 16">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</symbol>
</svg>
{{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}}
</body>
</html>

View File

@ -1,65 +0,0 @@
{{ define "main" }}
<style>
@media (min-width: 768px) {
.sidenav {
width: 240px;
}
}
</style>
<div class="row">
<nav class="navbar-expand-md bg-light sidenav border-end">
<div class="container">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<nav class="navbar navbar-expand-md bg-light sidenav col" style="margin-top: -20px;">
<ul class="navbar-nav me-auto mb-2 mb-lg-0 flex-column col mt-4">
{{ $currentPage := . }}
{{ range .Site.Menus.docs.ByWeight.Reverse }}
<li class="nav-item">
<a href="{{ .URL }}" class="nav-link">
<strong>{{ .Title }}</strong>
</a>
</li>
{{ if .Children }}
<ul style="list-style: none;">
{{ range .Children }}
<li class="nav-item">
<a href="{{ .URL }}" class="nav-link">
{{ .Title }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</ul>
</nav>
</div>
</div>
</nav>
<container class="col mt-2" style="padding-left: 20px; padding-right: 20px;">
<div>
<h1>{{ .Title }}</h1>
<p><em>
{{ $date := .Date.UTC.Format "Jan 2, 2006" }}
{{ $lastmod := .Lastmod.UTC.Format "Jan 2, 2006" }}
{{ if and (ne $lastmod $date) (gt .Lastmod .Date) }}
Last updated {{ $lastmod }}<br>
{{ end }}
{{ if .Description }}
{{ .Description }}<br>
{{ end}}
</em></p>
{{.Content}}
</div>
<div class="footer mt-auto">
<p class="card-small text-muted">
Want to help improve this page? <a href="https://github.com/Rosettea/Hilbish/issues/new/choose">Create an issue.</a>
</p>
</div>
</container>
</div>
{{ end }}

View File

@ -1,21 +0,0 @@
{{ define "main" }}
<main class="mt-4 mb-4">
<div class="row row-cols-1 row-cols-md-1 g-4">
{{ range where .Site.RegularPages "Section" "in" "blog" }}
<div class="col d-flex justify-content-center">
<div class="card" style="width: 56rem;">
<div class="card-body">
<a href="{{ .Permalink }}"><h5 class="card-title">{{ .Title }}</h5></a>
<h6 class='card-subtitle text-muted mb-2'>
{{- if isset .Params "date" -}}
<time>{{ .Date.Format "January 2, 2006" }}</time>
{{- end -}}
</h6>
<p class="card-text">{{if .Description}}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}</p>
</div>
</div>
</div>
{{- end }}
</div>
</main>
{{ end }}

View File

@ -1,7 +0,0 @@
{{ define "main" }}
<main>
<div class="container mt-2">
{{.Content}}
</div>
</main>
{{ end }}

View File

@ -1,17 +0,0 @@
{{ define "main" }}
<main>
<div class="container mt-2">
<h1>{{ .Title }}</h1>
<img src='{{ .Site.Author.sammyette.picture }}' width=48 style='border-radius: 100%'>
<em class='text-muted'>
by <strong>{{ .Site.Author.sammyette.name }}</strong>
{{- if isset .Params "date" -}}
<time> // {{ .Date.Format "January 2, 2006" }}</time>
{{- end -}}
</em>
<div class='my-4'>
{{.Content}}
</div>
</div>
</main>
{{ end }}

View File

@ -1,8 +0,0 @@
{{ define "main" }}
<div>
<main style="padding-left: 20px; padding-right: 20px; padding-top: 15px; max-width: 84em; margin: auto;">
{{.Content}}
</main>
</div>
{{ end }}

View File

@ -1,31 +0,0 @@
<footer class="footer mt-auto mt-auto py-3 bg-light row border-top">
<div class="col mb-3">
</div>
<div class="col mb-3">
<a href="/Hilbish" class="d-flex align-items-center mb-3 link-dark text-decoration-none">
<img src="/Hilbish/hilbish-logo-and-text.png" alt="" height="48" class="d-inline-block align-text-top" style="margin-left: -20px">
</a>
<ul class="nav flex-column">
<li class="nav-item mb-2"><a href="/Hilbish" class="nav-link p-0 text-muted">Home</a></li>
<li class="nav-item mb-2"><a href="/Hilbish/docs/faq" class="nav-link p-0 text-muted">FAQ</a></li>
<li class="nav-item mb-2"><a href="https://github.com/Rosettea/Hilbish" class="nav-link p-0 text-muted">Source</a></li>
<li class="nav-item mb-2"><a href="https://github.com/Rosettea/Hilbish/releases" class="nav-link p-0 text-muted">Releases</a></li>
<li class="nav-item mb-2"><a href="/Hilbish/docs" class="nav-link p-0 text-muted">Documentation</a></li>
</ul>
</div>
<div class="col mb-3"></div>
<div class="col mb-3"></div>
<div class="col mb-3"></div>
<div class="col mb-3">
<p class="text-muted mt-4">
Rosettea &copy; 2022-2023
<br>
Made with <i class="fa-solid fa-heart" style="color: #f6345b;"></i>
</p>
</div>
<div class="col mb-3"></div>
</footer>

View File

@ -1,78 +0,0 @@
<head>
{{ $title := print .Title " — " .Site.Title }}
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
<title>{{ $title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<meta name="theme-color" content="#ff89dd">
<meta content="/Hilbish/hilbish-flower.png" property="og:image" />
<meta property="og:site_name" content="Hilbish" />
<meta content="{{ $title }}" property="og:title" />
<meta content="{{if .Description}}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}" property="og:description" />
<meta content="{{if .Description}}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}" name="description" />
<meta name="revisit-after" content="2 days">
<meta name="keywords" content="Lua, Hilbish, Linux, Shell">
<meta property="og:locale" content="en_GB" />
<link rel="canonical" href="https://rosettea.github.io/Hilbish/" />
<meta property="og:url" content="https://rosettea.github.io/Hilbish/" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
{{ $syntax := resources.Get "css/syntax.css" | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $syntax.RelPermalink }}" integrity="{{ $syntax.Data.Integrity }}">
</link>
<style>
.heading > .heading-link {
opacity: 0
}
.heading:hover > .heading-link {
visibility: visible;
opacity: 1;
transition: all .1s ease-in;
}
@keyframes highlight {
0% {
background: none
}
50% {
background: #fff2cf;
}
100% {
background: none;
}
}
div:target {
animation: highlight 1.2s;
animation-timing-function: cubic-bezier(1,-0.02,.45,.89);
}
table {
border-width: 1px;
border-style: solid;
border-color: #565c64;;
border-collapse: collapse;
margin-bottom: 12px;
}
table td {
padding: 5px;
}
table tr {
border-width: 1px;
}
thead {
display: none;
}
</style>
</head>

View File

@ -1,24 +0,0 @@
<header>
<nav class="navbar navbar-expand-md sticky-top bg-light border-bottom">
<div class="container-fluid">
<a class="navbar-brand" href="/Hilbish">
<img src="/Hilbish/hilbish-logo-and-text.png" alt="" height="48">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
{{ $currentPage := . }}
{{ range .Site.Menus.nav }}
<li class="nav-item">
<a href="{{ .URL }}" class="nav-link {{ if $currentPage.IsMenuCurrent "nav" . }}active{{ end }}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
</div>
</div>
</nav>
</header>

View File

@ -1,5 +0,0 @@
<video src="{{ .Get "src" }}" style="height: auto; max-width: 100%;" controls>
There's a video missing here...
Well here is the URL: {{ .Get "src" }}
</video>

View File

@ -1,6 +0,0 @@
<div class="alert alert-warning d-flex align-items-center" role="alert">
<svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="Warning:"><use xlink:href="#exclamation-triangle-fill"/></svg>
<div>
{{ .Get 0 }}
</div>
</div>

View File

@ -1,21 +0,0 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "Hsh"
license = "MIT"
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
description = ""
homepage = "http://example.com/"
tags = []
features = []
min_version = "0.41.0"
[author]
name = ""
homepage = ""
# If porting an existing theme
[original]
name = ""
homepage = ""
repo = ""