Private/Protected Markdown fix, added run for bigfont
This commit is contained in:
@@ -146,8 +146,11 @@ local VisualElement = elementManager.getElement("VisualElement")
|
|||||||
---@configDefault false
|
---@configDefault false
|
||||||
|
|
||||||
--- The BigFont element is a text element that displays larger text. It uses Wojbie's BigFont API to render the text in a larger font size. Credits to Wojbie for the original API.
|
--- The BigFont element is a text element that displays larger text. It uses Wojbie's BigFont API to render the text in a larger font size. Credits to Wojbie for the original API.
|
||||||
--- @usage local font = main:addBigFont()
|
--- @run local basalt = require("basalt")
|
||||||
--- @usage font:setText("Hello World!")
|
--- @run local main = basalt.getMainFrame()
|
||||||
|
--- @run local font = main:addBigFont()
|
||||||
|
--- @run font:setText("Hello World!")
|
||||||
|
--- @run basalt.run()
|
||||||
---@class BigFont : VisualElement
|
---@class BigFont : VisualElement
|
||||||
local BigFont = setmetatable({}, VisualElement)
|
local BigFont = setmetatable({}, VisualElement)
|
||||||
BigFont.__index = BigFont
|
BigFont.__index = BigFont
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ local function processDescription(description)
|
|||||||
local lines = {}
|
local lines = {}
|
||||||
for line in description:gmatch("([^\n]*)\n?") do
|
for line in description:gmatch("([^\n]*)\n?") do
|
||||||
if line ~= "" then
|
if line ~= "" then
|
||||||
-- URLs in Markdown-Links umwandeln
|
|
||||||
line = line:gsub("https?://[^%s]+", function(url)
|
line = line:gsub("https?://[^%s]+", function(url)
|
||||||
return "[" .. url .. "](" .. url .. ")"
|
return "[" .. url .. "](" .. url .. ")"
|
||||||
end)
|
end)
|
||||||
@@ -192,13 +191,21 @@ function markdownGenerator.generate(ast)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not class.skipFunctionList and #class.functions > 0 then
|
if not class.skipFunctionList and #class.functions > 0 then
|
||||||
table.insert(md, "## Functions")
|
local publicFunctions = {}
|
||||||
table.insert(md, "")
|
|
||||||
table.insert(md, "|Method|Returns|Description|")
|
|
||||||
table.insert(md, "|---|---|---|")
|
|
||||||
|
|
||||||
for _, f in ipairs(class.functions) do
|
for _, f in ipairs(class.functions) do
|
||||||
local methodName = (class.name or "") .. (f.static and "." or ":") .. (f.name or "")
|
if f.visibility ~= "private" and f.visibility ~= "protected" then
|
||||||
|
table.insert(publicFunctions, f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if #publicFunctions > 0 then
|
||||||
|
table.insert(md, "## Functions")
|
||||||
|
table.insert(md, "")
|
||||||
|
table.insert(md, "|Method|Returns|Description|")
|
||||||
|
table.insert(md, "|---|---|---|")
|
||||||
|
|
||||||
|
for _, f in ipairs(publicFunctions) do
|
||||||
|
local methodName = (class.name or "") .. (f.static and "." or ":") .. (f.name or "")
|
||||||
|
|
||||||
local anchor = methodName:lower()
|
local anchor = methodName:lower()
|
||||||
if #f.params > 0 then
|
if #f.params > 0 then
|
||||||
@@ -223,13 +230,14 @@ function markdownGenerator.generate(ast)
|
|||||||
anchor,
|
anchor,
|
||||||
returnType,
|
returnType,
|
||||||
shortDesc))
|
shortDesc))
|
||||||
end
|
end
|
||||||
table.insert(md, "")
|
table.insert(md, "")
|
||||||
|
|
||||||
if not class.skipDetailedFunctionList then
|
if not class.skipDetailedFunctionList then
|
||||||
local functionMd = generateFunctionMarkdown(class, class.functions)
|
local functionMd = generateFunctionMarkdown(class, publicFunctions)
|
||||||
for _, line in ipairs(functionMd) do
|
for _, line in ipairs(functionMd) do
|
||||||
table.insert(md, line)
|
table.insert(md, line)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user