mirror of https://github.com/Hilbis/Hilbish
deploy: a105b8e38d
parent
d69cc71c24
commit
1cdeb56366
|
@ -6,6 +6,6 @@ Hilbish</a>
|
||||||
It throws hooks that you can catch. This is what you will use if
|
It throws hooks that you can catch. This is what you will use if
|
||||||
you want to listen in on hooks to know when certain things have
|
you want to listen in on hooks to know when certain things have
|
||||||
happened, like when you’ve changed directory, a command has failed,
|
happened, like when you’ve changed directory, a command has failed,
|
||||||
etc. To find all available hooks thrown by Hilbish, see doc hooks.</p><h3 id=functions>Functions</h3><h4 id=catchname-cb>catch(name, cb)</h4><p>Catches a hook with <code>name</code>. Runs the <code>cb</code> when it is thrown</p><h4 id=catchoncename-cb>catchOnce(name, cb)</h4><p>Same as catch, but only runs the <code>cb</code> once and then removes the hook</p><h4 id=hooksname---cb-cb>hooks(name) -> {cb, cb…}</h4><p>Returns a table with hooks on the event with <code>name</code>.</p><h4 id=releasename-catcher>release(name, catcher)</h4><p>Removes the <code>catcher</code> for the event with <code>name</code>
|
etc. To find all available hooks thrown by Hilbish, see doc hooks.</p><h3 id=functions>Functions</h3><h4 id=catchname-cb>catch(name, cb)</h4><p>Catches a hook with <code>name</code>. Runs the <code>cb</code> when it is thrown</p><h4 id=catchoncename-cb>catchOnce(name, cb)</h4><p>Same as catch, but only runs the <code>cb</code> once and then removes the hook</p><h4 id=hooksname-->hooks(name) -></h4><p>Returns a table with hooks (callback functions) on the event with <code>name</code>.</p><h4 id=releasename-catcher>release(name, catcher)</h4><p>Removes the <code>catcher</code> for the event with <code>name</code>
|
||||||
For this to work, <code>catcher</code> has to be the same function used to catch
|
For this to work, <code>catcher</code> has to be the same function used to catch
|
||||||
an event, like one saved to a variable.</p><h4 id=throwname-args>throw(name, …args)</h4><p>Throws a hook with <code>name</code> with the provided <code>args</code></p></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></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><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-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><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></footer></body></html>
|
an event, like one saved to a variable.</p><h4 id=throwname-args>throw(name, …args)</h4><p>Throws a hook with <code>name</code> with the provided <code>args</code></p></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></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><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-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><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></footer></body></html>
|
|
@ -7,5 +7,10 @@ and other things, and acts an addition to the Lua standard library’s
|
||||||
I/O and filesystem functions.</p><h3 id=functions>Functions</h3><h4 id=abspath>abs(path)</h4><p>Gives an absolute version of <code>path</code>.</p><h4 id=basenamepath>basename(path)</h4><p>Gives the basename of <code>path</code>. For the rules,
|
I/O and filesystem functions.</p><h3 id=functions>Functions</h3><h4 id=abspath>abs(path)</h4><p>Gives an absolute version of <code>path</code>.</p><h4 id=basenamepath>basename(path)</h4><p>Gives the basename of <code>path</code>. For the rules,
|
||||||
see Go’s filepath.Base</p><h4 id=cddir>cd(dir)</h4><p>Changes directory to <code>dir</code></p><h4 id=dirpath>dir(path)</h4><p>Returns the directory part of <code>path</code>. For the rules, see Go’s
|
see Go’s filepath.Base</p><h4 id=cddir>cd(dir)</h4><p>Changes directory to <code>dir</code></p><h4 id=dirpath>dir(path)</h4><p>Returns the directory part of <code>path</code>. For the rules, see Go’s
|
||||||
filepath.Dir</p><h4 id=globpattern>glob(pattern)</h4><p>Glob all files and directories that match the pattern.
|
filepath.Dir</p><h4 id=globpattern>glob(pattern)</h4><p>Glob all files and directories that match the pattern.
|
||||||
For the rules, see Go’s filepath.Glob</p><h4 id=joinpaths>join(paths…)</h4><p>Takes paths and joins them together with the OS’s
|
For the rules, see Go’s filepath.Glob</p><h4 id=join>join(…)</h4><p>Takes paths and joins them together with the OS’s
|
||||||
directory separator (forward or backward slash).</p><h4 id=mkdirname-recursive>mkdir(name, recursive)</h4><p>Makes a directory called <code>name</code>. If <code>recursive</code> is true, it will create its parent directories.</p><h4 id=readdirdir>readdir(dir)</h4><p>Returns a table of files in <code>dir</code></p><h4 id=statpath>stat(path)</h4><p>Returns info about <code>path</code></p></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></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><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-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><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></footer></body></html>
|
directory separator (forward or backward slash).</p><h4 id=mkdirname-recursive>mkdir(name, recursive)</h4><p>Makes a directory called <code>name</code>. If <code>recursive</code> is true, it will create its parent directories.</p><h4 id=readdirdir-->readdir(dir) -></h4><p>Returns a table of files in <code>dir</code>.</p><h4 id=statpath-->stat(path) -></h4><p>Returns a table of info about the <code>path</code>.
|
||||||
|
It contains the following keys:
|
||||||
|
name (string) - Name of the path
|
||||||
|
size (number) - Size of the path
|
||||||
|
mode (string) - Permission mode in an octal format string (with leading 0)
|
||||||
|
isDir (boolean) - If the path is a directory</p></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></div></div><footer class="footer mt-auto mt-auto py-3 bg-light row"><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-flower.png alt height=48 class="d-inline-block align-text-top"></a><p class=text-muted>Rosettea © 2022<br>Made with <i class="fa-solid fa-heart" style=color:#f6345b></i></p></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"></div><div class="col mb-3"><h5>Hilbish</h5><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></footer></body></html>
|
Loading…
Reference in New Issue