Skip to content

Commit e10d3c1

Browse files
committed
Private/Protected Markdown fix, added run for bigfont
1 parent ccf9a07 commit e10d3c1

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

src/elements/BigFont.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ local VisualElement = elementManager.getElement("VisualElement")
146146
---@configDefault false
147147

148148
--- 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.
149-
--- @usage local font = main:addBigFont()
150-
--- @usage font:setText("Hello World!")
149+
--- @run local basalt = require("basalt")
150+
--- @run local main = basalt.getMainFrame()
151+
--- @run local font = main:addBigFont()
152+
--- @run font:setText("Hello World!")
153+
--- @run basalt.run()
151154
---@class BigFont : VisualElement
152155
local BigFont = setmetatable({}, VisualElement)
153156
BigFont.__index = BigFont

tools/BasaltDoc/utils/markdownGenerator.lua

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ local function processDescription(description)
55
local lines = {}
66
for line in description:gmatch("([^\n]*)\n?") do
77
if line ~= "" then
8-
-- URLs in Markdown-Links umwandeln
98
line = line:gsub("https?://[^%s]+", function(url)
109
return "[" .. url .. "](" .. url .. ")"
1110
end)
@@ -192,13 +191,21 @@ function markdownGenerator.generate(ast)
192191
end
193192

194193
if not class.skipFunctionList and #class.functions > 0 then
195-
table.insert(md, "## Functions")
196-
table.insert(md, "")
197-
table.insert(md, "|Method|Returns|Description|")
198-
table.insert(md, "|---|---|---|")
199-
194+
local publicFunctions = {}
200195
for _, f in ipairs(class.functions) do
201-
local methodName = (class.name or "") .. (f.static and "." or ":") .. (f.name or "")
196+
if f.visibility ~= "private" and f.visibility ~= "protected" then
197+
table.insert(publicFunctions, f)
198+
end
199+
end
200+
201+
if #publicFunctions > 0 then
202+
table.insert(md, "## Functions")
203+
table.insert(md, "")
204+
table.insert(md, "|Method|Returns|Description|")
205+
table.insert(md, "|---|---|---|")
206+
207+
for _, f in ipairs(publicFunctions) do
208+
local methodName = (class.name or "") .. (f.static and "." or ":") .. (f.name or "")
202209

203210
local anchor = methodName:lower()
204211
if #f.params > 0 then
@@ -223,13 +230,14 @@ function markdownGenerator.generate(ast)
223230
anchor,
224231
returnType,
225232
shortDesc))
226-
end
227-
table.insert(md, "")
233+
end
234+
table.insert(md, "")
228235

229-
if not class.skipDetailedFunctionList then
230-
local functionMd = generateFunctionMarkdown(class, class.functions)
231-
for _, line in ipairs(functionMd) do
232-
table.insert(md, line)
236+
if not class.skipDetailedFunctionList then
237+
local functionMd = generateFunctionMarkdown(class, publicFunctions)
238+
for _, line in ipairs(functionMd) do
239+
table.insert(md, line)
240+
end
233241
end
234242
end
235243
end

0 commit comments

Comments
 (0)