chore: merge from master

docs-types
sammyette 2023-01-07 14:21:30 -04:00
commit 731b3db2de
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 10 additions and 2 deletions

0
.hugo_build.lock 100644
View File

View File

@ -4,6 +4,11 @@ local lunacolors = require 'lunacolors'
commander.register('doc', function(args) commander.register('doc', function(args)
local moddocPath = hilbish.dataDir .. '/docs/' 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 = [[ local apidocHeader = [[
# %s # %s
{grayBg} {white}{italic}%s {reset} {grayBg} {white}{italic}%s {reset}
@ -34,14 +39,17 @@ Available sections: ]] .. table.concat(modules, ', ')
subdocName = '_index' subdocName = '_index'
end end
f = io.open(moddocPath .. subdocName .. '.md', 'rb') 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 if not f then
moddocPath = moddocPath .. subdocName .. '/' moddocPath = moddocPath .. subdocName .. '/'
subdocName = args[3] or '_index' subdocName = args[3] or '_index'
f = io.open(moddocPath .. subdocName .. '.md', 'rb') f = io.open(moddocPath .. subdocName .. '.md', 'rb')
end end
if not f then if not f then
print('No documentation found for ' .. args[#args] .. '.') print('No documentation found for ' .. mod .. '.')
return return 1
end end
end end
funcdocs = f:read '*a':gsub('-([%d]+)', '%1') funcdocs = f:read '*a':gsub('-([%d]+)', '%1')