Docs
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
local markdown = require("tools/markdown")
|
||||||
|
|
||||||
local function ensureDirectory(path)
|
local function ensureDirectory(path)
|
||||||
local dir = path:match("(.*)/[^/]*$")
|
local dir = path:match("(.*)/[^/]*$")
|
||||||
if dir then
|
if dir then
|
||||||
@@ -6,9 +8,8 @@ local function ensureDirectory(path)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function processFile(inputFile)
|
local function processFile(inputFile)
|
||||||
local f = io.open(inputFile, "r")
|
local parsed = markdown.parseFile(inputFile)
|
||||||
local content = f:read("*all")
|
local md = markdown.makeMarkdown(parsed)
|
||||||
f:close()
|
|
||||||
|
|
||||||
local outputFile
|
local outputFile
|
||||||
if inputFile:match("^src/[^/]+%.lua$") then
|
if inputFile:match("^src/[^/]+%.lua$") then
|
||||||
@@ -20,9 +21,7 @@ local function processFile(inputFile)
|
|||||||
ensureDirectory(outputFile)
|
ensureDirectory(outputFile)
|
||||||
print(string.format("Processing: %s -> %s", inputFile, outputFile))
|
print(string.format("Processing: %s -> %s", inputFile, outputFile))
|
||||||
|
|
||||||
local out = io.open(outputFile, "w")
|
markdown.saveToFile(outputFile, md)
|
||||||
out:write(content)
|
|
||||||
out:close()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for file in io.popen('find "src" -type f -name "*.lua"'):lines() do
|
for file in io.popen('find "src" -type f -name "*.lua"'):lines() do
|
||||||
|
|||||||
Reference in New Issue
Block a user