From d7c399df63f5d08be38619aab68db20ee521e249 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sat, 18 Jan 2025 11:38:09 +1000 Subject: Use the PmWiki MarkDown module. --- SuckItPm | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'SuckItPm') diff --git a/SuckItPm b/SuckItPm index b7a183c..d8ac817 100755 --- a/SuckItPm +++ b/SuckItPm @@ -23,13 +23,15 @@ do # pandoc -f html -t markdown --self-contained ${URL}/?n=${base}.${file} >PmWiki/${base}/${file}.md # TODO - try curl, to see what is actually downloaded, and maybe not download unchanged pages. curl to .HTM # 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 --no-progress-meter ${URL}/?n=${base}.${file} -o PmWiki/${base}/${file}.HTM - pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md +# curl --no-progress-meter ${URL}/?n=${base}.${file} -o PmWiki/${base}/${file}.HTM + curl --no-progress-meter ${URL}/?n=${base}.${file}?action=markdown -o PmWiki/${base}/${file}.MD +# pandoc -f html -t commonmark_x --self-contained PmWiki//${base}/${file}.HTM >PmWiki/${base}/${file}.md + pandoc -f markdown -t commonmark_x --self-contained PmWiki//${base}/${file}.MD >PmWiki/${base}/${file}.md ln -frs PmWiki/${base}/${file}.md combined/${base}/${file}.md cp PmWiki/${base}/${file}.md PmWiki/${base}/${file}.md_ORIGINAL -# csplit -ks PmWiki/${base}/${file}.md '/trailstart/' '/trailend/' - csplit -ks PmWiki/${base}/${file}.md '%::: {#wikitext}%' '/::: {#wikifoot-links .footnav}/' + csplit -ks PmWiki/${base}/${file}.md '%trailstart%' '/trailend/' +# csplit -ks PmWiki/${base}/${file}.md '%::: {#wikitext}%' '/::: {#wikifoot-links .footnav}/' if [ -f xx00 ]; then rm PmWiki/${base}/${file}.md mv xx00 PmWiki/${base}/${file}.md @@ -39,21 +41,27 @@ do sed -i -E PmWiki/${base}/${file}.md \ -e 's/\$/\$dlr\$/g' \ -e 's/\{#.*\}//g' \ + -e '/^:::/d' \ -e '/\{\.wikilink\}/d' \ -e '/\[Site$/d' \ - -e '/^:::/d' \ -e '/^Page last modified on /d' \ -e '/^\[\]/d' \ - -e 's/\{rel=".*\}//g' \ - -e 's/\{rel="nofollow"$//g' \ - -e 's/^rel="nofollow"\}//g' \ - -e 's/^target="_blank"\}//g' \ - -e 's/\{\.createlinktext.*\}//g' \ - -e 's/\{\.createlinktext$//g' \ - -e 's/\{\.createlink.*\}//g' \ - -e 's/\{\.createlink$//g' \ - -e 's/\{\.urllink.*\}//g' \ - -e 's/\{\.urllink$//g' + -e "s/\`\`\{=html\}\`<\/a>\`\{=html\}//g" \ + -e "s/^\`

Original page where you can edit it.

" >> PmWiki/${base}/${file}.md done -- cgit v1.1