doc: Update the parser for the next commits.

Otherwise the CI will fail.
This commit is contained in:
Emmanuel Lepage Vallee 2019-06-06 04:20:47 -04:00
parent 52dec54e25
commit 43c851798b
1 changed files with 22 additions and 2 deletions

View File

@ -68,17 +68,37 @@ local function path_to_module(path)
error("Cannot figure out module for " .. tostring(path))
end
local modtypes = {
classmod = true,
widgetmod = true,
containermod = true,
layoutmod = true,
coreclassmod = true,
popupmod = true,
}
local libtypes = {
module = true,
submodule = true,
utillib = true,
themelib = true,
}
function module.path_to_html(path)
local mod = path_to_module(path):gsub(".init", "")
local f = assert(io.open(path))
while true do
local line = f:read()
if not line then break end
if line:match("@classmod") then
local tag = line:gmatch("@([^ ]+) ")() or ""
if modtypes[tag] then
f:close()
return "../classes/".. mod ..".html#"
end
if line:match("@module") or line:match("@submodule") then
if libtypes[tag] then
f:close()
return "../libraries/".. mod ..".html#"
end