aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordvs12025-03-14 22:22:00 +1000
committerdvs12025-03-14 22:22:00 +1000
commitbbbab8880f7ffdbe22db008ea069ae8dd6d1a22e (patch)
treeaf751ec174fb588db33b2c9ab0ae1a2b3dcc679f
parentMake the last commit actually work. (diff)
downloadnotYetAnotherWiki-bbbab8880f7ffdbe22db008ea069ae8dd6d1a22e.zip
notYetAnotherWiki-bbbab8880f7ffdbe22db008ea069ae8dd6d1a22e.tar.gz
notYetAnotherWiki-bbbab8880f7ffdbe22db008ea069ae8dd6d1a22e.tar.bz2
notYetAnotherWiki-bbbab8880f7ffdbe22db008ea069ae8dd6d1a22e.tar.xz
Add a top link to headings.
-rw-r--r--default.template2
-rwxr-xr-xnotYetAnotherWiki.lua10
2 files changed, 6 insertions, 6 deletions
diff --git a/default.template b/default.template
index 2357782..a23bf89 100644
--- a/default.template
+++ b/default.template
@@ -85,7 +85,7 @@
85 <div class="boxWrapper"> 85 <div class="boxWrapper">
86 <input type="checkbox" id="modeToggleMenu"/> 86 <input type="checkbox" id="modeToggleMenu"/>
87 <input type="checkbox" id="modeToggleBody"/> 87 <input type="checkbox" id="modeToggleBody"/>
88 <div class="boxLogo"><header><nav> 88 <div class="boxLogo" id="top"><header><nav>
89 <a href="$home$"><img src="$logo$" alt="not (Yet) (Another / A) Wiki."/></a> 89 <a href="$home$"><img src="$logo$" alt="not (Yet) (Another / A) Wiki."/></a>
90 </nav></header></div> 90 </nav></header></div>
91 <div class="boxTools"><header><nav> 91 <div class="boxTools"><header><nav>
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua
index 7d79304..974fde6 100755
--- a/notYetAnotherWiki.lua
+++ b/notYetAnotherWiki.lua
@@ -712,7 +712,7 @@ end
712 712
713function Writer.header(s, level) 713function Writer.header(s, level)
714 local text = Lunamark.util.rope_to_string(s) 714 local text = Lunamark.util.rope_to_string(s)
715 return '<h' .. level .. ' id="' .. RE.gsub(text, '{[ ]}', '_') .. '">' .. text .. '</h' .. level .. '>' 715 return '<h' .. level .. ' id="' .. RE.gsub(text, '{[ ]}', '_') .. '">' .. text .. ' <a style="font-size: 0.42em;" href="#top">👆</a></h' .. level .. '>'
716end 716end
717local OgWriterLink = Writer.link -- So we can call the original from within mine, we are just changing the URL. 717local OgWriterLink = Writer.link -- So we can call the original from within mine, we are just changing the URL.
718function Writer.link(lab, url, tit) 718function Writer.link(lab, url, tit)
@@ -780,14 +780,14 @@ for name, file in pairs(Files) do
780 if bit == f then 780 if bit == f then
781 metadata.menu = metadata.menu .. '<p>' .. title .. '</p>' 781 metadata.menu = metadata.menu .. '<p>' .. title .. '</p>'
782 for j, g in ipairs(file.headers) do 782 for j, g in ipairs(file.headers) do
783 local beg, en = RE.find(g, [['{']])
784 if nil ~= beg then
785 g = string.sub(g, 1, beg - 2)
786 end
783 local h = string.sub(RE.gsub(g, '{[#]}', ''), 2) 787 local h = string.sub(RE.gsub(g, '{[#]}', ''), 2)
784 local l = string.len(g) - string.len(h) 788 local l = string.len(g) - string.len(h)
785 g = h 789 g = h
786 h = RE.gsub(h, '{[ ]}', '&nbsp;') 790 h = RE.gsub(h, '{[ ]}', '&nbsp;')
787 local beg, en = RE.find(h, [['{']])
788 if nil ~= beg then
789 g = string.sub(h, 1, beg - 7)
790 end
791-- FIXME - if it's a linky, strip off the URL part. The Wiki audit has such things. 791-- FIXME - if it's a linky, strip off the URL part. The Wiki audit has such things.
792 metadata.menu = metadata.menu .. '<p>' .. string.rep('&nbsp;', l) .. '<a style="font-size: 0.80em;" href="#' .. RE.gsub(g, '{[ ]}', '_') .. '">' .. h .. '</a></p>' 792 metadata.menu = metadata.menu .. '<p>' .. string.rep('&nbsp;', l) .. '<a style="font-size: 0.80em;" href="#' .. RE.gsub(g, '{[ ]}', '_') .. '">' .. h .. '</a></p>'
793 end 793 end