Compare commits

..

No commits in common. "d1b7515722b2867a99d63e35634f3dcae7ef3434" and "62d8725d99c4061ae60f7aa2028b3c7266641af4" have entirely different histories.

6 changed files with 11 additions and 4 deletions

View File

@ -38,6 +38,7 @@ func main() {
}
prefix := map[string]string{
"main": "hsh",
"hilbish": "hl",
"fs": "f",
"commander": "c",
@ -52,7 +53,7 @@ func main() {
mod := l
if strings.HasPrefix(t.Name, "hl") { mod = "hilbish" }
if !strings.HasPrefix(t.Name, prefix[mod]) || t.Name == "Loader" { continue }
parts := strings.Split(strings.TrimSpace(t.Doc), "\n")
parts := strings.Split(t.Doc, "\n")
funcsig := parts[0]
doc := parts[1:]
@ -61,7 +62,7 @@ func main() {
for _, t := range p.Types {
for _, m := range t.Methods {
if !strings.HasPrefix(m.Name, prefix[l]) || m.Name == "Loader" { continue }
parts := strings.Split(strings.TrimSpace(m.Doc), "\n")
parts := strings.Split(m.Doc, "\n")
funcsig := parts[0]
doc := parts[1:]
@ -71,8 +72,9 @@ func main() {
}
for mod, v := range docs {
if mod == "main" { mod = "global" }
os.Mkdir("docs", 0777)
f, _ := os.Create("docs/" + mod + ".txt")
f.WriteString(strings.Join(v, "\n\n") + "\n")
f.WriteString(strings.Join(v, "\n") + "\n")
}
}

View File

@ -3,3 +3,4 @@ catch(name, cb) > Catches a hook with `name`. Runs the `cb` when it is thrown
catchOnce(name, cb) > Same as catch, but only runs the `cb` once and then removes the hook
throw(name, ...args) > Throws a hook with `name` with the provided `args`

View File

@ -1,3 +1,4 @@
deregister(name) > Deregisters any command registered with `name`
register(name, cb) > Register a command with `name` that runs `cb` when ran

View File

@ -5,3 +5,4 @@ mkdir(name, recursive) > Makes a directory called `name`. If `recursive` is true
readdir(dir) > Returns a table of files in `dir`
stat(path) > Returns info about `path`

View File

@ -36,3 +36,4 @@ Returns `input`, will be nil if ctrl + d is pressed, or an error occurs (which s
run(cmd) > Runs `cmd` in Hilbish's sh interpreter.
timeout(cb, time) > Runs the `cb` function after `time` in milliseconds

View File

@ -6,3 +6,4 @@ saveState() > Saves the current state of the terminal
size() > Gets the dimensions of the terminal. Returns a table with `width` and `height`
Note: this is not the size in relation to the dimensions of the display