aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/SuckItPm
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xSuckItPm38
1 files changed, 23 insertions, 15 deletions
diff --git a/SuckItPm b/SuckItPm
index b7a183c..d8ac817 100755
--- a/SuckItPm
+++ b/SuckItPm
@@ -23,13 +23,15 @@ do
23# pandoc -f html -t markdown --self-contained ${URL}/?n=${base}.${file} >PmWiki/${base}/${file}.md 23# pandoc -f html -t markdown --self-contained ${URL}/?n=${base}.${file} >PmWiki/${base}/${file}.md
24 # TODO - try curl, to see what is actually downloaded, and maybe not download unchanged pages. curl to .HTM 24 # TODO - try curl, to see what is actually downloaded, and maybe not download unchanged pages. curl to .HTM
25 # 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. 25 # 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.
26 curl --no-progress-meter ${URL}/?n=${base}.${file} -o PmWiki/${base}/${file}.HTM 26# curl --no-progress-meter ${URL}/?n=${base}.${file} -o PmWiki/${base}/${file}.HTM
27 pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md 27 curl --no-progress-meter ${URL}/?n=${base}.${file}?action=markdown -o PmWiki/${base}/${file}.MD
28# pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md
29 pandoc -f markdown -t commonmark_x --self-contained PmWiki//${base}/${file}.MD >PmWiki/${base}/${file}.md
28 ln -frs PmWiki/${base}/${file}.md combined/${base}/${file}.md 30 ln -frs PmWiki/${base}/${file}.md combined/${base}/${file}.md
29 cp PmWiki/${base}/${file}.md PmWiki/${base}/${file}.md_ORIGINAL 31 cp PmWiki/${base}/${file}.md PmWiki/${base}/${file}.md_ORIGINAL
30 32
31# csplit -ks PmWiki/${base}/${file}.md '/trailstart/' '/trailend/' 33 csplit -ks PmWiki/${base}/${file}.md '%trailstart%' '/trailend/'
32 csplit -ks PmWiki/${base}/${file}.md '%::: {#wikitext}%' '/::: {#wikifoot-links .footnav}/' 34# csplit -ks PmWiki/${base}/${file}.md '%::: {#wikitext}%' '/::: {#wikifoot-links .footnav}/'
33 if [ -f xx00 ]; then 35 if [ -f xx00 ]; then
34 rm PmWiki/${base}/${file}.md 36 rm PmWiki/${base}/${file}.md
35 mv xx00 PmWiki/${base}/${file}.md 37 mv xx00 PmWiki/${base}/${file}.md
@@ -39,21 +41,27 @@ do
39 sed -i -E PmWiki/${base}/${file}.md \ 41 sed -i -E PmWiki/${base}/${file}.md \
40 -e 's/\$/\$dlr\$/g' \ 42 -e 's/\$/\$dlr\$/g' \
41 -e 's/\{#.*\}//g' \ 43 -e 's/\{#.*\}//g' \
44 -e '/^:::/d' \
42 -e '/\{\.wikilink\}/d' \ 45 -e '/\{\.wikilink\}/d' \
43 -e '/\[Site$/d' \ 46 -e '/\[Site$/d' \
44 -e '/^:::/d' \
45 -e '/^Page last modified on /d' \ 47 -e '/^Page last modified on /d' \
46 -e '/^\[\]/d' \ 48 -e '/^\[\]/d' \
47 -e 's/\{rel=".*\}//g' \ 49 -e "s/\`<a id='trailstart'>\`\{=html\}\`<\/a>\`\{=html\}//g" \
48 -e 's/\{rel="nofollow"$//g' \ 50 -e "s/^\`<img /<img /g" \
49 -e 's/^rel="nofollow"\}//g' \ 51 -e "s/^\`\`\`\{=html\}//g" \
50 -e 's/^target="_blank"\}//g' \ 52 -e "s/^\`\`\`//g" \
51 -e 's/\{\.createlinktext.*\}//g' \ 53 -e "s/\`\{=html\}//g"
52 -e 's/\{\.createlinktext$//g' \ 54
53 -e 's/\{\.createlink.*\}//g' \ 55# -e 's/\{rel=".*\}//g' \
54 -e 's/\{\.createlink$//g' \ 56# -e 's/\{rel="nofollow"$//g' \
55 -e 's/\{\.urllink.*\}//g' \ 57# -e 's/^rel="nofollow"\}//g' \
56 -e 's/\{\.urllink$//g' 58# -e 's/^target="_blank"\}//g' \
59# -e 's/\{\.createlinktext.*\}//g' \
60# -e 's/\{\.createlinktext$//g' \
61# -e 's/\{\.createlink.*\}//g' \
62# -e 's/\{\.createlink$//g' \
63# -e 's/\{\.urllink.*\}//g' \
64# -e 's/\{\.urllink$//g'
57 65
58echo "<hr/><p><a href=\"${URL}/?n=${base}.${file}\">Original page</a> where you can edit it.</p>" >> PmWiki/${base}/${file}.md 66echo "<hr/><p><a href=\"${URL}/?n=${base}.${file}\">Original page</a> where you can edit it.</p>" >> PmWiki/${base}/${file}.md
59done 67done