From c560ae0b2a0c714c9944fa988632527f4f2630b4 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Wed, 19 Feb 2025 17:40:48 +1000 Subject: Major YAR!! Moved the post download code from the SuckIt's to the main script, and combined what's left. Minor icon tweak. Think I have almost figured out the HTML and CSS to get the layout to behave. Major rearrange of the main script. Use more of lunamark and RE. Moar colours! Solved the generic colour shenanigans. Solved a few other bugs. Hidden directories. Lots of things I forgot about. --- SuckItFos | 68 --------------------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100755 SuckItFos (limited to 'SuckItFos') diff --git a/SuckItFos b/SuckItFos deleted file mode 100755 index dc65505..0000000 --- a/SuckItFos +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -URL="https://fos.wiki.devuan.org" - -filter=" - -name _default -prune -o \ - -name _empty -prune -o \ - -name System -prune -o \ - -name Trash -prune -o \ - -name TWiki -prune -o \ -" - -pushd /opt/mergedWork - -find /opt/Foswiki/data ${filter} \ --name "*.txt" -type f,l -printf "%P\n" | while read line -do - base=`echo "${line}" | cut -d '/' -f 1` - file=`echo "${line}" | cut -d '/' -f 2- | rev | cut -b 5- | rev` - time=`date --rfc-3339=seconds -ur /opt/Foswiki/data/${base}/${file}.txt | cut -d '+' -f 1` - mkdir -p Foswiki/$base - mkdir -p Foswiki/${base}/`dirname ${file}` - mkdir -p combined/$base - mkdir -p combined/${base}/`dirname ${file}` - echo "Converting ${URL}/${base}/${file}?cover=print -> Foswiki/${base}/${file}.md" - echo -e "ogWiki=Foswiki\nogURL=${URL}\nogBase=${base}\nogFile=${file}\ntimestamp=${time}\n" > Foswiki/${base}/${file}.md.md - # 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. - curl --silent --no-progress-meter ${URL}/${base}/${file}?cover=print -o Foswiki/${base}/${file}.HTM - cp Foswiki/${base}/${file}.HTM Foswiki/${base}/${file}.HTM_ORIGINAL - csplit -ks Foswiki/${base}/${file}.HTM '%
%' '/
/' - if [ -f xx00 ]; then - rm Foswiki/${base}/${file}.HTM - mv xx00 Foswiki/${base}/${file}.HTM - fi - sed -i -E Foswiki/${base}/${file}.HTM \ - -e "s/rel='nofollow'//g" \ - -e 's/rel="nofollow"//g' \ - -e "s/target='_blank'//g" \ - -e "s/class='foswiki[[:alpha:]]*'//g" \ - -e 's/class="foswikiTopic"/class="FoswikiTopic"/g' \ - -e 's/class="foswiki[[:alpha:]]*"//g' \ - -e "s/style='.*;'//g" - - pandoc -f html -t commonmark_x --self-contained Foswiki//${base}/${file}.HTM >Foswiki/${base}/${file}.md - cp Foswiki/${base}/${file}.md Foswiki/${base}/${file}.md_ORIGINAL - - csplit -ks Foswiki/${base}/${file}.md '%::: {.FoswikiTopic}%' '/::: {.patternInfo}/' - if [ -f xx00 ]; then - rm Foswiki/${base}/${file}.md - mv xx00 Foswiki/${base}/${file}.md - fi - if [ -f xx01 ]; then - rm xx01 - fi - - # Attempt to clean things up, badly. - sed -i -E Foswiki/${base}/${file}.md \ - -e 's/\$/\$dlr\$/g' \ - -e 's/\{#.*\}//g' \ - -e '/^:::/d' \ - -e '/^/d' \ -# -e 's/\{\.pattern.*\}//g' \ -# -e 's/\{\.pattern.*//g' \ - - ln -frs Foswiki/${base}/${file}.md combined/${base}/${file}.md -done - -popd -- cgit v1.1