Markdown changes

This commit is contained in:
Robert Jelic
2025-03-18 01:51:37 +01:00
parent 7e2d186837
commit 2dc08bc3a3
2 changed files with 26 additions and 2 deletions

View File

@@ -314,6 +314,10 @@ local function markdownEvents(className)
return output
end
local function formatLink(str)
return str:lower():gsub("[()]", ""):gsub("[:.]+", "-")
end
local function markdownClassFunctionList(className)
if(#markdown.blocks<=0)then
return ""
@@ -333,7 +337,7 @@ local function markdownClassFunctionList(className)
local output = "\n## Functions\n\n|Method|Returns|Description|\n|---|---|---|\n"
for _, block in pairs(fList) do
if block.type == "function" then
output = output .. "|[" .. block.func .. "](#" .. block.func .. ")|"
output = output .. "|[" .. block.func .. "](#" .. formatLink(block.func) .. ")|"
if(block["return"]~=nil)then
local returnType = block["return"][1]:match("^(%S+)")
output = output .. returnType.."|"
@@ -369,7 +373,7 @@ local function markdownProtectedFunctions(className)
output = "\n## Protected Functions\n\n|Method|Returns|Description|\n|---|---|---|\n"
for _, block in pairs(fList) do
if block.type == "function" then
output = output .. "|[" .. block.func .. "](#" .. block.func .. ")|"
output = output .. "|"..block.func.."|"
if(block["return"]~=nil)then
local returnType = block["return"][1]:match("^(%S+)")
output = output .. returnType.."|"