Skip to content

Commit 899a56f

Browse files
committed
Markdown Fix
1 parent c9f17ce commit 899a56f

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/elements/BigFont.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---@splitClass
21
-------------------------------------------------------------------------------------
32
-- Wojbies API 5.0 - Bigfont - functions to write bigger font using drawing sybols --
43
-------------------------------------------------------------------------------------
@@ -11,8 +10,10 @@
1110
-- 5. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
1211
-- NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY NUCLEAR FACILITY.
1312

13+
1414
-- Basalt - Nyorie: Please don't copy paste this code to your projects, this code is slightly changed (to fit the way basalt draws elements), if you want the original code, checkout this:
1515
-- http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/
16+
---@skip
1617
---@class BigFontText
1718
local tHex = require("libraries/colorHex")
1819

@@ -137,7 +138,7 @@ local function makeText(nSize, sString, nFC, nBC, bBlit)
137138
return {tText, tFront, tBack}
138139
end
139140

140-
--- This part has nothing to do with Wojbie's BigFont API:
141+
-- This part has nothing to do with Wojbie's BigFont API:
141142

142143
local elementManager = require("elementManager")
143144
local VisualElement = elementManager.getElement("VisualElement")

tools/BasaltDoc/utils/markdownGenerator.lua

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
local markdownGenerator = {}
22

3+
local function processDescription(description)
4+
if not description then return nil end
5+
local lines = {}
6+
for line in description:gmatch("([^\n]*)\n?") do
7+
if line ~= "" then
8+
-- URLs in Markdown-Links umwandeln
9+
line = line:gsub("https?://[^%s]+", function(url)
10+
return "[" .. url .. "](" .. url .. ")"
11+
end)
12+
table.insert(lines, "_" .. line .. "_")
13+
else
14+
table.insert(lines, "")
15+
end
16+
end
17+
return table.concat(lines, "\n")
18+
end
19+
320
local function generateFunctionMarkdown(class, functions)
421
local md = {}
522

@@ -130,7 +147,10 @@ function markdownGenerator.generate(ast)
130147
local title = class.title or class.name
131148
table.insert(md, "# " .. title)
132149
if class.description then
133-
table.insert(md, "_" .. class.description .. "_")
150+
local processedDesc = processDescription(class.description)
151+
if processedDesc then
152+
table.insert(md, processedDesc)
153+
end
134154
end
135155
if class.extends then
136156
table.insert(md, "")

0 commit comments

Comments
 (0)