mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-04 20:53:24 +00:00
docs: fix snail docs
This commit is contained in:
parent
a2e23f1310
commit
c121356e0f
@ -84,6 +84,7 @@ var prefix = map[string]string{
|
||||
"commander": "c",
|
||||
"bait": "b",
|
||||
"terminal": "term",
|
||||
"snail": "snail",
|
||||
}
|
||||
|
||||
func getTagsAndDocs(docs string) (map[string][]tag, []string) {
|
||||
@ -209,6 +210,10 @@ func setupDocType(mod string, typ *doc.Type) *docPiece {
|
||||
}
|
||||
|
||||
func setupDoc(mod string, fun *doc.Func) *docPiece {
|
||||
if fun.Doc == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
docs := strings.TrimSpace(fun.Doc)
|
||||
tags, parts := getTagsAndDocs(docs)
|
||||
|
||||
|
@ -9,101 +9,26 @@ menu:
|
||||
|
||||
## Introduction
|
||||
|
||||
The snail library houses Hilbish's Lua wrapper of its shell script interpreter.
|
||||
It's not very useful other than running shell scripts, which can be done with other
|
||||
Hilbish functions.
|
||||
The snail library houses Hilbish's Lua wrapper of its shell script interpreter.
|
||||
It's not very useful other than running shell scripts, which can be done with other
|
||||
Hilbish functions.
|
||||
|
||||
## Functions
|
||||
|||
|
||||
|----|----|
|
||||
|<a href="#handleStream"></a>||
|
||||
|<a href="#loaderFunc"></a>||
|
||||
|<a href="#snailUserData"></a>||
|
||||
|<a href="#snew">new() -> @Snail</a>|Creates a new Snail instance.|
|
||||
|<a href="#splitInput"></a>||
|
||||
|<a href="#Run"></a>||
|
||||
|<a href="#new">new() -> @Snail</a>|Creates a new Snail instance.|
|
||||
|
||||
<hr>
|
||||
<div id='handleStream'>
|
||||
<h4 class='heading'>
|
||||
snail.
|
||||
<a href="#handleStream" class='heading-link'>
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
|
||||
#### Parameters
|
||||
This function has no parameters.
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id='loaderFunc'>
|
||||
<h4 class='heading'>
|
||||
snail.
|
||||
<a href="#loaderFunc" class='heading-link'>
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
|
||||
#### Parameters
|
||||
This function has no parameters.
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id='snailUserData'>
|
||||
<h4 class='heading'>
|
||||
snail.
|
||||
<a href="#snailUserData" class='heading-link'>
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
|
||||
#### Parameters
|
||||
This function has no parameters.
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id='snew'>
|
||||
<div id='new'>
|
||||
<h4 class='heading'>
|
||||
snail.new() -> <a href="/Hilbish/docs/api/snail/#snail" style="text-decoration: none;" id="lol">Snail</a>
|
||||
<a href="#snew" class='heading-link'>
|
||||
<a href="#new" class='heading-link'>
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
Creates a new Snail instance.
|
||||
|
||||
#### Parameters
|
||||
This function has no parameters.
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id='splitInput'>
|
||||
<h4 class='heading'>
|
||||
snail.
|
||||
<a href="#splitInput" class='heading-link'>
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
|
||||
#### Parameters
|
||||
This function has no parameters.
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id='Run'>
|
||||
<h4 class='heading'>
|
||||
snail.
|
||||
<a href="#Run" class='heading-link'>
|
||||
<i class="fas fa-paperclip"></i>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
|
||||
#### Parameters
|
||||
This function has no parameters.
|
||||
</div>
|
||||
|
@ -2,25 +2,10 @@
|
||||
|
||||
local snail = {}
|
||||
|
||||
---
|
||||
function snail. end
|
||||
|
||||
---
|
||||
function snail. end
|
||||
|
||||
---
|
||||
function snail. end
|
||||
|
||||
--- Creates a new Snail instance.
|
||||
function snail.new() end
|
||||
|
||||
---
|
||||
function snail. end
|
||||
|
||||
--- Runs a shell command. Works the same as `hilbish.run`.
|
||||
function snail:run(command, streams) end
|
||||
|
||||
---
|
||||
function snail. end
|
||||
|
||||
return snail
|
||||
|
@ -1,8 +1,8 @@
|
||||
// shell script interpreter library
|
||||
/*
|
||||
The snail library houses Hilbish's Lua wrapper of its shell script interpreter.
|
||||
It's not very useful other than running shell scripts, which can be done with other
|
||||
Hilbish functions.
|
||||
The snail library houses Hilbish's Lua wrapper of its shell script interpreter.
|
||||
It's not very useful other than running shell scripts, which can be done with other
|
||||
Hilbish functions.
|
||||
*/
|
||||
package snail
|
||||
|
||||
@ -56,7 +56,7 @@ func loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
|
||||
|
||||
// new() -> @Snail
|
||||
// Creates a new Snail instance.
|
||||
func snew(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
func snailnew(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
s := New(t.Runtime)
|
||||
return c.PushingNext1(t.Runtime, rt.UserDataValue(snailUserData(s))), nil
|
||||
}
|
||||
@ -64,7 +64,7 @@ func snew(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
// #member
|
||||
// run(command, streams)
|
||||
// Runs a shell command. Works the same as `hilbish.run`.
|
||||
func srun(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
func snailrun(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
if err := c.CheckNArgs(2); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user