diff --git a/src/scripts/elua/apps/docgen/writer.lua b/src/scripts/elua/apps/docgen/writer.lua index 10f5d66a52..cfd7a4ecf7 100644 --- a/src/scripts/elua/apps/docgen/writer.lua +++ b/src/scripts/elua/apps/docgen/writer.lua @@ -113,7 +113,7 @@ M.Writer = util.Object:clone { end flags.section = nil local flstr = {} - for k, v in ipairs(flags) do + for k, v in pairs(flags) do local allow = allowed_incflags[k] if allow ~= nil then if type(allow) == "boolean" then @@ -161,6 +161,17 @@ M.Writer = util.Object:clone { return self end, + write_editable = function(self, ns, name) + ns[#ns + 1] = name + ns[#ns + 1] = false + self:write_include(self.INCLUDE_PAGE, ns, { + date = false, user = false, link = false + }) + -- restore the table for later reuse + ns[#ns] = nil + ns[#ns] = nil + end, + write_fmt = function(self, fmt1, fmt2, ...) self:write_raw(fmt1, ...) self:write_raw(fmt2) diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua index 320435c287..8b2de94531 100644 --- a/src/scripts/elua/apps/gendoc.lua +++ b/src/scripts/elua/apps/gendoc.lua @@ -708,11 +708,7 @@ local build_class = function(cl) f:write_raw(cl:doc_get():full_get(nil, true)) f:write_nl(2) - cln[#cln + 1] = "description" - cln[#cln + 1] = false - f:write_include(f.INCLUDE_PAGE, cln, { - date = false, user = false, link = false - }) + f:write_editable(cln, "description") f:write_nl() build_functable(f, "Methods", "Method name", cl, dtree.Function.METHOD)