diff options
| author | onefang | 2026-02-05 12:36:21 +1000 |
|---|---|---|
| committer | onefang | 2026-02-05 12:36:21 +1000 |
| commit | 36303cfa576daa8498179c24d2789be5bdc4f954 (patch) | |
| tree | 617eecd17e8590ddaf7c45d87e81304626593049 | |
| parent | Start using polygLua. (diff) | |
| download | notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.zip notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.tar.gz notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.tar.bz2 notYetAnotherWiki-36303cfa576daa8498179c24d2789be5bdc4f954.tar.xz | |
More DocuWiki stuff.
| -rwxr-xr-x | SuckIt | 18 | ||||
| -rwxr-xr-x | SuckItClean | 2 | ||||
| -rwxr-xr-x | notYetAnotherWiki.lua | 6 |
3 files changed, 21 insertions, 5 deletions
| @@ -4,6 +4,11 @@ TIMEFORMAT=" took %lR using %P%% CPU" | |||
| 4 | time { | 4 | time { |
| 5 | pushd /opt/nyaw | 5 | pushd /opt/nyaw |
| 6 | 6 | ||
| 7 | #rm -fr DocuWiki/* | ||
| 8 | mkdir -p DocuWiki | ||
| 9 | cp -r /opt/DocuWiki/data/pages/* ./DocuWiki | ||
| 10 | cp -r /opt/DocuWiki/data/media/* ./DocuWiki | ||
| 11 | cp -r /opt/nyaw_EMPTY/DocuWiki . | ||
| 7 | #rm -fr Foswiki/* | 12 | #rm -fr Foswiki/* |
| 8 | cp -r /opt/nyaw_EMPTY/Foswiki . | 13 | cp -r /opt/nyaw_EMPTY/Foswiki . |
| 9 | #rm -fr PmWiki/* | 14 | #rm -fr PmWiki/* |
| @@ -15,13 +20,24 @@ cp -r /opt/nyaw_EMPTY/unsorted . | |||
| 15 | mkdir -p users | 20 | mkdir -p users |
| 16 | cp -r /opt/nyaw_EMPTY/users . | 21 | cp -r /opt/nyaw_EMPTY/users . |
| 17 | 22 | ||
| 23 | ogURL="" | ||
| 18 | ogWiki="DocuWiki" | 24 | ogWiki="DocuWiki" |
| 19 | time find DocuWiki \ | 25 | time 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 |
| 21 | do | 27 | do |
| 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 | ||
| 25 | done | 41 | done |
| 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" | |||
| 4 | time { | 4 | time { |
| 5 | pushd /opt/nyaw | 5 | pushd /opt/nyaw |
| 6 | 6 | ||
| 7 | rm -fr DocuWiki/*.md | 7 | rm -fr DocuWiki/* |
| 8 | rm -fr Foswiki/* | 8 | rm -fr Foswiki/* |
| 9 | rm -fr PmWiki/* | 9 | rm -fr PmWiki/* |
| 10 | rm -fr unsorted | 10 | rm -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/') |
