mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 00:09:41 +00:00
54 lines
1.3 KiB
Lua
54 lines
1.3 KiB
Lua
|
-- links-filter.lua
|
||
|
function Link(el)
|
||
|
found, _, a, b = string.find(el.target, "^(%w+)%.scad#(.*)$")
|
||
|
if found then
|
||
|
el.target = string.format("#%sscadmd__%s", string.lower(a), string.lower(b))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a = string.find(el.target, "^(%w+)%.scad$")
|
||
|
if found then
|
||
|
el.target = string.format("#%sscadmd", string.lower(a))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a, b = string.find(el.target, "^Tutorial-(%w+)%#(.*)$")
|
||
|
if found then
|
||
|
el.target = string.format("#tutorial-%smd__%s", string.lower(a), string.lower(b))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a = string.find(el.target, "^Tutorial-(%w+)$")
|
||
|
if found then
|
||
|
el.target = string.format("#tutorial-%smd", string.lower(a))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a, b = string.find(el.target, "^(%w+)%.md#(.*)$")
|
||
|
if found then
|
||
|
el.target = string.format("#%smd__%s", string.lower(a), string.lower(b))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a = string.find(el.target, "^(%w+)%.md$")
|
||
|
if found then
|
||
|
el.target = string.format("#%smd", string.lower(a))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a, b = string.find(el.target, "^(%w+)#(.*)$")
|
||
|
if found then
|
||
|
el.target = string.format("#%smd__%s", string.lower(a), string.lower(b))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
found, _, a = string.find(el.target, "^(%w+)$")
|
||
|
if found then
|
||
|
el.target = string.format("#%smd", string.lower(a))
|
||
|
return el
|
||
|
end
|
||
|
|
||
|
return el
|
||
|
end
|
||
|
|