Compare commits

...

2 Commits

Author SHA1 Message Date
TorchedSammy d1b7515722
fix(docgen): remove trailing spaces in docs 2022-02-24 20:42:54 -04:00
TorchedSammy b468727a32
refactor(docgen): remove global doc 2022-02-24 20:37:13 -04:00
6 changed files with 4 additions and 11 deletions

View File

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

View File

@ -3,4 +3,3 @@ 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 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` throw(name, ...args) > Throws a hook with `name` with the provided `args`

View File

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

View File

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

View File

@ -36,4 +36,3 @@ 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. run(cmd) > Runs `cmd` in Hilbish's sh interpreter.
timeout(cb, time) > Runs the `cb` function after `time` in milliseconds timeout(cb, time) > Runs the `cb` function after `time` in milliseconds

View File

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