diff options
| author | dvs1 | 2025-02-21 17:53:48 +1000 |
|---|---|---|
| committer | dvs1 | 2025-02-21 17:53:48 +1000 |
| commit | 7d1d891d8fdec5f11d4f86ef7ff4bf8bf4ac0de0 (patch) | |
| tree | ac88600dd6b24c98994a6ec3597852c563149e10 /SuckIt | |
| parent | Work around yet another colour corner case. (diff) | |
| download | notYetAnotherWiki-7d1d891d8fdec5f11d4f86ef7ff4bf8bf4ac0de0.zip notYetAnotherWiki-7d1d891d8fdec5f11d4f86ef7ff4bf8bf4ac0de0.tar.gz notYetAnotherWiki-7d1d891d8fdec5f11d4f86ef7ff4bf8bf4ac0de0.tar.bz2 notYetAnotherWiki-7d1d891d8fdec5f11d4f86ef7ff4bf8bf4ac0de0.tar.xz | |
Try to sort out user profiles and user content. They don't make it easy, or possible.
Diffstat (limited to 'SuckIt')
| -rwxr-xr-x | SuckIt | 31 |
1 files changed, 30 insertions, 1 deletions
| @@ -8,7 +8,10 @@ rm -fr Foswiki/* | |||
| 8 | cp -r /opt/merged_EMPTY/Foswiki . | 8 | cp -r /opt/merged_EMPTY/Foswiki . |
| 9 | rm -fr PmWiki/* | 9 | rm -fr PmWiki/* |
| 10 | cp -r /opt/merged_EMPTY/PmWiki . | 10 | cp -r /opt/merged_EMPTY/PmWiki . |
| 11 | 11 | rm -fr unsorted | |
| 12 | mkdir -p unsorted | ||
| 13 | rm -fr users | ||
| 14 | mkdir -p users | ||
| 12 | 15 | ||
| 13 | filter=" | 16 | filter=" |
| 14 | -name _default -prune -o \ | 17 | -name _default -prune -o \ |
| @@ -31,6 +34,23 @@ do | |||
| 31 | echo "downloading ${URL}/${base}/${file}?cover=print" | 34 | echo "downloading ${URL}/${base}/${file}?cover=print" |
| 32 | # Doesn't help with redownloads, coz natch a dynamic site isn't cached. But I can at least comment out the curl command during testing to save time. | 35 | # Doesn't help with redownloads, coz natch a dynamic site isn't cached. But I can at least comment out the curl command during testing to save time. |
| 33 | curl --silent --no-progress-meter ${URL}/${base}/${file}?cover=print -o Foswiki/${base}/${file}.HTM | 36 | curl --silent --no-progress-meter ${URL}/${base}/${file}?cover=print -o Foswiki/${base}/${file}.HTM |
| 37 | # Attempt to separate user profiles from user content. Doesn't work when people turn their profiles into content. | ||
| 38 | if [[ "${base}" == "Main" ]]; then | ||
| 39 | dest="unsorted" | ||
| 40 | mkdir -p `dirname users/${file}` | ||
| 41 | sed -i -E Foswiki/${base}/${file}.HTM -e "s%<a href=\"/System/UserForm\">UserForm</a>%<p></p>%w users/${file}_fos.SED" | ||
| 42 | if [ -s users/${file}_fos.SED ]; then | ||
| 43 | dest="users" | ||
| 44 | else | ||
| 45 | rm users/${file}_fos.SED | ||
| 46 | rm -d `dirname users/${file}` 2>1 1>/dev/null | ||
| 47 | fi | ||
| 48 | mkdir -p `dirname ${dest}/${file}` | ||
| 49 | touch Foswiki/${base}/${file}.md | ||
| 50 | ln -sfr Foswiki/${base}/${file}.md ${dest}/${file}_fos.md | ||
| 51 | ln -sfr Foswiki/${base}/${file}.md.md ${dest}/${file}_fos.md.md | ||
| 52 | rm Foswiki/${base}/${file}.md | ||
| 53 | fi | ||
| 34 | fi | 54 | fi |
| 35 | done | 55 | done |
| 36 | 56 | ||
| @@ -56,6 +76,15 @@ do | |||
| 56 | # curl --no-progress-meter ${URL}/?n=${base}.${file}?action=markdown -o PmWiki/${base}/${file}.MARKDOWN | 76 | # curl --no-progress-meter ${URL}/?n=${base}.${file}?action=markdown -o PmWiki/${base}/${file}.MARKDOWN |
| 57 | echo "downloading ${URL}/?n=${base}.${file}?action=print" | 77 | echo "downloading ${URL}/?n=${base}.${file}?action=print" |
| 58 | curl --no-progress-meter ${URL}/?n=${base}.${file}?action=print -o PmWiki/${base}/${file}.HTM | 78 | curl --no-progress-meter ${URL}/?n=${base}.${file}?action=print -o PmWiki/${base}/${file}.HTM |
| 79 | # Seems there's no way to tell user profiles apart from user content. Unless I can find a list of users somewhere. Don't think there is one. | ||
| 80 | if [[ "${base}" == "Profiles" ]]; then | ||
| 81 | touch PmWiki/${base}/${file}.md | ||
| 82 | ln -sfr PmWiki/${base}/${file}.md unsorted/${file}_pm.md | ||
| 83 | ln -sfr PmWiki/${base}/${file}.md unsorted/${file}_pm.md.md | ||
| 84 | rm PmWiki/${base}/${file}.md | ||
| 85 | fi | ||
| 86 | |||
| 87 | # TODO - groups are PmWiki/Onefang and PmWiki/Tiki | ||
| 59 | 88 | ||
| 60 | # pandoc -f markdown -t commonmark_x --self-contained PmWiki//${base}/${file}.MD >PmWiki/${base}/${file}.md | 89 | # pandoc -f markdown -t commonmark_x --self-contained PmWiki//${base}/${file}.MD >PmWiki/${base}/${file}.md |
| 61 | # pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md | 90 | # pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md |
