2
2
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:
sammyette 2025-04-02 21:42:45 -04:00
parent a2e23f1310
commit c121356e0f
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
4 changed files with 16 additions and 101 deletions

View File

@ -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)

View File

@ -16,94 +16,19 @@ menu:
## 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>

View File

@ -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

View File

@ -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
}