aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2026-02-05 12:36:21 +1000
committeronefang2026-02-05 12:36:21 +1000
commit36303cfa576daa8498179c24d2789be5bdc4f954 (patch)
tree617eecd17e8590ddaf7c45d87e81304626593049
parentStart using polygLua. (diff)
downloadnotYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.zip
notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.tar.gz
notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.tar.bz2
notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.tar.xz
More DocuWiki stuff.
-rwxr-xr-xSuckIt18
-rwxr-xr-xSuckItClean2
-rwxr-xr-xnotYetAnotherWiki.lua6
3 files changed, 21 insertions, 5 deletions
diff --git a/SuckIt b/SuckIt
index d56bdc4..48a01dc 100755
--- a/SuckIt
+++ b/SuckIt
@@ -4,6 +4,11 @@ TIMEFORMAT=" took %lR using %P%% CPU"
4time { 4time {
5pushd /opt/nyaw 5pushd /opt/nyaw
6 6
7#rm -fr DocuWiki/*
8mkdir -p DocuWiki
9cp -r /opt/DocuWiki/data/pages/* ./DocuWiki
10cp -r /opt/DocuWiki/data/media/* ./DocuWiki
11cp -r /opt/nyaw_EMPTY/DocuWiki .
7#rm -fr Foswiki/* 12#rm -fr Foswiki/*
8cp -r /opt/nyaw_EMPTY/Foswiki . 13cp -r /opt/nyaw_EMPTY/Foswiki .
9#rm -fr PmWiki/* 14#rm -fr PmWiki/*
@@ -15,13 +20,24 @@ cp -r /opt/nyaw_EMPTY/unsorted .
15mkdir -p users 20mkdir -p users
16cp -r /opt/nyaw_EMPTY/users . 21cp -r /opt/nyaw_EMPTY/users .
17 22
23ogURL=""
18ogWiki="DocuWiki" 24ogWiki="DocuWiki"
19time find DocuWiki \ 25time find DocuWiki \
20-name "*.txt" -type f,l -printf "%P\n" | while read line 26-name "*.txt" -type f,l -printf "%P\n" | while read line
21do 27do
22 base=`echo "${line}" | cut -d '/' -f 1- | rev | cut -d '/' -f 2- | rev` 28 base=`echo "${line}" | cut -d '/' -f 1- | rev | cut -d '/' -f 2- | rev`
23 file=`echo "${line}" | rev | cut -d '/' -f 1 | cut -b 5- | rev` 29 file=`echo "${line}" | rev | cut -d '/' -f 1 | cut -b 5- | rev`
24 pandoc -f dokuwiki -t commonmark_x --self-contained ${ogWiki}/${line} >${ogWiki}/${base}/${file}.md 30 if [ `echo "${base}" | rev | cut -d '.' -f 1` == "txt" ]; then
31 base=""
32 else
33 base="${base}/"
34 fi
35 realURL=${ogWiki}/${base}${file}
36 time=`date --rfc-3339=seconds -ur /opt/DocuWiki/data/pages/${line} | cut -d '+' -f 1`
37 mkdir -p ${ogWiki}/${base}
38 echo -e "ogWiki=${ogWiki}\nogURL=${ogURL}\nrealURL=${realURL}\nogBase=${base}\nogFile=${file}\ntimestamp=${time}\n" > ${ogWiki}/${base}/${file}.md.md
39
40 pandoc -f dokuwiki -t commonmark_x --self-contained ${ogWiki}/${line} >${ogWiki}/${base}${file}.md
25done 41done
26 42
27# Copy across things like images that where uploaded. 43# Copy across things like images that where uploaded.
diff --git a/SuckItClean b/SuckItClean
index cddd28e..a6ca475 100755
--- a/SuckItClean
+++ b/SuckItClean
@@ -4,7 +4,7 @@ TIMEFORMAT=" took %lR using %P%% CPU"
4time { 4time {
5pushd /opt/nyaw 5pushd /opt/nyaw
6 6
7rm -fr DocuWiki/*.md 7rm -fr DocuWiki/*
8rm -fr Foswiki/* 8rm -fr Foswiki/*
9rm -fr PmWiki/* 9rm -fr PmWiki/*
10rm -fr unsorted 10rm -fr unsorted
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua
index 114af16..355af99 100755
--- a/notYetAnotherWiki.lua
+++ b/notYetAnotherWiki.lua
@@ -542,7 +542,7 @@ local whichPage = function(f)
542 if nil ~= Subs[f].files then 542 if nil ~= Subs[f].files then
543 if 1 == #(Subs[f].files) then fl = Subs[f].files[1] else 543 if 1 == #(Subs[f].files) then fl = Subs[f].files[1] else
544 -- Standard files to search for. 544 -- Standard files to search for.
545 for i, v in ipairs{'about', 'readme', 'index', 'homepage', 'mainpage', 'webhome'} do 545 for i, v in ipairs{'about', 'readme', 'index', 'homepage', 'mainpage', 'webhome', 'start'} do
546 for j, w in ipairs(Subs[f].files) do 546 for j, w in ipairs(Subs[f].files) do
547 if v == w:lower() then 547 if v == w:lower() then
548 fl = w 548 fl = w
@@ -832,9 +832,9 @@ local lunaLinky = function(url, lab, tit) -- Fix up the links.
832 end 832 end
833-- if p:sub(1, 9) ~= 'DocuWiki/' then cnt = cnt + 1 end 833-- if p:sub(1, 9) ~= 'DocuWiki/' then cnt = cnt + 1 end
834 if url:sub(-4) == '.png' then cnt = cnt + 1 end 834 if url:sub(-4) == '.png' then cnt = cnt + 1 end
835 url = string.rep('../', cnt) .. 'DocuWiki/pages' .. p 835 url = string.rep('../', cnt) .. 'DocuWiki' .. p
836 elseif url:sub(1, 37) == 'https://friendsofdevuan.org/doku.php/' then 836 elseif url:sub(1, 37) == 'https://friendsofdevuan.org/doku.php/' then
837 url = 'DocuWiki/pages' .. url:sub(37):gsub(':', '/') 837 url = 'DocuWiki' .. url:sub(37):gsub(':', '/')
838 end 838 end
839 end 839 end
840 return url:gsub('//DocuWiki//DocuWiki//', '/DocuWiki/') 840 return url:gsub('//DocuWiki//DocuWiki//', '/DocuWiki/')