mirror of
https://github.com/0x5eal/luau-unzip.git
synced 2025-04-08 00:01:00 +01:00
chore(lune): write info logs for docsgen script
This commit is contained in:
parent
2d9293dbbc
commit
f397b84a7b
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
local fs = require("@lune/fs")
|
local fs = require("@lune/fs")
|
||||||
|
|
||||||
local moonwave = require("./moonwave")
|
local moonwave = require("./moonwave")
|
||||||
|
local logger = require("./log")
|
||||||
|
|
||||||
local function writeSectionHeader(buf: string, title: string)
|
local function writeSectionHeader(buf: string, title: string)
|
||||||
buf ..= `## {title}\n`
|
buf ..= `## {title}\n`
|
||||||
|
@ -95,8 +96,10 @@ local function writeType(buf: string, name: string, desc: string, type: string)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function writeMarkdown(path: string, items: { moonwave.Item })
|
local function writeMarkdown(path: string, items: { moonwave.Item })
|
||||||
local buf = ""
|
local start = os.clock()
|
||||||
|
local buf = ""
|
||||||
for _, item in items do
|
for _, item in items do
|
||||||
|
logger.log("info", "Generating docs for", item.name)
|
||||||
buf = writeClass(buf, item.name, item.desc)
|
buf = writeClass(buf, item.name, item.desc)
|
||||||
|
|
||||||
local props: { moonwave.Property } = {}
|
local props: { moonwave.Property } = {}
|
||||||
|
@ -166,6 +169,8 @@ local function writeMarkdown(path: string, items: { moonwave.Item })
|
||||||
buf = writeRef(buf, item.name)
|
buf = writeRef(buf, item.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
logger.log("info", string.format("Generated docs in %.2fms", (os.clock() - start) * 1000))
|
||||||
|
logger.log("info", "Writing to", path)
|
||||||
fs.writeFile(path, buf)
|
fs.writeFile(path, buf)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue