mirror of https://github.com/Hilbis/Hilbish
Compare commits
7 Commits
887260cd8a
...
109b5785af
Author | SHA1 | Date |
---|---|---|
sammyette | 109b5785af | |
sammyette | a6bcfdfca9 | |
sammyette | 4e023703b6 | |
sammyette | 5814462f5d | |
sammyette | 354f257c03 | |
TorchedSammy | a2f0ff3e09 | |
sammyette | 07a7a75b46 |
|
@ -92,9 +92,9 @@ func (a *aliasModule) Loader(rtm *rt.Runtime) *rt.Table {
|
|||
func _hlalias() {}
|
||||
|
||||
// #interface aliases
|
||||
// list() -> aliases (table)
|
||||
// list() -> table<string, string>
|
||||
// Get a table of all aliases, with string keys as the alias and the value as the command.
|
||||
// @returns table<string, string>
|
||||
// --- @returns table<string, string>
|
||||
func (a *aliasModule) luaList(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||
aliasesList := rt.NewTable()
|
||||
for k, v := range a.All() {
|
||||
|
|
|
@ -17,9 +17,8 @@ This is an alias (ha) for the `hilbish.alias` function.
|
|||
### delete(name)
|
||||
Removes an alias.
|
||||
|
||||
### list() -> aliases (table)
|
||||
### list() -> table<string, string>
|
||||
Get a table of all aliases, with string keys as the alias and the value as the command.
|
||||
@returns table<string, string>
|
||||
|
||||
### resolve(alias) -> command (string)
|
||||
Tries to resolve an alias to its command.
|
||||
|
|
|
@ -4,6 +4,11 @@ local lunacolors = require 'lunacolors'
|
|||
|
||||
commander.register('doc', function(args)
|
||||
local moddocPath = hilbish.dataDir .. '/docs/'
|
||||
local stat = fs.stat '.git/refs/heads/extended-job-api'
|
||||
if stat then
|
||||
-- hilbish git
|
||||
moddocPath = './docs/'
|
||||
end
|
||||
local apidocHeader = [[
|
||||
# %s
|
||||
{grayBg} {white}{italic}%s {reset}
|
||||
|
@ -24,6 +29,9 @@ commander.register('doc', function(args)
|
|||
subdocName = '_index'
|
||||
end
|
||||
f = io.open(moddocPath .. subdocName .. '.md', 'rb')
|
||||
if not f then
|
||||
f = io.open(moddocPath .. subdocName:match '%w+' .. '/' .. subdocName .. '.md', 'rb')
|
||||
end
|
||||
if not f then
|
||||
moddocPath = moddocPath .. subdocName .. '/'
|
||||
subdocName = args[3] or '_index'
|
||||
|
@ -31,7 +39,7 @@ commander.register('doc', function(args)
|
|||
end
|
||||
if not f then
|
||||
print('No documentation found for ' .. mod .. '.')
|
||||
return
|
||||
return 1
|
||||
end
|
||||
end
|
||||
funcdocs = f:read '*a':gsub('-([%d]+)', '%1')
|
||||
|
|
Loading…
Reference in New Issue