From 43c851798bd86827dfc56bb8d8eed265029a12d4 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 6 Jun 2019 04:20:47 -0400 Subject: [PATCH] doc: Update the parser for the next commits. Otherwise the CI will fail. --- docs/_parser.lua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/_parser.lua b/docs/_parser.lua index 323f8677..a1ad5b8a 100644 --- a/docs/_parser.lua +++ b/docs/_parser.lua @@ -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