gh-pages
TorchedSammy 2023-12-04 00:54:21 +00:00
parent c0b1ce5ebf
commit 9175b60a63
15 changed files with 155 additions and 118 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,14 +5,14 @@
<a href=#introduction class=heading-link><i class="fas fa-paperclip"></i></a></h3><p>The history interface deals with command history.
This includes the ability to override functions to change the main
method of saving history.</p><h3 id=functions class=heading>Functions
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#history.add>add(cmd)</a></td><td>Adds a command to the history.</td></tr><tr><td><a href=#history.all>all() -> table</a></td><td>Retrieves all history.</td></tr><tr><td><a href=#history.clear>clear()</a></td><td>Deletes all commands from the history.</td></tr><tr><td><a href=#history.get>get(idx)</a></td><td>Retrieves a command from the history based on the <code>idx</code>.</td></tr><tr><td><a href=#history.size>size() -> number</a></td><td>Returns the amount of commands in the history.</td></tr></tbody></table><hr><div id=history.add><h4 class=heading>hilbish.history.add(cmd)
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#history.add>add(cmd)</a></td><td>Adds a command to the history.</td></tr><tr><td><a href=#history.all>all() -> table</a></td><td>Retrieves all history as a table.</td></tr><tr><td><a href=#history.clear>clear()</a></td><td>Deletes all commands from the history.</td></tr><tr><td><a href=#history.get>get(index)</a></td><td>Retrieves a command from the history based on the <code>index</code>.</td></tr><tr><td><a href=#history.size>size() -> number</a></td><td>Returns the amount of commands in the history.</td></tr></tbody></table><hr><div id=history.add><h4 class=heading>hilbish.history.add(cmd)
<a href=#history.add class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Adds a command to the history.</p><h5 id=parameters class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=history.all><h4 class=heading>hilbish.history.all() -> table
<a href=#history.all class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Retrieves all history.</p><h5 id=parameters-1 class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>string</code> <strong><code>cmd</code></strong></p></div><hr><div id=history.all><h4 class=heading>hilbish.history.all() -> table
<a href=#history.all class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Retrieves all history as a table.</p><h5 id=parameters-1 class=heading>Parameters
<a href=#parameters-1 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=history.clear><h4 class=heading>hilbish.history.clear()
<a href=#history.clear class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Deletes all commands from the history.</p><h5 id=parameters-2 class=heading>Parameters
<a href=#parameters-2 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=history.get><h4 class=heading>hilbish.history.get(idx)
<a href=#history.get class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Retrieves a command from the history based on the <code>idx</code>.</p><h5 id=parameters-3 class=heading>Parameters
<a href=#parameters-3 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=history.size><h4 class=heading>hilbish.history.size() -> number
<a href=#parameters-2 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=history.get><h4 class=heading>hilbish.history.get(index)
<a href=#history.get class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Retrieves a command from the history based on the <code>index</code>.</p><h5 id=parameters-3 class=heading>Parameters
<a href=#parameters-3 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>number</code> <strong><code>index</code></strong></p></div><hr><div id=history.size><h4 class=heading>hilbish.history.size() -> number
<a href=#history.size class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Returns the amount of commands in the history.</p><h5 id=parameters-4 class=heading>Parameters
<a href=#parameters-4 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div></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><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></body></html>

File diff suppressed because one or more lines are too long

View File

@ -25,4 +25,4 @@ If you attempt to require and print the result (<code>print(require 'plugin')</c
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#module.load>load(path)</a></td><td>Loads a module at the designated <code>path</code>.</td></tr></tbody></table><h3 id=static-module-fields class=heading>Static module fields
<a href=#static-module-fields class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>paths</td><td>A list of paths to search when loading native modules. This is in the style of Lua search paths and will be used when requiring native modules. Example: <code>?.so;?/?.so</code></td></tr></tbody></table><hr><div id=module.load><h4 class=heading>hilbish.module.load(path)
<a href=#module.load class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Loads a module at the designated <code>path</code>.<br>It will throw if any error occurs.</p><h5 id=parameters class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div></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><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></body></html>
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>string</code> <strong><code>path</code></strong></p></div></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><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></body></html>

File diff suppressed because one or more lines are too long

View File

@ -7,10 +7,10 @@ how Hilbish interprets interactive input.
Users can add and change the default runner for interactive input to any
language or script of their choosing. A good example is using it to
write command in Fennel.</p><h3 id=functions class=heading>Functions
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#runner.setMode>setMode(cb)</a></td><td>This is the same as the <code>hilbish.runnerMode</code> function. It takes a callback,</td></tr><tr><td><a href=#runner.lua>lua(cmd)</a></td><td>Evaluates <code>cmd</code> as Lua input. This is the same as using <code>dofile</code></td></tr><tr><td><a href=#runner.sh>sh(cmd)</a></td><td>Runs a command in Hilbish&rsquo;s shell script interpreter.</td></tr></tbody></table><hr><div id=runner.setMode><h4 class=heading>hilbish.runner.setMode(cb)
<a href=#runner.setMode class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>This is the same as the <code>hilbish.runnerMode</code> function. It takes a callback,<br>which will be used to execute all interactive input.<br>In normal cases, neither callbacks should be overrided by the user,<br>as the higher level functions listed below this will handle it.</p><h5 id=parameters class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=runner.lua><h4 class=heading>hilbish.runner.lua(cmd)
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#runner.setMode>setMode(cb)</a></td><td>This is the same as the <code>hilbish.runnerMode</code> function.</td></tr><tr><td><a href=#runner.lua>lua(cmd)</a></td><td>Evaluates <code>cmd</code> as Lua input. This is the same as using <code>dofile</code></td></tr><tr><td><a href=#runner.sh>sh(cmd)</a></td><td>Runs a command in Hilbish&rsquo;s shell script interpreter.</td></tr></tbody></table><hr><div id=runner.setMode><h4 class=heading>hilbish.runner.setMode(cb)
<a href=#runner.setMode class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>This is the same as the <code>hilbish.runnerMode</code> function.<br>It takes a callback, which will be used to execute all interactive input.<br>In normal cases, neither callbacks should be overrided by the user,<br>as the higher level functions listed below this will handle it.</p><h5 id=parameters class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>function</code> <strong><code>cb</code></strong></p></div><hr><div id=runner.lua><h4 class=heading>hilbish.runner.lua(cmd)
<a href=#runner.lua class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Evaluates <code>cmd</code> as Lua input. This is the same as using <code>dofile</code><br>or <code>load</code>, but is appropriated for the runner interface.</p><h5 id=parameters-1 class=heading>Parameters
<a href=#parameters-1 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=runner.sh><h4 class=heading>hilbish.runner.sh(cmd)
<a href=#parameters-1 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>string</code> <strong><code>cmd</code></strong></p></div><hr><div id=runner.sh><h4 class=heading>hilbish.runner.sh(cmd)
<a href=#runner.sh class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Runs a command in Hilbish&rsquo;s shell script interpreter.<br>This is the equivalent of using <code>source</code>.</p><h5 id=parameters-2 class=heading>Parameters
<a href=#parameters-2 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div></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><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></body></html>
<a href=#parameters-2 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>string</code> <strong><code>cmd</code></strong></p></div></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><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></body></html>

View File

@ -5,21 +5,19 @@
<a href=#introduction class=heading-link><i class="fas fa-paperclip"></i></a></h3><p>If you ever want to run a piece of code on a timed interval, or want to wait
a few seconds, you don&rsquo;t have to rely on timing tricks, as Hilbish has a
timer API to set intervals and timeouts.</p><p>These are the simple functions <code>hilbish.interval</code> and <code>hilbish.timeout</code> (doc
accessible with <code>doc hilbish</code>). But if you want slightly more control over
them, there is the <code>hilbish.timers</code> interface. It allows you to get
a timer via ID and control them.</p><p>All functions documented with the <code>Timer</code> type refer to a Timer object.</p><p>An example of usage:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-fallback data-lang=fallback><span class=line><span class=ln>1</span><span class=cl>local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function()
</span></span><span class=line><span class=ln>2</span><span class=cl> print &#39;hello!&#39;
</span></span><span class=line><span class=ln>3</span><span class=cl>end)
accessible with <code>doc hilbish</code>, or <code>Module hilbish</code> on the Website).</p><p>An example of usage:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-lua data-lang=lua><span class=line><span class=ln>1</span><span class=cl><span class=kd>local</span> <span class=n>t</span> <span class=o>=</span> <span class=n>hilbish.timers</span><span class=p>.</span><span class=n>create</span><span class=p>(</span><span class=n>hilbish.timers</span><span class=p>.</span><span class=n>TIMEOUT</span><span class=p>,</span> <span class=mi>5000</span><span class=p>,</span> <span class=kr>function</span><span class=p>()</span>
</span></span><span class=line><span class=ln>2</span><span class=cl> <span class=n>print</span> <span class=s1>&#39;hello!&#39;</span>
</span></span><span class=line><span class=ln>3</span><span class=cl><span class=kr>end</span><span class=p>)</span>
</span></span><span class=line><span class=ln>4</span><span class=cl>
</span></span><span class=line><span class=ln>5</span><span class=cl>t:start()
</span></span><span class=line><span class=ln>6</span><span class=cl>print(t.running) // true
</span></span><span class=line><span class=ln>5</span><span class=cl><span class=n>t</span><span class=p>:</span><span class=n>start</span><span class=p>()</span>
</span></span><span class=line><span class=ln>6</span><span class=cl><span class=n>print</span><span class=p>(</span><span class=n>t.running</span><span class=p>)</span> <span class=o>//</span> <span class=kc>true</span>
</span></span></code></pre></div><h3 id=functions class=heading>Functions
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#timers.create>create(type, time, callback) -> @Timer</a></td><td>Creates a timer that runs based on the specified <code>time</code> in milliseconds.</td></tr><tr><td><a href=#timers.get>get(id) -> @Timer</a></td><td>Retrieves a timer via its ID.</td></tr></tbody></table><h3 id=static-module-fields class=heading>Static module fields
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><a href=#timers.create>create(type, time, callback) -> @Timer</a></td><td>Creates a timer that runs based on the specified <code>time</code>.</td></tr><tr><td><a href=#timers.get>get(id) -> @Timer</a></td><td>Retrieves a timer via its ID.</td></tr></tbody></table><h3 id=static-module-fields class=heading>Static module fields
<a href=#static-module-fields class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>INTERVAL</td><td>Constant for an interval timer type</td></tr><tr><td>TIMEOUT</td><td>Constant for a timeout timer type</td></tr></tbody></table><hr><div id=timers.create><h4 class=heading>hilbish.timers.create(type, time, callback) -> <a href=/Hilbish/docs/api/hilbish/hilbish.timers/#timer style=text-decoration:none id=lol>Timer</a>
<a href=#timers.create class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Creates a timer that runs based on the specified <code>time</code> in milliseconds.<br>The <code>type</code> can either be <code>hilbish.timers.INTERVAL</code> or <code>hilbish.timers.TIMEOUT</code></p><h5 id=parameters class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><hr><div id=timers.get><h4 class=heading>hilbish.timers.get(id) -> <a href=/Hilbish/docs/api/hilbish/hilbish.timers/#timer style=text-decoration:none id=lol>Timer</a>
<a href=#timers.create class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Creates a timer that runs based on the specified <code>time</code>.</p><h5 id=parameters class=heading>Parameters
<a href=#parameters class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>number</code> <strong><code>type</code></strong><br>What kind of timer to create, can either be <code>hilbish.timers.INTERVAL</code> or <code>hilbish.timers.TIMEOUT</code></p><p><code>number</code> <strong><code>time</code></strong><br>The amount of time the function should run in milliseconds.</p><p><code>function</code> <strong><code>callback</code></strong><br>The function to run for the timer.</p></div><hr><div id=timers.get><h4 class=heading>hilbish.timers.get(id) -> <a href=/Hilbish/docs/api/hilbish/hilbish.timers/#timer style=text-decoration:none id=lol>Timer</a>
<a href=#timers.get class=heading-link><i class="fas fa-paperclip"></i></a></h4><p>Retrieves a timer via its ID.</p><h5 id=parameters-1 class=heading>Parameters
<a href=#parameters-1 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p>This function has no parameters.</p></div><h3 id=types class=heading>Types
<a href=#parameters-1 class=heading-link><i class="fas fa-paperclip"></i></a></h5><p><code>number</code> <strong><code>id</code></strong></p></div><h3 id=types class=heading>Types
<a href=#types class=heading-link><i class="fas fa-paperclip"></i></a></h3><hr><h3 id=timer class=heading>Timer
<a href=#timer class=heading-link><i class="fas fa-paperclip"></i></a></h3><p>The Job type describes a Hilbish timer.</p><h3 id=object-properties class=heading>Object properties
<a href=#object-properties class=heading-link><i class="fas fa-paperclip"></i></a></h3><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>type</td><td>What type of timer it is</td></tr><tr><td>running</td><td>If the timer is running</td></tr><tr><td>duration</td><td>The duration in milliseconds that the timer will run</td></tr></tbody></table><h4 id=methods class=heading>Methods

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Module hilbish on Hilbish</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/</link><description>Recent content in Module hilbish on Hilbish</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/index.xml" rel="self" type="application/rss+xml"/><item><title>Module hilbish.aliases</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/</guid><description>Introduction The alias interface deals with all command aliases in Hilbish.
Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&amp;gt; table&amp;lt;string, string&amp;gt; Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&amp;gt; command (string) Tries to resolve an alias to its command. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.</description></item><item><title>Module hilbish.completion</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</guid><description>Introduction The completions interface deals with tab completions.
Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&amp;gt; table[string, string] Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&amp;gt; string? Resolves an alias to its original command. Will thrown an error if the alias doesn&amp;rsquo;t exist. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.</description></item><item><title>Module hilbish.completion</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</guid><description>Introduction The completions interface deals with tab completions.
Functions bins(query, ctx, fields) -&amp;gt; entries (table), prefix (string) Return binaries/executables based on the provided parameters. call(name, query, ctx, fields) -&amp;gt; completionGroups (table), prefix (string) Calls a completer function. This is mainly used to call a command completer, which will have a name files(query, ctx, fields) -&amp;gt; entries (table), prefix (string) Returns file matches based on the provided parameters. handler(line, pos) This function contains the general completion handler for Hilbish.</description></item><item><title>Module hilbish.editor</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/</guid><description>Introduction The hilbish.editor interface provides functions to directly interact with the line editor in use.
Functions getLine() -&amp;gt; string Returns the current input line. getVimRegister(register) -&amp;gt; string Returns the text that is at the register. insert(text) Inserts text into the line. getChar() -&amp;gt; string Reads a keystroke from the user. This is in a format setVimRegister(register, text) Sets the vim register at register to hold the passed text. hilbish.editor.getLine() -> string Returns the current input line.</description></item><item><title>Module hilbish.history</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</guid><description>Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history.
Functions add(cmd) Adds a command to the history. all() -&amp;gt; table Retrieves all history. clear() Deletes all commands from the history. get(idx) Retrieves a command from the history based on the idx. size() -&amp;gt; number Returns the amount of commands in the history. hilbish.history.add(cmd) Adds a command to the history.</description></item><item><title>Module hilbish.jobs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</guid><description>Introduction Manage interactive jobs in Hilbish via Lua.
Functions getLine() -&amp;gt; string Returns the current input line. getVimRegister(register) -&amp;gt; string Returns the text that is at the register. insert(text) Inserts text into the Hilbish command line. getChar() -&amp;gt; string Reads a keystroke from the user. This is in a format of something like Ctrl-L. setVimRegister(register, text) Sets the vim register at register to hold the passed text.</description></item><item><title>Module hilbish.history</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</guid><description>Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history.
Functions add(cmd) Adds a command to the history. all() -&amp;gt; table Retrieves all history as a table. clear() Deletes all commands from the history. get(index) Retrieves a command from the history based on the index. size() -&amp;gt; number Returns the amount of commands in the history. hilbish.</description></item><item><title>Module hilbish.jobs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</guid><description>Introduction Manage interactive jobs in Hilbish via Lua.
Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners.
Functions add(cmdstr, args, execPath) Adds a new job to the job table. Note that this does not immediately run it. all() -&amp;gt; table&amp;lt;@Job&amp;gt; Returns a table of all job objects. disown(id) Disowns a job. This deletes it from the job table.</description></item><item><title>Module hilbish.module</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</guid><description>Introduction The hilbish.module interface provides a function to load Hilbish plugins/modules. Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin ) that are used to add functionality to Hilbish that cannot be written in Lua for any reason.
Note that you don&amp;rsquo;t ever need to use the load function that is here as modules can be loaded with a require call like Lua C modules, and the search paths can be changed with the paths property here.</description></item><item><title>Module hilbish.os</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</guid><description> Introduction The os interface provides simple text information properties about the current OS on the systen. This mainly includes the name and version.
Functions add(cmdstr, args, execPath) Creates a new job. This function does not run the job. This function is intended to be all() -&amp;gt; table[@Job] Returns a table of all job objects. disown(id) Disowns a job. This simply deletes it from the list of jobs without stopping it.</description></item><item><title>Module hilbish.module</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</guid><description>Introduction The hilbish.module interface provides a function to load Hilbish plugins/modules. Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin ) that are used to add functionality to Hilbish that cannot be written in Lua for any reason.
Note that you don&amp;rsquo;t ever need to use the load function that is here as modules can be loaded with a require call like Lua C modules, and the search paths can be changed with the paths property here.</description></item><item><title>Module hilbish.os</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</guid><description> Introduction Provides simple text information properties about the current operating system. This mainly includes the name and version.
Static module fields family Family name of the current OS name Pretty name of the current OS version Version of the current OS</description></item><item><title>Module hilbish.runner</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/</guid><description>Introduction The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel.
Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, lua(cmd) Evaluates cmd as Lua input. This is the same as using dofile sh(cmd) Runs a command in Hilbish&amp;rsquo;s shell script interpreter.</description></item><item><title>Module hilbish.timers</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</guid><description>Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don&amp;rsquo;t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts.
These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish). But if you want slightly more control over them, there is the hilbish.timers interface. It allows you to get a timer via ID and control them.</description></item><item><title>Module hilbish.userDir</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</guid><description> Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user&amp;rsquo;s preferred directories for configs and data.
Functions setMode(cb) This is the same as the hilbish.runnerMode function. lua(cmd) Evaluates cmd as Lua input. This is the same as using dofile sh(cmd) Runs a command in Hilbish&amp;rsquo;s shell script interpreter.</description></item><item><title>Module hilbish.timers</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</guid><description>Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don&amp;rsquo;t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts.
These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish, or Module hilbish on the Website).
An example of usage:
1local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function() 2 print &amp;#39;hello!</description></item><item><title>Module hilbish.userDir</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</guid><description> Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user&amp;rsquo;s preferred directories for configs and data.
Static module fields config The user&amp;rsquo;s config directory data The user&amp;rsquo;s directory for program data</description></item></channel></rss>

View File

@ -2,5 +2,5 @@
Usage of the Bait module consists of userstanding event-driven architecture, but it&amp;rsquo;s pretty simple: If you want to act on a certain event, you can catch it. You can act on events via callback functions.</description></item><item><title>Module commander</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/</guid><description>Introduction Commander is the library which handles Hilbish commands. This makes the user able to add Lua-written commands to their shell without making a separate script in a bin folder. Instead, you may simply use the Commander library in your Hilbish config.
1local commander = require &amp;#39;commander&amp;#39; 2 3commander.register(&amp;#39;hello&amp;#39;, function(args, sinks) 4 sinks.out:writeln &amp;#39;Hello world!&amp;#39; 5end) In this example, a command with the name of hello is created that will print Hello world!</description></item><item><title>Module fs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/</guid><description>Introduction The fs module provides filesystem functions to Hilbish. While Lua&amp;rsquo;s standard library has some I/O functions, they&amp;rsquo;re missing a lot of the basics. The fs library offers more functions and will work on any operating system Hilbish does.
Functions abs(path) -&amp;gt; string Returns an absolute version of the path. basename(path) -&amp;gt; string Returns the &amp;ldquo;basename,&amp;rdquo; or the last part of the provided path. If path is empty, cd(dir) Changes Hilbish&amp;rsquo;s directory to dir.</description></item><item><title>Module terminal</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/</guid><description>Introduction The terminal library is a simple and lower level library for certain terminal interactions.
Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal setRaw() Puts the terminal in raw mode size() Gets the dimensions of the terminal. Returns a table with width and height terminal.restoreState() Restores the last saved state of the terminal
Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal. setRaw() Puts the terminal into raw mode. size() Gets the dimensions of the terminal. Returns a table with width and height terminal.restoreState() Restores the last saved state of the terminal
Parameters This function has no parameters.</description></item></channel></rss>

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,8 @@ For simple usage, a single color or style is enough. For example, you can just u
In other usage, you may want to use a format string instead of having multiple nested functions for different styles.</description></item><item><title>Frequently Asked Questions</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/faq/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/faq/</guid><description>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&amp;rsquo;s main goal, but &amp;hellip;.)
Windows Support? It compiles for Windows (CI ensures it does), but otherwise it is not directly supported. If you&amp;rsquo;d like to improve this situation, checkout the discussion .
Why? Hilbish emerged from the desire of a Lua configured shell.</description></item><item><title>Getting Started</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/getting-started/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/getting-started/</guid><description>To start Hilbish, open a terminal. If Hilbish has been installed and is not the default shell, you can simply run hilbish to start it. This will launch 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.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</guid><description>Hilbish is unique, when interactive it first attempts to run input as Lua and then tries shell script. But if you&amp;rsquo;re normal, you wouldn&amp;rsquo;t really be using Hilbish anyway but you&amp;rsquo;d also not want this (or maybe want Lua only in some cases.)
The &amp;ldquo;runner mode&amp;rdquo; 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.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</guid><description>This has been moved to the hilbish.timers API doc (accessible by doc api hilbish.timers)</description></item><item><title>Completions</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/completions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/completions/</guid><description>Hilbish has a pretty good completion system. It has a nice looking menu, with 2 types of menus: grid (like file completions) or list.
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.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</guid><description>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.
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.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</guid><description>This has been moved to the hilbish.timers API doc (accessible by doc api hilbish.timers)</description></item><item><title>Completions</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/completions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/completions/</guid><description>Hilbish has a pretty good completion system. It has a nice looking menu, with 2 types of menus: grid (like file completions) or list.
Like most parts of Hilbish, it&amp;rsquo;s made to be extensible and customizable. The default handler for completions in general can be overwritten to provide more advanced completions if needed.
Completion Handler By default, it provides 3 things: for the first argument, binaries (with a plain name requested to complete, those in $PATH), files, or command completions.</description></item><item><title>Jobs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/jobs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/jobs/</guid><description>Hilbish has pretty standard job control. It&amp;rsquo;s missing one or two things, but works well. One thing which is different from other shells (besides Hilbish) itself is the API for jobs, and of course it&amp;rsquo;s in Lua. You can add jobs, stop and delete (disown) them and even get output.
Job Interface The job interface refers to hilbish.jobs.

View File

@ -1,13 +1,17 @@
<!doctype html><html><head><title>— Hilbish</title>
<meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,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=" — Hilbish" property="og:title"><meta content="Hilbish is unique, when interactive it first attempts to run input as Lua and then tries shell script. But if you&rsquo;re normal, you wouldn&rsquo;t really be using Hilbish anyway but you&rsquo;d also not want this (or maybe want Lua only in some cases.)
The &ldquo;runner mode&rdquo; 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." property="og:description"><meta content="Hilbish is unique, when interactive it first attempts to run input as Lua and then tries shell script. But if you&rsquo;re normal, you wouldn&rsquo;t really be using Hilbish anyway but you&rsquo;d also not want this (or maybe want Lua only in some cases.)
The &ldquo;runner mode&rdquo; 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." 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><link rel=stylesheet href=/Hilbish/versions/doc-improvements/css/syntax.min.eb77978873f3b324603120b558a36c98ad57d6ee7b77928e3bc131bd76c5935a.css integrity="sha256-63eXiHPzsyRgMSC1WKNsmK1X1u57d5KOO8ExvXbFk1o="></link><style>.heading>.heading-link{opacity:0}.heading:hover>.heading-link{visibility:visible;opacity:1;transition:all .1s ease-in}@keyframes highlight{0%{background:0 0}50%{background:#fff2cf}100%{background:0 0}}div:target{animation:highlight 1.2s;animation-timing-function:cubic-bezier(1,-.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><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 110 8a8 8 0 0116 0zm-3.97-3.03a.75.75.0 00-1.08.022L7.477 9.417 5.384 7.323a.75.75.0 00-1.06 1.06L6.97 11.03a.75.75.0 001.079-.02l3.992-4.99a.75.75.0 00-.01-1.05z"/></symbol><symbol id="info-fill" fill="currentcolor" viewBox="0 0 16 16"><path d="M8 16A8 8 0 108 0a8 8 0 000 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 110-2 1 1 0 010 2z"/></symbol><symbol id="exclamation-triangle-fill" fill="currentcolor" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13.0 00-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 01-1.1.0L7.1 5.995A.905.905.0 018 5zm.002 6a1 1 0 110 2 1 1 0 010-2z"/></symbol></svg><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>
<meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,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=" — Hilbish" property="og:title"><meta content="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.
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." property="og:description"><meta content="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.
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." 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><link rel=stylesheet href=/Hilbish/versions/doc-improvements/css/syntax.min.eb77978873f3b324603120b558a36c98ad57d6ee7b77928e3bc131bd76c5935a.css integrity="sha256-63eXiHPzsyRgMSC1WKNsmK1X1u57d5KOO8ExvXbFk1o="></link><style>.heading>.heading-link{opacity:0}.heading:hover>.heading-link{visibility:visible;opacity:1;transition:all .1s ease-in}@keyframes highlight{0%{background:0 0}50%{background:#fff2cf}100%{background:0 0}}div:target{animation:highlight 1.2s;animation-timing-function:cubic-bezier(1,-.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><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 110 8a8 8 0 0116 0zm-3.97-3.03a.75.75.0 00-1.08.022L7.477 9.417 5.384 7.323a.75.75.0 00-1.06 1.06L6.97 11.03a.75.75.0 001.079-.02l3.992-4.99a.75.75.0 00-.01-1.05z"/></symbol><symbol id="info-fill" fill="currentcolor" viewBox="0 0 16 16"><path d="M8 16A8 8 0 108 0a8 8 0 000 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 110-2 1 1 0 010 2z"/></symbol><symbol id="exclamation-triangle-fill" fill="currentcolor" viewBox="0 0 16 16"><path d="M8.982 1.566a1.13 1.13.0 00-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 01-1.1.0L7.1 5.995A.905.905.0 018 5zm.002 6a1 1 0 110 2 1 1 0 010-2z"/></symbol></svg><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"><li class=nav-item><a href=/Hilbish/versions/doc-improvements/ class=nav-link>Home</a></li><li class=nav-item><a href=/Hilbish/versions/doc-improvements/install/ class=nav-link>Install</a></li><li class=nav-item><a href=/Hilbish/versions/doc-improvements/docs/ class=nav-link>Docs</a></li><li class=nav-item><a href=/Hilbish/versions/doc-improvements/blog/ class=nav-link>Blog</a></li></ul></div></div></nav></header><main><div class="container mt-2"><h1></h1><img src='https://avatars1.githubusercontent.com/u/38820196?s=460&amp;u=b9f4efb2375bae6cb30656d790c6e0a2939327c0&amp;v=4' width=48 style=border-radius:100%>
<em class=text-muted>by <strong>sammyette</strong></em><div class=my-4><p>Hilbish is <em>unique,</em> when interactive it first attempts to run input as
Lua and then tries shell script. But if you&rsquo;re normal, you wouldn&rsquo;t
really be using Hilbish anyway but you&rsquo;d also not want this
(or maybe want Lua only in some cases.)</p><p>The &ldquo;runner mode&rdquo; of Hilbish is customizable via <code>hilbish.runnerMode</code>,
<em class=text-muted>by <strong>sammyette</strong></em><div class=my-4><p>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.</p><p>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.</p><p>Runner mode can also be used to handle specific kinds of input before
evaluating like normal, which is how <a href=https://github.com/TorchedSammy/Link.hsh target=_blank rel=noopener>Link.hsh</a>
handles links.</p><p>The &ldquo;runner mode&rdquo; of Hilbish is customizable via <code>hilbish.runnerMode</code>,
which determines how Hilbish will run user input. By default, this is
set to <code>hybrid</code> which is the previously mentioned behaviour of running Lua
first then going to shell script. If you want the reverse order, you can
@ -23,19 +27,13 @@ if ok then
return input, 0, nil
end</p><pre><code>return hilbish.runner.sh(input)
</code></pre><p>end)</p><p>The <code>hilbish.runner</code> interface is an alternative to using <code>hilbish.runnerMode</code>
and also provides the sh and Lua runner functions that Hilbish itself uses.
A runner function is expected to return 3 values: the input, exit code, and an error.
The input return is there incase you need to prompt for more input.
If you don&rsquo;t, just return the input passed to the runner function.
The exit code has to be a number, it will be 0 otherwise and the error can be
<code>nil</code> to indicate no error.</p><h3 id=functions class=heading>Functions
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><p>These are the &ldquo;low level&rdquo; functions for the <code>hilbish.runner</code> interface.</p><ul><li>setMode(mode) > The same as <code>hilbish.runnerMode</code></li><li>sh(input) -> table > Runs <code>input</code> in Hilbish&rsquo;s sh interpreter</li><li>lua(input) -> table > Evals <code>input</code> as Lua code</li></ul><p>The table value that runners return can have at least 4 values:</p><ul><li><p>input (string): The full input text.</p></li><li><p>exitCode (number): Exit code (usually from a command)</p></li><li><p>continue (boolean): Whether to prompt the user for more input
(in the case of incomplete syntax)</p></li><li><p>err (string): A string that represents an error from the runner.
and also provides the shell script and Lua runner functions that Hilbish itself uses.</p><p>A runner function is expected to return a table with the following values:</p><ul><li><code>exitCode</code> (number): Exit code of the command</li><li><code>input</code> (string): The text input of the user. This is used by Hilbish to append extra input, in case
more is requested.</li><li><code>err</code> (string): A string that represents an error from the runner.
This should only be set when, for example, there is a syntax error.
It can be set to a few special values for Hilbish to throw the right
hooks and have a better looking message.</p></li><li><p><code>&lt;command>: not-found</code> will throw a <code>command.not-found</code> hook
based on what <code>&lt;command></code> is.</p></li><li><p><code>&lt;command>: not-executable</code> will throw a <code>command.not-executable</code> hook.</p></li></ul><p>The others here are defined in Lua and have EmmyLua documentation.
These functions should be preferred over the previous ones.</p><ul><li>setCurrent(mode) > The same as <code>setMode</code>, but works with runners managed
hooks and have a better looking message.<ul><li><code>&lt;command>: not-found</code> will throw a <code>command.not-found</code> hook
based on what <code>&lt;command></code> is.</li><li><code>&lt;command>: not-executable</code> will throw a <code>command.not-executable</code> hook.</li></ul></li><li><code>continue</code> (boolean): Whether Hilbish should prompt the user for no input</li></ul><h3 id=functions class=heading>Functions
<a href=#functions class=heading-link><i class="fas fa-paperclip"></i></a></h3><p>These are the &ldquo;low level&rdquo; functions for the <code>hilbish.runner</code> interface.</p><ul><li>setMode(mode) > The same as <code>hilbish.runnerMode</code></li><li>sh(input) -> table > Runs <code>input</code> in Hilbish&rsquo;s sh interpreter</li><li>lua(input) -> table > Evals <code>input</code> as Lua code</li></ul><p>These functions should be preferred over the previous ones.</p><ul><li>setCurrent(mode) > The same as <code>setMode</code>, but works with runners managed
via the functions below.</li><li>add(name, runner) > Adds a runner to a table of available runners. The <code>runner</code>
argument is either a function or a table with a run callback.</li><li>set(name, runner) > The same as <code>add</code> but requires passing a table and
overwrites if the <code>name</code>d runner already exists.</li><li>get(name) > runner > Gets a runner by name. It is a table with at least a

View File

@ -18,8 +18,8 @@ Adding the return types for all functions that need them Documenting Hilbish typ
This is a big release, coming 9 months after the previous v1.2.0 and featuring over 40+ bug fixes and tons of new features and enhancements, so let&amp;rsquo;s see what is in this release.
Documentation When querying about the problems people have with Hilbish, one of the issues was its poor documentation.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/hooks/job/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/hooks/job/</guid><description>Note: job refers to a job object. You can check doc jobs for more detail.
job.start -&amp;gt; job &amp;gt; Thrown when a new background job starts.
job.done -&amp;gt; job &amp;gt; Thrown when a background jobs exits.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</guid><description>Hilbish is unique, when interactive it first attempts to run input as Lua and then tries shell script. But if you&amp;rsquo;re normal, you wouldn&amp;rsquo;t really be using Hilbish anyway but you&amp;rsquo;d also not want this (or maybe want Lua only in some cases.)
The &amp;ldquo;runner mode&amp;rdquo; 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.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</guid><description>This has been moved to the hilbish.timers API doc (accessible by doc api hilbish.timers)</description></item><item><title>Command</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/hooks/command/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/hooks/command/</guid><description>command.preexec -&amp;gt; input, cmdStr &amp;gt; Thrown before a command is executed. The input is the user written command, while cmdStr is what will be executed (input will have aliases while cmdStr will have alias resolved input).
job.done -&amp;gt; job &amp;gt; Thrown when a background jobs exits.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/runner-mode/</guid><description>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.
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.</description></item><item><title/><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/timers/</guid><description>This has been moved to the hilbish.timers API doc (accessible by doc api hilbish.timers)</description></item><item><title>Command</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/hooks/command/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/hooks/command/</guid><description>command.preexec -&amp;gt; input, cmdStr &amp;gt; Thrown before a command is executed. The input is the user written command, while cmdStr is what will be executed (input will have aliases while cmdStr will have alias resolved input).
command.exit -&amp;gt; code, cmdStr &amp;gt; Thrown when a command exits. code is the exit code of the command, and cmdStr is the command that was run.
command.not-found -&amp;gt; cmdStr &amp;gt; Thrown when a command is not found.</description></item><item><title>Completions</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/completions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/completions/</guid><description>Hilbish has a pretty good completion system. It has a nice looking menu, with 2 types of menus: grid (like file completions) or list.
Like most parts of Hilbish, it&amp;rsquo;s made to be extensible and customizable. The default handler for completions in general can be overwritten to provide more advanced completions if needed.
@ -34,18 +34,20 @@ Functions (Note that in the list here, they&amp;rsquo;re called from hilbish.job
Usage of the Bait module consists of userstanding event-driven architecture, but it&amp;rsquo;s pretty simple: If you want to act on a certain event, you can catch it. You can act on events via callback functions.</description></item><item><title>Module commander</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/commander/</guid><description>Introduction Commander is the library which handles Hilbish commands. This makes the user able to add Lua-written commands to their shell without making a separate script in a bin folder. Instead, you may simply use the Commander library in your Hilbish config.
1local commander = require &amp;#39;commander&amp;#39; 2 3commander.register(&amp;#39;hello&amp;#39;, function(args, sinks) 4 sinks.out:writeln &amp;#39;Hello world!&amp;#39; 5end) In this example, a command with the name of hello is created that will print Hello world!</description></item><item><title>Module fs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/fs/</guid><description>Introduction The fs module provides filesystem functions to Hilbish. While Lua&amp;rsquo;s standard library has some I/O functions, they&amp;rsquo;re missing a lot of the basics. The fs library offers more functions and will work on any operating system Hilbish does.
Functions abs(path) -&amp;gt; string Returns an absolute version of the path. basename(path) -&amp;gt; string Returns the &amp;ldquo;basename,&amp;rdquo; or the last part of the provided path. If path is empty, cd(dir) Changes Hilbish&amp;rsquo;s directory to dir.</description></item><item><title>Module hilbish.aliases</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.aliases/</guid><description>Introduction The alias interface deals with all command aliases in Hilbish.
Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&amp;gt; table&amp;lt;string, string&amp;gt; Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&amp;gt; command (string) Tries to resolve an alias to its command. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.</description></item><item><title>Module hilbish.completion</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</guid><description>Introduction The completions interface deals with tab completions.
Functions add(alias, cmd) This is an alias (ha) for the hilbish.alias function. delete(name) Removes an alias. list() -&amp;gt; table[string, string] Get a table of all aliases, with string keys as the alias and the value as the command. resolve(alias) -&amp;gt; string? Resolves an alias to its original command. Will thrown an error if the alias doesn&amp;rsquo;t exist. hilbish.aliases.add(alias, cmd) This is an alias (ha) for the hilbish.</description></item><item><title>Module hilbish.completion</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.completion/</guid><description>Introduction The completions interface deals with tab completions.
Functions bins(query, ctx, fields) -&amp;gt; entries (table), prefix (string) Return binaries/executables based on the provided parameters. call(name, query, ctx, fields) -&amp;gt; completionGroups (table), prefix (string) Calls a completer function. This is mainly used to call a command completer, which will have a name files(query, ctx, fields) -&amp;gt; entries (table), prefix (string) Returns file matches based on the provided parameters. handler(line, pos) This function contains the general completion handler for Hilbish.</description></item><item><title>Module hilbish.editor</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.editor/</guid><description>Introduction The hilbish.editor interface provides functions to directly interact with the line editor in use.
Functions getLine() -&amp;gt; string Returns the current input line. getVimRegister(register) -&amp;gt; string Returns the text that is at the register. insert(text) Inserts text into the line. getChar() -&amp;gt; string Reads a keystroke from the user. This is in a format setVimRegister(register, text) Sets the vim register at register to hold the passed text. hilbish.editor.getLine() -> string Returns the current input line.</description></item><item><title>Module hilbish.history</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</guid><description>Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history.
Functions add(cmd) Adds a command to the history. all() -&amp;gt; table Retrieves all history. clear() Deletes all commands from the history. get(idx) Retrieves a command from the history based on the idx. size() -&amp;gt; number Returns the amount of commands in the history. hilbish.history.add(cmd) Adds a command to the history.</description></item><item><title>Module hilbish.jobs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</guid><description>Introduction Manage interactive jobs in Hilbish via Lua.
Functions getLine() -&amp;gt; string Returns the current input line. getVimRegister(register) -&amp;gt; string Returns the text that is at the register. insert(text) Inserts text into the Hilbish command line. getChar() -&amp;gt; string Reads a keystroke from the user. This is in a format of something like Ctrl-L. setVimRegister(register, text) Sets the vim register at register to hold the passed text.</description></item><item><title>Module hilbish.history</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.history/</guid><description>Introduction The history interface deals with command history. This includes the ability to override functions to change the main method of saving history.
Functions add(cmd) Adds a command to the history. all() -&amp;gt; table Retrieves all history as a table. clear() Deletes all commands from the history. get(index) Retrieves a command from the history based on the index. size() -&amp;gt; number Returns the amount of commands in the history. hilbish.</description></item><item><title>Module hilbish.jobs</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.jobs/</guid><description>Introduction Manage interactive jobs in Hilbish via Lua.
Jobs are the name of background tasks/commands. A job can be started via interactive usage or with the functions defined below for use in external runners.
Functions add(cmdstr, args, execPath) Adds a new job to the job table. Note that this does not immediately run it. all() -&amp;gt; table&amp;lt;@Job&amp;gt; Returns a table of all job objects. disown(id) Disowns a job. This deletes it from the job table.</description></item><item><title>Module hilbish.module</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</guid><description>Introduction The hilbish.module interface provides a function to load Hilbish plugins/modules. Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin ) that are used to add functionality to Hilbish that cannot be written in Lua for any reason.
Note that you don&amp;rsquo;t ever need to use the load function that is here as modules can be loaded with a require call like Lua C modules, and the search paths can be changed with the paths property here.</description></item><item><title>Module hilbish.os</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</guid><description> Introduction The os interface provides simple text information properties about the current OS on the systen. This mainly includes the name and version.
Functions add(cmdstr, args, execPath) Creates a new job. This function does not run the job. This function is intended to be all() -&amp;gt; table[@Job] Returns a table of all job objects. disown(id) Disowns a job. This simply deletes it from the list of jobs without stopping it.</description></item><item><title>Module hilbish.module</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.module/</guid><description>Introduction The hilbish.module interface provides a function to load Hilbish plugins/modules. Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin ) that are used to add functionality to Hilbish that cannot be written in Lua for any reason.
Note that you don&amp;rsquo;t ever need to use the load function that is here as modules can be loaded with a require call like Lua C modules, and the search paths can be changed with the paths property here.</description></item><item><title>Module hilbish.os</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.os/</guid><description> Introduction Provides simple text information properties about the current operating system. This mainly includes the name and version.
Static module fields family Family name of the current OS name Pretty name of the current OS version Version of the current OS</description></item><item><title>Module hilbish.runner</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.runner/</guid><description>Introduction The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. Users can add and change the default runner for interactive input to any language or script of their choosing. A good example is using it to write command in Fennel.
Functions setMode(cb) This is the same as the hilbish.runnerMode function. It takes a callback, lua(cmd) Evaluates cmd as Lua input. This is the same as using dofile sh(cmd) Runs a command in Hilbish&amp;rsquo;s shell script interpreter.</description></item><item><title>Module hilbish.timers</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</guid><description>Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don&amp;rsquo;t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts.
These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish). But if you want slightly more control over them, there is the hilbish.timers interface. It allows you to get a timer via ID and control them.</description></item><item><title>Module hilbish.userDir</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</guid><description> Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user&amp;rsquo;s preferred directories for configs and data.
Functions setMode(cb) This is the same as the hilbish.runnerMode function. lua(cmd) Evaluates cmd as Lua input. This is the same as using dofile sh(cmd) Runs a command in Hilbish&amp;rsquo;s shell script interpreter.</description></item><item><title>Module hilbish.timers</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.timers/</guid><description>Introduction If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don&amp;rsquo;t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts.
These are the simple functions hilbish.interval and hilbish.timeout (doc accessible with doc hilbish, or Module hilbish on the Website).
An example of usage:
1local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function() 2 print &amp;#39;hello!</description></item><item><title>Module hilbish.userDir</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/hilbish/hilbish.userdir/</guid><description> Introduction This interface just contains properties to know about certain user directories. It is equivalent to XDG on Linux and gets the user&amp;rsquo;s preferred directories for configs and data.
Static module fields config The user&amp;rsquo;s config directory data The user&amp;rsquo;s directory for program data</description></item><item><title>Module terminal</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/api/terminal/</guid><description>Introduction The terminal library is a simple and lower level library for certain terminal interactions.
Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal setRaw() Puts the terminal in raw mode size() Gets the dimensions of the terminal. Returns a table with width and height terminal.restoreState() Restores the last saved state of the terminal
Functions restoreState() Restores the last saved state of the terminal saveState() Saves the current state of the terminal. setRaw() Puts the terminal into raw mode. size() Gets the dimensions of the terminal. Returns a table with width and height terminal.restoreState() Restores the last saved state of the terminal
Parameters This function has no parameters.</description></item><item><title>Notification</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/notifications/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/notifications/</guid><description>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.
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.</description></item><item><title>Runner Mode</title><link>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/runner-mode/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rosettea.github.io/Hilbish/versions/doc-improvements/docs/features/runner-mode/</guid><description>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.