2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-20 20:43:23 +00:00

feat: add description gen, and more spacing between param listing

This commit is contained in:
sammyette 2025-03-17 21:47:53 -04:00
parent 2399c45960
commit 2e9925ef2a
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
6 changed files with 1257 additions and 16 deletions

View File

@ -49,10 +49,14 @@ for _, fname in ipairs(files) do
if emmy then if emmy then
if emmy == 'param' then if emmy == 'param' then
print('bruh', emmythings[1], emmythings[2])
table.insert(dps.params, 1, { table.insert(dps.params, 1, {
name = emmythings[1], name = emmythings[1],
type = emmythings[2] type = emmythings[2],
-- the +1 accounts for space.
description = table.concat(emmythings, ' '):sub(emmythings[1]:len() + 1 + emmythings[2]:len() + 1)
}) })
print(table.concat(emmythings, '/'))
end end
else else
table.insert(dps.description, 1, docline) table.insert(dps.description, 1, docline)
@ -160,7 +164,8 @@ for iface, dps in pairs(pieces) do
f:write 'This function has no parameters. \n' f:write 'This function has no parameters. \n'
end end
for _, param in ipairs(docs.params) do for _, param in ipairs(docs.params) do
f:write(string.format('`%s` **`%s`**\n', param.name:gsub('%?$', ''), param.type)) f:write(string.format('`%s` **`%s`** \n', param.name:gsub('%?$', ''), param.type))
f:write(string.format('%s\n\n', param.description))
end end
--[[ --[[
local params = table.filter(docs, function(t) local params = table.filter(docs, function(t)

File diff suppressed because it is too large Load Diff

View File

@ -145,7 +145,9 @@ hilbish.runner.setCurrent(name)
Sets the current interactive/command line runner mode. Sets the current interactive/command line runner mode.
#### Parameters #### Parameters
`name` **`string`** `name` **`string`**
</div> </div>
<hr> <hr>
@ -160,8 +162,12 @@ hilbish.runner.add(name, runner)
Adds a runner to the table of available runners. If runner is a table, Adds a runner to the table of available runners. If runner is a table,
it must have the run function in it. it must have the run function in it.
#### Parameters #### Parameters
`name` **`string`** `name` **`string`**
`runner` **`function`**
`runner` **`function|table`**
</div> </div>
<hr> <hr>
@ -175,7 +181,9 @@ hilbish.runner.get(name)
Get a runner by name. Get a runner by name.
#### Parameters #### Parameters
`name` **`string`** `name` **`string`**
</div> </div>
<hr> <hr>
@ -189,8 +197,12 @@ hilbish.runner.set(name, runner)
Sets a runner by name. The runner table must have the run function in it. Sets a runner by name. The runner table must have the run function in it.
#### Parameters #### Parameters
`name` **`string`** `name` **`string`**
`runner` **`table`**
`runner` **`table`**
</div> </div>
<hr> <hr>
@ -205,7 +217,11 @@ hilbish.runner.exec(cmd, runnerName)
Executes cmd with a runner. If runnerName isn't passed, it uses Executes cmd with a runner. If runnerName isn't passed, it uses
the user's current runner. the user's current runner.
#### Parameters #### Parameters
`cmd` **`string`** `cmd` **`string`**
`runnerName` **`string?`**
`runnerName` **`string?`**
</div> </div>

View File

@ -18,7 +18,9 @@ dirs.setOld(d)
Sets the old directory string. Sets the old directory string.
#### Parameters #### Parameters
`d` **`string`** `d` **`string`**
</div> </div>
<hr> <hr>
@ -46,7 +48,9 @@ dirs.peak(num)
Look at `num` amount of recent directories, starting from the latest. Look at `num` amount of recent directories, starting from the latest.
#### Parameters #### Parameters
`num` **`number`** `num` **`number`**
</div> </div>
<hr> <hr>
@ -60,7 +64,9 @@ dirs.pop(num)
Remove the specified amount of dirs from the recent directories list. Remove the specified amount of dirs from the recent directories list.
#### Parameters #### Parameters
`num` **`number`** `num` **`number`**
</div> </div>
<hr> <hr>
@ -74,6 +80,8 @@ dirs.recent(idx)
Get entry from recent directories list based on index. Get entry from recent directories list based on index.
#### Parameters #### Parameters
`idx` **`number`** `idx` **`number`**
</div> </div>

View File

@ -53,7 +53,7 @@ function hilbish.messages.read(idx)
end end
end end
function hilbish.messages.readAll(idx) function hilbish.messages.readAll()
for _, msg in ipairs(hilbish.messages.all()) do for _, msg in ipairs(hilbish.messages.all()) do
hilbish.messages.read(msg.index) hilbish.messages.read(msg.index)
end end
@ -63,6 +63,7 @@ function hilbish.messages.unreadCount()
return unread return unread
end end
--- Deletes the message at `idx`.
function hilbish.messages.delete(idx) function hilbish.messages.delete(idx)
local msg = M._messages[idx] local msg = M._messages[idx]
if not msg then if not msg then

View File

@ -21,7 +21,7 @@ end
--- Adds a runner to the table of available runners. If runner is a table, --- Adds a runner to the table of available runners. If runner is a table,
--- it must have the run function in it. --- it must have the run function in it.
--- @param name string --- @param name string
--- @param runner function | table --- @param runner function|table
function hilbish.runner.add(name, runner) function hilbish.runner.add(name, runner)
if type(name) ~= 'string' then if type(name) ~= 'string' then
error 'expected runner name to be a table' error 'expected runner name to be a table'