aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordvs12025-03-27 09:47:22 +1000
committerdvs12025-03-27 09:47:22 +1000
commitf100e861884cb261bf0598215d3e7d8aba1f3f89 (patch)
tree218ebc3aadc8eaef91ca88860131e0fa9c24acdc
parentAdd the help page, link it to the help widget. (diff)
downloadnotYetAnotherWiki-f100e861884cb261bf0598215d3e7d8aba1f3f89.zip
notYetAnotherWiki-f100e861884cb261bf0598215d3e7d8aba1f3f89.tar.gz
notYetAnotherWiki-f100e861884cb261bf0598215d3e7d8aba1f3f89.tar.bz2
notYetAnotherWiki-f100e861884cb261bf0598215d3e7d8aba1f3f89.tar.xz
directory -> folder
Let's be consistent, now we are using a folder icon.
-rw-r--r--README6
-rw-r--r--TODO.md2
-rw-r--r--about/index.md2
-rwxr-xr-xnotYetAnotherWiki.lua25
4 files changed, 18 insertions, 17 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/TODO.md b/TODO.md
index d6f6039..044ed82 100644
--- a/TODO.md
+++ b/TODO.md
@@ -37,7 +37,7 @@ Mostly from something chomwitt deleted.
37~~~ 37~~~
38 38
39- Syntax highlighting in code blocks. 39- Syntax highlighting in code blocks.
40- Allow default.template files in sub directories. 40- Allow default.template files in sub folders.
41- Might be useful to automatically convert anything looking like a URL into a linky. 41- Might be useful to automatically convert anything looking like a URL into a linky.
42 42
43Automate symlinks. 43Automate symlinks.
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/notYetAnotherWiki.lua b/notYetAnotherWiki.lua
index f12547a..0883d87 100755
--- a/notYetAnotherWiki.lua
+++ b/notYetAnotherWiki.lua
@@ -215,10 +215,11 @@ 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--GlobalMetaData.root = Folder
222 223
223--[[ Sort out realURL for symlinked .md.md files. 224--[[ Sort out realURL for symlinked .md.md files.
224 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. 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.
@@ -230,7 +231,7 @@ if nil == Directory then Directory = '.' end
230 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. 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.
231 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. 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.
232]] 233]]
233for l in io.popen('find -L ' .. Directory .. ' -name unsorted -prune -o -name "*.md.md" -xtype l -printf "%P\n"'):lines() do 234for l in io.popen('find -L ' .. Folder .. ' -name unsorted -prune -o -name "*.md.md" -xtype l -printf "%P\n"'):lines() do
234 local metadata = readMdMd(string.sub(l, 1, -4), {}) 235 local metadata = readMdMd(string.sub(l, 1, -4), {})
235 if nil == metadata.realURL then 236 if nil == metadata.realURL then
236 metadata.realURL = string.sub(l, 1, -7) 237 metadata.realURL = string.sub(l, 1, -7)
@@ -256,7 +257,7 @@ for l in io.popen('find -L ' .. Directory .. ' -name unsorted -prune -o -name "*
256end 257end
257 258
258-- Clean up unsorted. 259-- Clean up unsorted.
259for 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 260for 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
260 local tp = '_fos' 261 local tp = '_fos'
261 local metadata = readMdMd(l, {}) 262 local metadata = readMdMd(l, {})
262 if nil ~= metadata then 263 if nil ~= metadata then
@@ -273,7 +274,7 @@ for l in io.popen('find -L ' .. Directory .. ' -name unsorted -prune -o -name "*
273end 274end
274 275
275-- Look for copied pages from the other wikis. 276-- Look for copied pages from the other wikis.
276for l in io.popen('find -L ' .. Directory .. ' -name "*.HTM" -type f,l -printf "%P\n"'):lines() do 277for l in io.popen('find -L ' .. Folder .. ' -name "*.HTM" -type f,l -printf "%P\n"'):lines() do
277-- Only do this if .HTM is newer than .md, or .md doesn't exist. 278-- Only do this if .HTM is newer than .md, or .md doesn't exist.
278 local htime = io.popen("date -ur " .. l .. " +%s"):read('l') 279 local htime = io.popen("date -ur " .. l .. " +%s"):read('l')
279 local mtime = io.popen("date -ur " .. string.sub(l, 1, -4) .. "md +%s 2>/dev/null"):read('l') 280 local mtime = io.popen("date -ur " .. string.sub(l, 1, -4) .. "md +%s 2>/dev/null"):read('l')
@@ -424,14 +425,14 @@ writeString(l .. '_ORIGINAL1', body)
424 end 425 end
425end 426end
426 427
427if '.' ~= Directory then 428if '.' ~= Folder then
428 for l in io.popen('find -L . -name "*.md" -type f,l -printf "%P\n"'):lines() do 429 for l in io.popen('find -L . -name "*.md" -type f,l -printf "%P\n"'):lines() do
429 toFile(string.gsub(l, '%.md$', '')) 430 toFile(string.gsub(l, '%.md$', ''))
430 end 431 end
431end 432end
432 433
433-- Can add in a distant directory to, for putting it's results in the current directory. 434-- Can add in a distant folder to, for putting it's results in the current folder.
434for l in io.popen('find -L ' .. Directory .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do 435for l in io.popen('find -L ' .. Folder .. ' -name "*.md" -type f,l -printf "%P\n"'):lines() do
435 local n = string.gsub(l, '%.md$', '') 436 local n = string.gsub(l, '%.md$', '')
436 if nil == Files[n] then toFile(n) end 437 if nil == Files[n] then toFile(n) end
437end 438end
@@ -492,7 +493,7 @@ for name, sub in pairs(Subs) do
492 print("EMPTY " .. name) 493 print("EMPTY " .. name)
493 h = io.open(name .. '/index.md', 'w') 494 h = io.open(name .. '/index.md', 'w')
494 if nil ~= h then 495 if nil ~= h then
495 h:write('This directory has no files.') 496 h:write('This folder has no files.')
496 h:close() 497 h:close()
497 else 498 else
498 print("Can't open " .. name .. '/index.md for writing.') 499 print("Can't open " .. name .. '/index.md for writing.')
@@ -504,7 +505,7 @@ end
504--------------------------------------------------------------------------------- 505---------------------------------------------------------------------------------
505-- These functions assume the above file and sub scan has completed. 506-- These functions assume the above file and sub scan has completed.
506 507
507-- Which page in this directory should we show? 508-- Which page in this folder should we show?
508-- NOTE - only looking for the .md files we scanned for before, any stray HTML, html, HTM, and htm files will get ignored. 509-- NOTE - only looking for the .md files we scanned for before, any stray HTML, html, HTM, and htm files will get ignored.
509local whichPage = function(f) 510local whichPage = function(f)
510 local fl = '' 511 local fl = ''
@@ -547,7 +548,7 @@ local whichWiki = function(metadata)
547end 548end
548 549
549 550
550-- Calculate a link from the source directory to the destination directory. 551-- Calculate a link from the source folder to the destination folder.
551local linkFrom = function(source, dest) 552local linkFrom = function(source, dest)
552 -- Evil hacks! 553 -- Evil hacks!
553 if 'Profiles' == dest then dest = 'PmWiki/Profiles' end 554 if 'Profiles' == dest then dest = 'PmWiki/Profiles' end