aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordvs12025-01-18 11:38:09 +1000
committerdvs12025-01-18 11:38:09 +1000
commitd7c399df63f5d08be38619aab68db20ee521e249 (patch)
tree0a833cc5d5bfdad39bd5f5a0460657610d0c47c9
parentTODO++ (diff)
downloadnotYetAnotherWiki-d7c399df63f5d08be38619aab68db20ee521e249.zip
notYetAnotherWiki-d7c399df63f5d08be38619aab68db20ee521e249.tar.gz
notYetAnotherWiki-d7c399df63f5d08be38619aab68db20ee521e249.tar.bz2
notYetAnotherWiki-d7c399df63f5d08be38619aab68db20ee521e249.tar.xz
Use the PmWiki MarkDown module.
Diffstat (limited to '')
-rwxr-xr-xSuckItPm38
-rw-r--r--TODO.md1
2 files changed, 24 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
diff --git a/TODO.md b/TODO.md
index 87e2392..cacdb22 100644
--- a/TODO.md
+++ b/TODO.md
@@ -4,6 +4,7 @@ pagehistory: https://sledjhamr.org/cgit/notYetAnotherWiki/log
4--- 4---
5## Do these 5## Do these
6 6
7See if any wiki specific MarkDown outputting modules can help. Already installed one for PmWiki, which works now. See if I can find something similar for Foswiki.
7 8
8Check the timestamps on the files, only update if source is newer than destination. Meh, it's already 600 times faster than the pandoc version. 9Check the timestamps on the files, only update if source is newer than destination. Meh, it's already 600 times faster than the pandoc version.
9- One quirk to watch for is if a URL path changes, the docs that have that URL need to be redone. 10- One quirk to watch for is if a URL path changes, the docs that have that URL need to be redone.