chore(lune): write info logs for docsgen script

This commit is contained in:
Erica Marigold 2025-02-21 19:19:14 +00:00
parent 2d9293dbbc
commit f397b84a7b
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw

View file

@ -1,6 +1,7 @@
local fs = require("@lune/fs")
local moonwave = require("./moonwave")
local logger = require("./log")
local function writeSectionHeader(buf: string, title: string)
buf ..= `## {title}\n`
@ -95,8 +96,10 @@ local function writeType(buf: string, name: string, desc: string, type: string)
end
local function writeMarkdown(path: string, items: { moonwave.Item })
local buf = ""
local start = os.clock()
local buf = ""
for _, item in items do
logger.log("info", "Generating docs for", item.name)
buf = writeClass(buf, item.name, item.desc)
local props: { moonwave.Property } = {}
@ -166,6 +169,8 @@ local function writeMarkdown(path: string, items: { moonwave.Item })
buf = writeRef(buf, item.name)
end
logger.log("info", string.format("Generated docs in %.2fms", (os.clock() - start) * 1000))
logger.log("info", "Writing to", path)
fs.writeFile(path, buf)
end