aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README6
-rwxr-xr-xSuckIt2
-rwxr-xr-xSuckItClean13
-rw-r--r--TODO.md64
-rw-r--r--about/index.md2
-rw-r--r--default.template4
-rwxr-xr-xfeed-icon-14x14.pngbin0 -> 689 bytes
-rwxr-xr-xfeed-icon-28x28.pngbin0 -> 1737 bytes
-rw-r--r--help.md43
-rwxr-xr-xnotYetAnotherWiki.lua108
10 files changed, 191 insertions, 51 deletions
diff --git a/README b/README
index d1aa22c..954bc7a 100644
--- a/README
+++ b/README
@@ -59,13 +59,13 @@ the one system. They can chat about it, on the one system.
59 59
60## What does it do already? 60## What does it do already?
61 61
62Currently it'll scan the current directory and subdirectories looking for 62Currently it'll scan the current folder and sub folders looking for
63.md files in CommonMark syntax. This should cover some MarkDown 63.md files in CommonMark syntax. This should cover some MarkDown
64variations. Then it produces .HTML files converted from these .md files, 64variations. Then it produces .HTML files converted from these .md files,
65and links them all together into a web site. 65and links them all together into a web site.
66 66
67Any .md file that is just the beginning metadata block doesn't get 67Any .md file that is just the beginning metadata block doesn't get
68rendered into HTML, but is global metadata for this directory and subs, 68rendered into HTML, but is global metadata for this folder and subs,
69though the subs can override this with their own metadata.md files. 69though the subs can override this with their own metadata.md files.
70 70
71git is used to store the .md files, and provides edit history. Added on 71git is used to store the .md files, and provides edit history. Added on
@@ -73,7 +73,7 @@ the footer is links to cgit, which is used to store the files in git on
73your server. This provides acces to the source code, history, and ATOM 73your server. This provides acces to the source code, history, and ATOM
74feed for the site. 74feed for the site.
75 75
76It can also scan an external directory and merge that with the current 76It can also scan an external folder and merge that with the current
77one, but this isn't tested yet. 77one, but this isn't tested yet.
78 78
79## other stuff 79## other stuff
diff --git a/SuckIt b/SuckIt
index 26991b5..38fe18e 100755
--- a/SuckIt
+++ b/SuckIt
@@ -155,6 +155,8 @@ done
155 155
156 156
157time notYetAnotherWiki.lua 157time notYetAnotherWiki.lua
158# No idea why yet, but needs a second run to sort out everything. Shouldn't take long anyway.
159time notYetAnotherWiki.lua
158 160
159popd 161popd
160} 162}
diff --git a/SuckItClean b/SuckItClean
new file mode 100755
index 0000000..1b8a025
--- /dev/null
+++ b/SuckItClean
@@ -0,0 +1,13 @@
1#!/bin/bash
2
3TIMEFORMAT=" took %lR using %P%% CPU"
4time {
5pushd /opt/nyaw
6
7rm -fr Foswiki/*
8rm -fr PmWiki/*
9rm -fr unsorted
10rm -fr users/*
11popd
12./SuckIt
13}
diff --git a/TODO.md b/TODO.md
index bd02788..3453ba0 100644
--- a/TODO.md
+++ b/TODO.md
@@ -4,32 +4,51 @@ Make it perphekd!
4 4
5## Do these 5## Do these
6 6
7Convert it to polygLua.
8
9It's all a bit too fragile, fix what I can. Too many messes colliding.
10
11Flock it.
12
13Some sort of search system.
14
15A member system, and edit / manage system for their pages.
7 16
8Fix up linky conversion. DONE, mostly. 17Fix up linky conversion. DONE, mostly.
9 18
10- This is the "page moved" problem, but now it's "page copied" and "page linked", a generic solution might work.
11- Rethink this, I might be going the wrong way.
12- Need to deal with real file name versus title. Also symlink name not matching what it points to. 19- Need to deal with real file name versus title. Also symlink name not matching what it points to.
13- . Hmmm, might it be good policy to have a single canonical context for each page? The "real URL" .md.md thing?
14- . Loop through the manually placed symlinks, adjusting "real URL" as we go.
15- + What to do about mulitple symlinks pointing to the same page? Compare timestamps, most recent wins.
16 20
17Add atom feed for single page. Alas cgit only seems to have ATOM feed on the whole repo, not individual files. 21Use the default.template that comes with nYAW if none is availaable.
22
23"collapsing headings" I guess that means click on a heading to hide / show the content under that heading.
24
25- 🙈
26- Should do that for the main content and the menu TOC.
27- Also allow editing just a section, a section being the bits between one heading and the next.
28- + 📝 ✒️✏️🖊️🖋 🖌️🖍️
29- + When someone starts editing, create pagename_draft.md and .HTML, and update those when they want to see a preview.
30- + Or pagename-heading_draft.md
31- + Use that draft.md file as a lock on editing that file / section.
32- + Have the hourly cron job remove any stale ones.
33
34Add ATOM feed for single page. Alas cgit only seems to have ATOM feed on the whole repo, not individual files.
18 35
19- However, once timestamps are sorted, I can use that code to generate (static?) RSS and ATOM feeds, and create page histories using diffs. 36- However, once timestamps are sorted, I can use that code to generate RSS and ATOM feeds, and create page histories using diffs.
20- Instead of an hourly cron job to update everything, see if I can hook 37- Instead of an hourly cron job to update everything, see if I can hook
21into Fos and Pm edit form's save function. So when they save in the 38into Fos and Pm edit form's save function. So when they save in the
22original wiki, the nyaw version gets updated, diffed, and RSSed. 39original wiki, the nyaw version gets updated, diffed, and ATOMed / RSSed.
40- + Actually a BFI method might do the trick, stick with doing a full scan
41and only updating the stuff that needs it, likely that's only the page that just got saved.
42- git commit can have an arbitrary author / committer, so I can use that to make sure the person that actually made the change gets author / committer.
43- + There's also the email thing, but I don't want to spread email addresses around, not even sure we have them anyway.
23- Should also see if gitea can handle that, and if they want wiki content saved to git. 44- Should also see if gitea can handle that, and if they want wiki content saved to git.
24 45
25It's all a bit too fragile, fix what I can. Too many messes colliding. 46Syntax highlighting in code blocks. The highlight package looks promising, already had it installed on my desktop.
26 47
27## Some ideas 48## Some ideas
28 49
29Mostly from something chomwitt deleted. 50Mostly from something chomwitt wrote -
30 51
31- "collapsing headings" I guess that means click on a heading to hide / show the content under that heading.
32- + Should do that for the main content and the menu TOC.
33- "validation", not sure exactly what that would validate. 52- "validation", not sure exactly what that would validate.
34- I'll just quote some of the rest - 53- I'll just quote some of the rest -
35 54
@@ -40,9 +59,8 @@ Mostly from something chomwitt deleted.
40 ** for example search-completion to other workflows names-tags. 59 ** for example search-completion to other workflows names-tags.
41~~~ 60~~~
42 61
43- Syntax highlighting in code blocks. 62- Allow default.template files in sub folders.
44- Might be useful to automatically convert anything looking like a URL into a linky. 63- Might be useful to automatically convert anything looking like a URL into a linky.
45- Allow default.template files in sub directories.
46 64
47Automate symlinks. 65Automate symlinks.
48 66
@@ -51,16 +69,28 @@ Automate symlinks.
51 69
52## Try out 70## Try out
53 71
72lua-lpeg-patterns might be useful
73
74lua-luxio might be the wheel I'm reinventing?
75
76lua-wsapi-fcgi
77
54https://inclusive-components.design/tooltips-toggletips/ has some ideas about the "tooltip" HTML attribute, and what to do about it. A rabbit hole that ends in javascript, but might be useful up to that point. 78https://inclusive-components.design/tooltips-toggletips/ has some ideas about the "tooltip" HTML attribute, and what to do about it. A rabbit hole that ends in javascript, but might be useful up to that point.
55 79
56htmx 80htmx
57 81
58cgit has Lua 82cgit has Lua
59 83
84lua-gall for git stuff
85
86lua-lace for access control
87
88lua-unbound
89
60 90
61## User system 91## Member system
62 92
63Reuse the user system from SledjChisl. 93Reuse the member system from SledjChisl.
64 94
65levels - 95levels -
66 96
@@ -102,6 +132,6 @@ site, including configuration and modules. Likely this is the person
102that set the system up in the first place. 132that set the system up in the first place.
103 133
104Admin should have access to everything that shell level has, but there's always things need tweaking at some lower level. 134Admin should have access to everything that shell level has, but there's always things need tweaking at some lower level.
105Built in file browser might do the trick. Would be useful for content creators to to organise the content. Naturally should obey the permissions. 135Built in file browser might do the trick. Would be useful for content creators to organise the content. Naturally should obey the permissions.
106 136
107root level is whoever controls the server things are running on. They can do anything at all. 137root level is whoever controls the server things are running on. They can do anything at all.
diff --git a/about/index.md b/about/index.md
index 6086d85..3f15be7 100644
--- a/about/index.md
+++ b/about/index.md
@@ -1,5 +1,5 @@
1# notYetAnotherWiki is not another wiki, at least not yet. It'll be much more than that, eventually. 1# notYetAnotherWiki is not another wiki, at least not yet. It'll be much more than that, eventually.
2 2
3This is a new directory, an entire PR department can hang out here. 3This is a new folder, an entire PR department can hang out here.
4 4
5This would just be a duplicate of README, but for testing purposes. 5This would just be a duplicate of README, but for testing purposes.
diff --git a/default.template b/default.template
index 75922ac..baefad1 100644
--- a/default.template
+++ b/default.template
@@ -87,14 +87,14 @@
87 <a href="$home$"><img src="$logo$" alt="not (Yet) (Another / A) Wiki."/></a> 87 <a href="$home$"><img src="$logo$" alt="not (Yet) (Another / A) Wiki."/></a>
88 </nav></header></div> 88 </nav></header></div>
89 <div class="boxTools"><header><nav> 89 <div class="boxTools"><header><nav>
90 &nbsp; <b class="toolTip" title="🍔 hides / shows non content, reverse hamburger menu. 90 &nbsp; <a href="/help.HTML"><b class="toolTip" title="🍔 hides / shows non content, reverse hamburger menu.
91🕶 switches between dark and light themes. 91🕶 switches between dark and light themes.
92📚 shows the list of all pages. 92📚 shows the list of all pages.
93🔮 a folder of unsorted pages. 93🔮 a folder of unsorted pages.
94👥 shows the list of users. 94👥 shows the list of users.
95🪵 will be for logging in, when I have written that bit. 95🪵 will be for logging in, when I have written that bit.
96🔍 will be the search, when I have written that bit. 96🔍 will be the search, when I have written that bit.
97👣 is a trail of the steps to get here.">❓</b> 97👣 is a trail of the steps to get here.">❓</b></a>
98 &nbsp; <b class="toolTip"><label for="modeToggleMenu" class='modeBtn'>&#127828;</label></b> 98 &nbsp; <b class="toolTip"><label for="modeToggleMenu" class='modeBtn'>&#127828;</label></b>
99 &nbsp; <b class="toolTip"><label for="modeToggleBody" class='modeBtn'>&#x1F576;</label></b> 99 &nbsp; <b class="toolTip"><label for="modeToggleBody" class='modeBtn'>&#x1F576;</label></b>
100 &nbsp; <a href="/everything.HTML"><b class="toolTip">&#128218;</b></a> 100 &nbsp; <a href="/everything.HTML"><b class="toolTip">&#128218;</b></a>
diff --git a/feed-icon-14x14.png b/feed-icon-14x14.png
new file mode 100755
index 0000000..b3c949d
--- /dev/null
+++ b/feed-icon-14x14.png
Binary files differ
diff --git a/feed-icon-28x28.png b/feed-icon-28x28.png
new file mode 100755
index 0000000..d64c669
--- /dev/null
+++ b/feed-icon-28x28.png
Binary files differ
diff --git a/help.md b/help.md
new file mode 100644
index 0000000..bc4cc46
--- /dev/null
+++ b/help.md
@@ -0,0 +1,43 @@
1# How to use this wiki
2
3On the top left, is the logo, beside that is a toolbar of icons -
4
5- ❓ hover over this for help.
6- 🍔 hides or shows everything but the content and these icons, the reverse hamburger menu.
7- 🕶 switches between dark and light themes.
8- 📚 shows the list of all pages.
9- 🔮 a folder of unsorted pages.
10- 👥 shows the list of users.
11- 🪵 will be for logging in, when I have written that bit.
12- 🔍 will be the search, when I have written that bit.
13
14&#x1f463; is a trail of breadcrumbs, though I'm using a footsteps icon
15for this. Showing the footsteps you have followed to get to the current
16folder.
17
18On the top right of the pages is links to the sub folders of the current
19folder the current page is in.
20
21Down the left side is links to the pages in the current folder. Most of
22them will be symlinks to the converted pages from the Foswiki and PmWiki
23sub folders. Some will be links &#9757; to external sites. For the
24current page, links to the headings are also shown, those headings have
25their own icon 🔼to go back to the top.
26
27The bit you are reading is the badly converted content of the current
28page. At the bottom of each converted page is a link to the original,
29and if you are logged into that other system, you might be able to edit
30the page. Note that unconverted pages don't have these links to the
31originals.
32
33At the bottom is links to things like page history, web site source code,
34and the software I'm writing to do all of this. Or should be some day.
35
36
37
38# Under the hood
39
40Internally this wiki is made of the root folder and it's sub folders
41representing the structure of the wiki content. Each folder has it's own
42pages. Symlinks are used to copy or move pages around, with special
43folders for the original stuff from the other wikis.
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua
index c5814f3..f53691b 100755
--- a/notYetAnotherWiki.lua
+++ b/notYetAnotherWiki.lua
@@ -215,27 +215,51 @@ else
215 print("Can't open everything.md for writing.") 215 print("Can't open everything.md for writing.")
216end 216end
217 217
218-- Scan the subdirectories looking for our files. 218-- Scan the sub folders looking for our files.
219local Directory = arg[1] 219local Folder = arg[1]
220toSub('') 220toSub('')
221if nil == Directory then Directory = '.' end 221if nil == Folder then Folder = '.' end
222 222--GlobalMetaData.root = Folder
223-- Sort out realURL for symlinked .md.md files. 223
224for l in io.popen('find -L ' .. Directory .. ' -name unsorted -prune -o -name "*.md.md" -xtype l -printf "%P\n"'):lines() do 224--[[ Sort out realURL for symlinked .md.md files.
225 realURL is the generic URL part for this page. By policy it points to whatever is the latest copy / symlink of the original download .md.md.
226 realURL starts out being the path to the downloaded file and friends.
227 If we make a symlink during SuckIt, then that gets updated to point to the place the symlink is in.
228 below we compare timestamps and select the latest version if there's more than one symlink.
229 For the "page symlinked" problem, this should work if realURL is kept updated.
230 For the "page copied" problem, this should work if realURL is kept updated, same as symlinked really, coz that's just another copy.
231 For the "page moved" problem, that'll be the most recent symlink, the old one still has it's symlink pointing to the download .md.md, which gets updated with the current realURL.
232 So when some external old URL points to someplace a page used to be, it's old symlink points to the up to date download .md.md, and we know where to go to find the page now.
233 A left over .md.md file should have a redirect .HTML page created for it.
234]]
235for l in io.popen('find -L ' .. Folder .. ' -name unsorted -prune -o -name "*.md.md" -xtype l -printf "%P\n"'):lines() do
225 local metadata = readMdMd(string.sub(l, 1, -4), {}) 236 local metadata = readMdMd(string.sub(l, 1, -4), {})
226-- FIXME - if this already exists, compare the timestamps, most recent wins. 237 if nil == metadata.realURL then
227 metadata.realURL = string.sub(l, 1, -7) 238 metadata.realURL = string.sub(l, 1, -7)
228 local a, e = io.open(l, 'w') 239 else
229 if nil == a then print('Could not open ' .. l .. ' - ' .. e) else 240 if metadata.realURL ~= string.sub(l, 1, -7) then
230 for k, v in pairs(metadata) do 241 metadata.realURL = string.sub(l, 1, -7)
231 a:write(k .. '=' .. v .. '\n') 242 -- If this already exists, compare the timestamps, most recent wins.
243 local time0 = io.popen('ls -l --time-style=+%s "' .. metadata.realURL .. '.md.md" | cut -d \' \' -f 6'):read('l')
244 local time1 = io.popen('ls -l --time-style=+%s "' .. l .. '" | cut -d \' \' -f 6'):read('l')
245 if time0 > time1 then metadata = nil end
246 else metadata = nil end
247 end
248
249 if nil ~= metadata then
250-- DUNNO if this writes to the original file, or overwrites the symlink.
251 local a, e = io.open(l, 'w')
252 if nil == a then print('Could not open ' .. l .. ' - ' .. e) else
253 for k, v in pairs(metadata) do
254 a:write(k .. '=' .. v .. '\n')
255 end
256 a:close()
232 end 257 end
233 a:close()
234 end 258 end
235end 259end
236 260
237-- Clean up unsorted. 261-- Clean up unsorted.
238for l in io.popen('find -L ' .. Directory .. ' -name unsorted -prune -o -name "*.md" -a -not -name "*.md.md" -xtype l -printf "%P\n"'):lines() do 262for l in io.popen('find -L ' .. Folder .. ' -name unsorted -prune -o -name "*.md" -a -not -name "*.md.md" -xtype l -printf "%P\n"'):lines() do
239 local tp = '_fos' 263 local tp = '_fos'
240 local metadata = readMdMd(l, {}) 264 local metadata = readMdMd(l, {})
241 if nil ~= metadata then 265 if nil ~= metadata then
@@ -245,16 +269,36 @@ for l in io.popen('find -L ' .. Directory .. ' -name unsorted -prune -o -name "*
245 local a, e = io.open(unsort .. tp .. '.md' , 'r') 269 local a, e = io.open(unsort .. tp .. '.md' , 'r')
246 if nil ~= a then 270 if nil ~= a then
247 a:close() 271 a:close()
248 os.execute('rm ' .. unsort .. tp .. '.*') 272 -- Keep the .md.md symlink, delete the rest.
273 os.execute('rm ' .. unsort .. tp .. '.HTML')
274 os.execute('rm ' .. unsort .. tp .. '.md')
275 a, e = io.open(unsort .. tp .. '.HTML', 'w')
276 if nil == a then print('Could not open ' .. unsort .. tp .. '.HTML' .. ' - ' .. e) else
277 local dst = string.sub(l, 1, -4) .. '.HTML'
278 local cnt = 1
279 for j = 1, #metadata.ogFile do
280 if '/' == string.sub(metadata.ogFile, j, j) then cnt = cnt + 1 end
281 end
282 dst = string.rep('../', cnt) .. dst
283 a:write(
284[=[<!DOCTYPE html>
285<html>
286 <head><meta http-equiv="refresh" content="0; url=]=] .. dst .. '"' .. [=[/></head>
287 <body><p>Click this if you don't get redirected to the real page - <a href="]=] .. dst .. '"' .. [=[>Redirect</a></p></body>
288</html>
289]=])
290 a:close()
291 print('REDIRECT ' .. unsort .. tp .. '.HTML \t-> ' .. dst)
292 end
293
249 end 294 end
250 end 295 end
251 end 296 end
252end 297end
253 298
254-- Look for copied pages from the other wikis. 299-- Look for copied pages from the other wikis.
255for l in io.popen('find -L ' .. Directory .. ' -name "*.HTM" -type f,l -printf "%P\n"'):lines() do 300for l in io.popen('find -L ' .. Folder .. ' -name "*.HTM" -type f,l -printf "%P\n"'):lines() do
256-- TODO - Only do this if .HTM is newer than .md, or .md doesn't exist. 301-- Only do this if .HTM is newer than .md, or .md doesn't exist.
257
258 local htime = io.popen("date -ur " .. l .. " +%s"):read('l') 302 local htime = io.popen("date -ur " .. l .. " +%s"):read('l')
259 local mtime = io.popen("date -ur " .. string.sub(l, 1, -4) .. "md +%s 2>/dev/null"):read('l') 303 local mtime = io.popen("date -ur " .. string.sub(l, 1, -4) .. "md +%s 2>/dev/null"):read('l')
260 if (nil == mtime) or (htime > mtime) then 304 if (nil == mtime) or (htime > mtime) then
@@ -404,14 +448,14 @@ writeString(l .. '_ORIGINAL1', body)
404 end 448 end
405end 449end
406 450
407if '.' ~= Directory then 451if '.' ~= Folder then
408 for l in io.popen('find -L . -name "*.md" -type f,l -printf "%P\n"'):lines() do 452 for l in io.popen('find -L . -name "*.md" -type f,l -printf "%P\n"'):lines() do
409 toFile(string.gsub(l, '%.md$', '')) 453 toFile(string.gsub(l, '%.md$', ''))
410 end 454 end
411end 455end
412 456
413-- Can add in a distant directory to, for putting it's results in the current directory. 457-- Can add in a distant folder to, for putting it's results in the current folder.
414for l in io.popen('find -L ' .. Directory .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do 458for l in io.popen('find -L ' .. Folder .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do
415 local n = string.gsub(l, '%.md$', '') 459 local n = string.gsub(l, '%.md$', '')
416 if nil == Files[n] then toFile(n) end 460 if nil == Files[n] then toFile(n) end
417end 461end
@@ -472,7 +516,7 @@ for name, sub in pairs(Subs) do
472 print("EMPTY " .. name) 516 print("EMPTY " .. name)
473 h = io.open(name .. '/index.md', 'w') 517 h = io.open(name .. '/index.md', 'w')
474 if nil ~= h then 518 if nil ~= h then
475 h:write('This directory has no files.') 519 h:write('This folder has no files.')
476 h:close() 520 h:close()
477 else 521 else
478 print("Can't open " .. name .. '/index.md for writing.') 522 print("Can't open " .. name .. '/index.md for writing.')
@@ -484,7 +528,7 @@ end
484--------------------------------------------------------------------------------- 528---------------------------------------------------------------------------------
485-- These functions assume the above file and sub scan has completed. 529-- These functions assume the above file and sub scan has completed.
486 530
487-- Which page in this directory should we show? 531-- Which page in this folder should we show?
488-- NOTE - only looking for the .md files we scanned for before, any stray HTML, html, HTM, and htm files will get ignored. 532-- NOTE - only looking for the .md files we scanned for before, any stray HTML, html, HTM, and htm files will get ignored.
489local whichPage = function(f) 533local whichPage = function(f)
490 local fl = '' 534 local fl = ''
@@ -527,7 +571,7 @@ local whichWiki = function(metadata)
527end 571end
528 572
529 573
530-- Calculate a link from the source directory to the destination directory. 574-- Calculate a link from the source folder to the destination folder.
531local linkFrom = function(source, dest) 575local linkFrom = function(source, dest)
532 -- Evil hacks! 576 -- Evil hacks!
533 if 'Profiles' == dest then dest = 'PmWiki/Profiles' end 577 if 'Profiles' == dest then dest = 'PmWiki/Profiles' end
@@ -763,7 +807,7 @@ function Writer.header(s, level)
763 local text = Lunamark.util.rope_to_string(s) 807 local text = Lunamark.util.rope_to_string(s)
764-- FIXME - Work around a bug in Lunamark? 808-- FIXME - Work around a bug in Lunamark?
765 text = RE.gsub(text, "{[\\]}", "") 809 text = RE.gsub(text, "{[\\]}", "")
766 return '<h' .. level .. ' id="' .. RE.gsub(text, '{[ ]}', '_') .. '">' .. text .. ' <a style="font-size: 0.42em;" href="#top">👆</a></h' .. level .. '>' 810 return '<h' .. level .. ' id="' .. RE.gsub(text, '{[ ]}', '_') .. '">' .. text .. ' <a style="font-size: 0.42em;" href="#top">🔼</a></h' .. level .. '>'
767end 811end
768local OgWriterLink = Writer.link -- So we can call the original from within mine, we are just changing the URL. 812local OgWriterLink = Writer.link -- So we can call the original from within mine, we are just changing the URL.
769function Writer.link(lab, url, tit) 813function Writer.link(lab, url, tit)
@@ -810,7 +854,7 @@ for name, file in pairs(Files) do
810 local pth = file.path 854 local pth = file.path
811 if '' ~= file.path then pth = file.path .. '/' end 855 if '' ~= file.path then pth = file.path .. '/' end
812 if 'true' ~= Subs[pth .. f].metadata.hidden then 856 if 'true' ~= Subs[pth .. f].metadata.hidden then
813 metadata.header = metadata.header .. '<a href="' .. f .. '/' .. whichPage(pth .. f) .. '">' .. f .. '</a> &nbsp; ' 857 metadata.header = metadata.header .. '<a href="' .. f .. '/' .. whichPage(pth .. f) .. '">' .. f .. '</a> &nbsp; &#128194; '
814 end 858 end
815 end 859 end
816 860
@@ -847,7 +891,15 @@ for name, file in pairs(Files) do
847 end 891 end
848 else 892 else
849 if nil ~= url then metadata.menu = metadata.menu .. '<p><a href="' .. url .. '">' .. title .. ' &#9757;</a></p>' 893 if nil ~= url then metadata.menu = metadata.menu .. '<p><a href="' .. url .. '">' .. title .. ' &#9757;</a></p>'
850 else metadata.menu = metadata.menu .. '<p><a href="' .. f .. '.HTML">' .. title .. '</a></p>' 894 else
895 local pth = file.path
896 if '' ~= pth then pth = pth .. '/' end
897 -- Don't include any left over .md.md files, so don't do this if f.md doesn't exist.
898 local a, e = io.open(pth .. f .. '.md' , 'r')
899 if nil ~= a then
900 a:close()
901 metadata.menu = metadata.menu .. '<p><a href="' .. f .. '.HTML">' .. title .. '</a></p>'
902 end
851 end 903 end
852 end 904 end
853 end 905 end
@@ -865,7 +917,7 @@ for name, file in pairs(Files) do
865 metadata.history = '' 917 metadata.history = ''
866 end 918 end
867 if nil ~= metadata.sourcecode then metadata.footer = '<a href="' .. metadata.sourcecode .. '">source code</a>' end 919 if nil ~= metadata.sourcecode then metadata.footer = '<a href="' .. metadata.sourcecode .. '">source code</a>' end
868 if nil ~= metadata.feedatom then metadata.footer = '<a href="' .. metadata.feedatom .. '">atom feed</a> &nbsp; &nbsp; ' .. metadata.footer end 920 if nil ~= metadata.feedatom then metadata.footer = '<a href="' .. metadata.feedatom .. '">atom feed<img src="feed-icon-14x14.png"></img></a> &nbsp; &nbsp; ' .. metadata.footer end
869 if metadata.footer ~= '' then metadata.footer = 'Web site ' .. metadata.footer end 921 if metadata.footer ~= '' then metadata.footer = 'Web site ' .. metadata.footer end
870 -- Add a link to the original page. 922 -- Add a link to the original page.
871 if nil ~= metadata.ogURL then 923 if nil ~= metadata.ogURL then