docs: fix duplicate functions header

pull/260/head
sammyette 2023-09-09 13:38:54 -04:00
parent 95ac2e280d
commit 726082ba03
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
13 changed files with 5 additions and 13 deletions

View File

@ -435,6 +435,7 @@ func main() {
if modu.ParentModule != "" { if modu.ParentModule != "" {
modOrIface = "Module" modOrIface = "Module"
} }
lastHeader := ""
f, _ := os.Create(docPath) f, _ := os.Create(docPath)
f.WriteString(fmt.Sprintf(header, modOrIface, modname, modu.ShortDescription)) f.WriteString(fmt.Sprintf(header, modOrIface, modname, modu.ShortDescription))
@ -460,6 +461,7 @@ func main() {
} }
f.WriteString("## Functions\n") f.WriteString("## Functions\n")
lastHeader = "functions"
mdTable := md.NewTable(funcCount, 2) mdTable := md.NewTable(funcCount, 2)
mdTable.SetTitle(0, "") mdTable.SetTitle(0, "")
@ -511,7 +513,9 @@ func main() {
} }
if len(modu.Docs) != 0 { if len(modu.Docs) != 0 {
if lastHeader != "functions" {
f.WriteString("## Functions\n") f.WriteString("## Functions\n")
}
for _, dps := range modu.Docs { for _, dps := range modu.Docs {
if dps.IsMember { if dps.IsMember {
continue continue

View File

@ -41,7 +41,6 @@ this function will set the user prompt.
|<a href="#release">release(name, catcher)</a>|Removes the `catcher` for the event with `name`.| |<a href="#release">release(name, catcher)</a>|Removes the `catcher` for the event with `name`.|
|<a href="#throw">throw(name, ...args)</a>|Throws a hook with `name` with the provided `args`| |<a href="#throw">throw(name, ...args)</a>|Throws a hook with `name` with the provided `args`|
## Functions
<hr><div id='catch'> <hr><div id='catch'>
<h4 class='heading'> <h4 class='heading'>
bait.catch(name, cb) bait.catch(name, cb)

View File

@ -43,7 +43,6 @@ name would suggest.
|<a href="#deregister">deregister(name)</a>|Deregisters any command registered with `name`| |<a href="#deregister">deregister(name)</a>|Deregisters any command registered with `name`|
|<a href="#register">register(name, cb)</a>|Register a command with `name` that runs `cb` when ran| |<a href="#register">register(name, cb)</a>|Register a command with `name` that runs `cb` when ran|
## Functions
<hr><div id='deregister'> <hr><div id='deregister'>
<h4 class='heading'> <h4 class='heading'>
commander.deregister(name) commander.deregister(name)

View File

@ -25,7 +25,6 @@ I/O and filesystem functions.
|<a href="#readdir">readdir(dir) -> {}</a>|Returns a table of files in `dir`.| |<a href="#readdir">readdir(dir) -> {}</a>|Returns a table of files in `dir`.|
|<a href="#stat">stat(path) -> {}</a>|Returns a table of info about the `path`.| |<a href="#stat">stat(path) -> {}</a>|Returns a table of info about the `path`.|
## Functions
<hr><div id='abs'> <hr><div id='abs'>
<h4 class='heading'> <h4 class='heading'>
fs.abs(path) -> string fs.abs(path) -> string

View File

@ -46,7 +46,6 @@ interfaces and functions which directly relate to shell functionality.
|vimMode|Current Vim input mode of Hilbish (will be nil if not in Vim input mode)| |vimMode|Current Vim input mode of Hilbish (will be nil if not in Vim input mode)|
|exitCode|xit code of the last executed command| |exitCode|xit code of the last executed command|
## Functions
<hr><div id='alias'> <hr><div id='alias'>
<h4 class='heading'> <h4 class='heading'>
hilbish.alias(cmd, orig) hilbish.alias(cmd, orig)

View File

@ -18,7 +18,6 @@ The alias interface deals with all command aliases in Hilbish.
|<a href="#aliases.list">list() -> table<string, string></a>|Get a table of all aliases, with string keys as the alias and the value as the command.| |<a href="#aliases.list">list() -> table<string, string></a>|Get a table of all aliases, with string keys as the alias and the value as the command.|
|<a href="#aliases.resolve">resolve(alias) -> command (string)</a>|Tries to resolve an alias to its command.| |<a href="#aliases.resolve">resolve(alias) -> command (string)</a>|Tries to resolve an alias to its command.|
## Functions
<hr><div id='aliases.add'> <hr><div id='aliases.add'>
<h4 class='heading'> <h4 class='heading'>
hilbish.aliases.add(alias, cmd) hilbish.aliases.add(alias, cmd)

View File

@ -18,7 +18,6 @@ The completions interface deals with tab completions.
|<a href="#completions.bins">bins(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns binary/executale completion candidates based on the provided query.| |<a href="#completions.bins">bins(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns binary/executale completion candidates based on the provided query.|
|<a href="#completions.files">files(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns file completion candidates based on the provided query.| |<a href="#completions.files">files(query, ctx, fields) -> entries (table), prefix (string)</a>|Returns file completion candidates based on the provided query.|
## Functions
<hr><div id='completions.call'> <hr><div id='completions.call'>
<h4 class='heading'> <h4 class='heading'>
hilbish.completions.call(name, query, ctx, fields) -> completionGroups (table), prefix (string) hilbish.completions.call(name, query, ctx, fields) -> completionGroups (table), prefix (string)

View File

@ -19,7 +19,6 @@ directly interact with the line editor in use.
|<a href="#editor.insert">insert(text)</a>|Inserts text into the line.| |<a href="#editor.insert">insert(text)</a>|Inserts text into the line.|
|<a href="#editor.setVimRegister">setVimRegister(register, text)</a>|Sets the vim register at `register` to hold the passed text.| |<a href="#editor.setVimRegister">setVimRegister(register, text)</a>|Sets the vim register at `register` to hold the passed text.|
## Functions
<hr><div id='editor.getLine'> <hr><div id='editor.getLine'>
<h4 class='heading'> <h4 class='heading'>
hilbish.editor.getLine() -> string hilbish.editor.getLine() -> string

View File

@ -21,7 +21,6 @@ method of saving history.
|<a href="#history.get">get(idx)</a>|Retrieves a command from the history based on the `idx`.| |<a href="#history.get">get(idx)</a>|Retrieves a command from the history based on the `idx`.|
|<a href="#history.size">size() -> number</a>|Returns the amount of commands in the history.| |<a href="#history.size">size() -> number</a>|Returns the amount of commands in the history.|
## Functions
<hr><div id='history.add'> <hr><div id='history.add'>
<h4 class='heading'> <h4 class='heading'>
hilbish.history.add(cmd) hilbish.history.add(cmd)

View File

@ -23,7 +23,6 @@ interactive usage or with the functions defined below for use in external runner
|<a href="#jobs.get">get(id) -> @Job</a>|Get a job object via its ID.| |<a href="#jobs.get">get(id) -> @Job</a>|Get a job object via its ID.|
|<a href="#jobs.last">last() -> @Job</a>|Returns the last added job from the table.| |<a href="#jobs.last">last() -> @Job</a>|Returns the last added job from the table.|
## Functions
<hr><div id='jobs.add'> <hr><div id='jobs.add'>
<h4 class='heading'> <h4 class='heading'>
hilbish.jobs.add(cmdstr, args, execPath) hilbish.jobs.add(cmdstr, args, execPath)

View File

@ -21,7 +21,6 @@ write command in Fennel.
|<a href="#runner.lua">lua(cmd)</a>|Evaluates `cmd` as Lua input. This is the same as using `dofile`| |<a href="#runner.lua">lua(cmd)</a>|Evaluates `cmd` as Lua input. This is the same as using `dofile`|
|<a href="#runner.sh">sh(cmd)</a>|Runs a command in Hilbish's shell script interpreter.| |<a href="#runner.sh">sh(cmd)</a>|Runs a command in Hilbish's shell script interpreter.|
## Functions
<hr><div id='runner.setMode'> <hr><div id='runner.setMode'>
<h4 class='heading'> <h4 class='heading'>
hilbish.runner.setMode(cb) hilbish.runner.setMode(cb)

View File

@ -42,7 +42,6 @@ print(t.running) // true
|INTERVAL|Constant for an interval timer type| |INTERVAL|Constant for an interval timer type|
|TIMEOUT|Constant for a timeout timer type| |TIMEOUT|Constant for a timeout timer type|
## Functions
<hr><div id='timers.create'> <hr><div id='timers.create'>
<h4 class='heading'> <h4 class='heading'>
hilbish.timers.create(type, time, callback) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a> hilbish.timers.create(type, time, callback) -> <a href="/Hilbish/docs/api/hilbish/hilbish.timers/#timer" style="text-decoration: none;" id="lol">Timer</a>

View File

@ -18,7 +18,6 @@ The terminal library is a simple and lower level library for certain terminal in
|<a href="#setRaw">setRaw()</a>|Puts the terminal in raw mode| |<a href="#setRaw">setRaw()</a>|Puts the terminal in raw mode|
|<a href="#size">size()</a>|Gets the dimensions of the terminal. Returns a table with `width` and `height`| |<a href="#size">size()</a>|Gets the dimensions of the terminal. Returns a table with `width` and `height`|
## Functions
<hr><div id='restoreState'> <hr><div id='restoreState'>
<h4 class='heading'> <h4 class='heading'>
terminal.restoreState() terminal.restoreState()