mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-27 16:03:23 +00:00
fix(docs): keep order of functions in lua docgen consistent
This commit is contained in:
parent
24de9e5baf
commit
4e05026e4e
@ -74,7 +74,7 @@ for _, fname in ipairs(files) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pieces[mod][funcName] = dps
|
table.insert(pieces[mod], {funcName, dps})
|
||||||
end
|
end
|
||||||
docPiece = {}
|
docPiece = {}
|
||||||
goto continue2
|
goto continue2
|
||||||
@ -142,7 +142,10 @@ for iface, dps in pairs(pieces) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for func, docs in pairs(dps) do
|
table.sort(dps, function(a, b) return a[1] < b[1] end)
|
||||||
|
for _, piece in pairs(dps) do
|
||||||
|
local func = piece[1]
|
||||||
|
local docs = piece[2]
|
||||||
local sig = string.format('%s.%s(', iface, func)
|
local sig = string.format('%s.%s(', iface, func)
|
||||||
local params = ''
|
local params = ''
|
||||||
for idx, param in ipairs(docs.params) do
|
for idx, param in ipairs(docs.params) do
|
||||||
|
@ -23,8 +23,8 @@ The `hilbish.message` type is a table with the following keys:
|
|||||||
|||
|
|||
|
||||||
|----|----|
|
|----|----|
|
||||||
|<a href="#unreadCount">unreadCount()</a>|Returns the amount of unread messages.|
|
|<a href="#unreadCount">unreadCount()</a>|Returns the amount of unread messages.|
|
||||||
|<a href="#readAll">readAll()</a>|Marks all messages as read.|
|
|
||||||
|<a href="#send">send(message)</a>|Sends a message.|
|
|<a href="#send">send(message)</a>|Sends a message.|
|
||||||
|
|<a href="#readAll">readAll()</a>|Marks all messages as read.|
|
||||||
|<a href="#read">read(idx)</a>|Marks a message at `idx` as read.|
|
|<a href="#read">read(idx)</a>|Marks a message at `idx` as read.|
|
||||||
|<a href="#delete">delete(idx)</a>|Deletes the message at `idx`.|
|
|<a href="#delete">delete(idx)</a>|Deletes the message at `idx`.|
|
||||||
|<a href="#clear">clear()</a>|Deletes all messages.|
|
|<a href="#clear">clear()</a>|Deletes all messages.|
|
||||||
@ -89,6 +89,20 @@ Marks a message at `idx` as read.
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='readAll'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
hilbish.messages.readAll()
|
||||||
|
<a href="#readAll" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
Marks all messages as read.
|
||||||
|
#### Parameters
|
||||||
|
This function has no parameters.
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='send'>
|
<div id='send'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
@ -105,20 +119,6 @@ Sends a message.
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
|
||||||
<div id='readAll'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
hilbish.messages.readAll()
|
|
||||||
<a href="#readAll" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
Marks all messages as read.
|
|
||||||
#### Parameters
|
|
||||||
This function has no parameters.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='unreadCount'>
|
<div id='unreadCount'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
title: Module hilbish.os
|
|
||||||
description: operating system info
|
|
||||||
layout: doc
|
|
||||||
menu:
|
|
||||||
docs:
|
|
||||||
parent: "API"
|
|
||||||
---
|
|
||||||
|
|
||||||
## Introduction
|
|
||||||
Provides simple text information properties about the current operating system.
|
|
||||||
This mainly includes the name and version.
|
|
||||||
|
|
||||||
## Static module fields
|
|
||||||
|||
|
|
||||||
|----|----|
|
|
||||||
|family|Family name of the current OS|
|
|
||||||
|name|Pretty name of the current OS|
|
|
||||||
|version|Version of the current OS|
|
|
||||||
|
|
@ -55,15 +55,15 @@ end)
|
|||||||
|||
|
|||
|
||||||
|----|----|
|
|----|----|
|
||||||
|<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="#exec">exec(cmd, runnerName)</a>|Executes `cmd` with a runner.|
|
|<a href="#sh">sh()</a>|nil|
|
||||||
|
|<a href="#setMode">setMode(mode)</a>|**NOTE: This function is deprecated and will be removed in 3.0**|
|
||||||
|
|<a href="#setCurrent">setCurrent(name)</a>|Sets Hilbish's runner mode by name.|
|
||||||
|
|<a href="#set">set(name, runner)</a>|*Sets* a runner by name. The difference between this function and|
|
||||||
|<a href="#run">run(input, priv)</a>|Runs `input` with the currently set Hilbish runner.|
|
|<a href="#run">run(input, priv)</a>|Runs `input` with the currently set Hilbish runner.|
|
||||||
|<a href="#getCurrent">getCurrent()</a>|Returns the current runner by name.|
|
|<a href="#getCurrent">getCurrent()</a>|Returns the current runner by name.|
|
||||||
|<a href="#setCurrent">setCurrent(name)</a>|Sets Hilbish's runner mode by name.|
|
|
||||||
|<a href="#setMode">setMode(mode)</a>|**NOTE: This function is deprecated and will be removed in 3.0**|
|
|
||||||
|<a href="#sh">sh()</a>|nil|
|
|
||||||
|<a href="#add">add(name, runner)</a>|Adds a runner to the table of available runners.|
|
|
||||||
|<a href="#set">set(name, runner)</a>|*Sets* a runner by name. The difference between this function and|
|
|
||||||
|<a href="#get">get(name)</a>|Get a runner by name.|
|
|<a href="#get">get(name)</a>|Get a runner by name.|
|
||||||
|
|<a href="#exec">exec(cmd, runnerName)</a>|Executes `cmd` with a runner.|
|
||||||
|
|<a href="#add">add(name, runner)</a>|Adds a runner to the table of available runners.|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='runner.lua'>
|
<div id='runner.lua'>
|
||||||
@ -81,43 +81,6 @@ or `load`, but is appropriated for the runner interface.
|
|||||||
`string` **`cmd`**
|
`string` **`cmd`**
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<div id='get'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
hilbish.runner.get(name)
|
|
||||||
<a href="#get" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
Get a runner by name.
|
|
||||||
#### Parameters
|
|
||||||
`name` **`string`**
|
|
||||||
Name of the runner to retrieve.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<div id='set'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
hilbish.runner.set(name, runner)
|
|
||||||
<a href="#set" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
*Sets* a runner by name. The difference between this function and
|
|
||||||
add, is set will *not* check if the named runner exists.
|
|
||||||
The runner table must have the run function in it.
|
|
||||||
#### Parameters
|
|
||||||
`name` **`string`**
|
|
||||||
|
|
||||||
|
|
||||||
`runner` **`table`**
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
@ -141,52 +104,38 @@ If runner is a table, it must have the run function in it.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='sh'>
|
<div id='exec'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
hilbish.runner.sh()
|
hilbish.runner.exec(cmd, runnerName)
|
||||||
<a href="#sh" class='heading-link'>
|
<a href="#exec" class='heading-link'>
|
||||||
<i class="fas fa-paperclip"></i>
|
<i class="fas fa-paperclip"></i>
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
|
Executes `cmd` with a runner.
|
||||||
|
If `runnerName` is not specified, it uses the default Hilbish runner.
|
||||||
#### Parameters
|
#### Parameters
|
||||||
This function has no parameters.
|
`cmd` **`string`**
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<div id='setMode'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
hilbish.runner.setMode(mode)
|
|
||||||
<a href="#setMode" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
**NOTE: This function is deprecated and will be removed in 3.0**
|
`runnerName` **`string?`**
|
||||||
Use `hilbish.runner.setCurrent` instead.
|
|
||||||
This is the same as the `hilbish.runnerMode` function.
|
|
||||||
It takes a callback, which will be used to execute all interactive input.
|
|
||||||
Or a string which names the runner mode to use.
|
|
||||||
#### Parameters
|
|
||||||
`mode` **`string|function`**
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='setCurrent'>
|
<div id='get'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
hilbish.runner.setCurrent(name)
|
hilbish.runner.get(name)
|
||||||
<a href="#setCurrent" class='heading-link'>
|
<a href="#get" class='heading-link'>
|
||||||
<i class="fas fa-paperclip"></i>
|
<i class="fas fa-paperclip"></i>
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
Sets Hilbish's runner mode by name.
|
Get a runner by name.
|
||||||
#### Parameters
|
#### Parameters
|
||||||
`name` **`string`**
|
`name` **`string`**
|
||||||
|
Name of the runner to retrieve.
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -226,22 +175,73 @@ This method is how Hilbish executes commands.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='exec'>
|
<div id='set'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
hilbish.runner.exec(cmd, runnerName)
|
hilbish.runner.set(name, runner)
|
||||||
<a href="#exec" class='heading-link'>
|
<a href="#set" class='heading-link'>
|
||||||
<i class="fas fa-paperclip"></i>
|
<i class="fas fa-paperclip"></i>
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
Executes `cmd` with a runner.
|
*Sets* a runner by name. The difference between this function and
|
||||||
If `runnerName` is not specified, it uses the default Hilbish runner.
|
add, is set will *not* check if the named runner exists.
|
||||||
|
The runner table must have the run function in it.
|
||||||
#### Parameters
|
#### Parameters
|
||||||
`cmd` **`string`**
|
`name` **`string`**
|
||||||
|
|
||||||
|
|
||||||
`runnerName` **`string?`**
|
`runner` **`table`**
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='setCurrent'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
hilbish.runner.setCurrent(name)
|
||||||
|
<a href="#setCurrent" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
Sets Hilbish's runner mode by name.
|
||||||
|
#### Parameters
|
||||||
|
`name` **`string`**
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='setMode'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
hilbish.runner.setMode(mode)
|
||||||
|
<a href="#setMode" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
**NOTE: This function is deprecated and will be removed in 3.0**
|
||||||
|
Use `hilbish.runner.setCurrent` instead.
|
||||||
|
This is the same as the `hilbish.runnerMode` function.
|
||||||
|
It takes a callback, which will be used to execute all interactive input.
|
||||||
|
Or a string which names the runner mode to use.
|
||||||
|
#### Parameters
|
||||||
|
`mode` **`string|function`**
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='sh'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
hilbish.runner.sh()
|
||||||
|
<a href="#sh" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
This function has no parameters.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@ -15,43 +15,11 @@ directories.
|
|||||||
## Functions
|
## Functions
|
||||||
|||
|
|||
|
||||||
|----|----|
|
|----|----|
|
||||||
|
|<a href="#setOld">setOld(d)</a>|Sets the old directory string.|
|
||||||
|<a href="#recent">recent(idx)</a>|Get entry from recent directories list based on index.|
|
|<a href="#recent">recent(idx)</a>|Get entry from recent directories list based on index.|
|
||||||
|
|<a href="#push">push(dir)</a>|Add `dir` to the recent directories list.|
|
||||||
|<a href="#pop">pop(num)</a>|Remove the specified amount of dirs from the recent directories list.|
|
|<a href="#pop">pop(num)</a>|Remove the specified amount of dirs from the recent directories list.|
|
||||||
|<a href="#peak">peak(num)</a>|Look at `num` amount of recent directories, starting from the latest.|
|
|<a href="#peak">peak(num)</a>|Look at `num` amount of recent directories, starting from the latest.|
|
||||||
|<a href="#push">push(dir)</a>|Add `dir` to the recent directories list.|
|
|
||||||
|<a href="#setOld">setOld(d)</a>|Sets the old directory string.|
|
|
||||||
<hr>
|
|
||||||
<div id='setOld'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
dirs.setOld(d)
|
|
||||||
<a href="#setOld" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
Sets the old directory string.
|
|
||||||
#### Parameters
|
|
||||||
`d` **`string`**
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<div id='push'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
dirs.push(dir)
|
|
||||||
<a href="#push" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
Add `dir` to the recent directories list.
|
|
||||||
#### Parameters
|
|
||||||
`dir` **`string`**
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='peak'>
|
<div id='peak'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
@ -83,6 +51,22 @@ Remove the specified amount of dirs from the recent directories list.
|
|||||||
`num` **`number`**
|
`num` **`number`**
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='push'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
dirs.push(dir)
|
||||||
|
<a href="#push" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
Add `dir` to the recent directories list.
|
||||||
|
#### Parameters
|
||||||
|
`dir` **`string`**
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
@ -101,3 +85,19 @@ Get entry from recent directories list based on index.
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='setOld'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
dirs.setOld(d)
|
||||||
|
<a href="#setOld" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
Sets the old directory string.
|
||||||
|
#### Parameters
|
||||||
|
`d` **`string`**
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@ -17,29 +17,9 @@ is by the Greenhouse pager.
|
|||||||
## Functions
|
## Functions
|
||||||
|||
|
|||
|
||||||
|----|----|
|
|----|----|
|
||||||
|
|<a href="#renderInfoBlock">renderInfoBlock(type, text)</a>|Renders an info block. An info block is a block of text with|
|
||||||
|<a href="#renderCodeBlock">renderCodeBlock(text)</a>|Assembles and renders a code block. This returns|
|
|<a href="#renderCodeBlock">renderCodeBlock(text)</a>|Assembles and renders a code block. This returns|
|
||||||
|<a href="#highlight">highlight(text)</a>|Performs basic Lua code highlighting.|
|
|<a href="#highlight">highlight(text)</a>|Performs basic Lua code highlighting.|
|
||||||
|<a href="#renderInfoBlock">renderInfoBlock(type, text)</a>|Renders an info block. An info block is a block of text with|
|
|
||||||
<hr>
|
|
||||||
<div id='renderInfoBlock'>
|
|
||||||
<h4 class='heading'>
|
|
||||||
doc.renderInfoBlock(type, text)
|
|
||||||
<a href="#renderInfoBlock" class='heading-link'>
|
|
||||||
<i class="fas fa-paperclip"></i>
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
Renders an info block. An info block is a block of text with
|
|
||||||
an icon and styled text block.
|
|
||||||
#### Parameters
|
|
||||||
`type` **`string`**
|
|
||||||
Type of info block. The only one specially styled is the `warning`.
|
|
||||||
|
|
||||||
`text` **`string`**
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id='highlight'>
|
<div id='highlight'>
|
||||||
<h4 class='heading'>
|
<h4 class='heading'>
|
||||||
@ -74,3 +54,23 @@ and styles it to resemble a code block.
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<div id='renderInfoBlock'>
|
||||||
|
<h4 class='heading'>
|
||||||
|
doc.renderInfoBlock(type, text)
|
||||||
|
<a href="#renderInfoBlock" class='heading-link'>
|
||||||
|
<i class="fas fa-paperclip"></i>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
Renders an info block. An info block is a block of text with
|
||||||
|
an icon and styled text block.
|
||||||
|
#### Parameters
|
||||||
|
`type` **`string`**
|
||||||
|
Type of info block. The only one specially styled is the `warning`.
|
||||||
|
|
||||||
|
`text` **`string`**
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user