From ecea6305a82007b6c8c509fd594f8b52c3331021 Mon Sep 17 00:00:00 2001 From: Vhyrro Date: Sat, 21 Jan 2023 12:39:44 +0100 Subject: [PATCH] feat: strip leading `--` from comments --- docgen/init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docgen/init.lua b/docgen/init.lua index 94feb5581..320a31ff0 100644 --- a/docgen/init.lua +++ b/docgen/init.lua @@ -63,8 +63,14 @@ for module_name, module in pairs(modules) do local config_node = docgen.get_module_config_node(buffer, root) if config_node then - docgen.map_config(buffer, config_node, function(child, comment) - + docgen.map_config(buffer, config_node, function(data, comments) + for i, comment in ipairs(comments) do + -- TODO: Also perform @something lookups + comments[i] = comment:gsub("^%s*%-%-+%s*", "") + end + + comments = table.concat(comments, "\n") + log.warn(comments) end) end end