tfager / pandoc-pmwiki-reader

Lua script to read PMWiki markup into pandoc
MIT License
1 stars 0 forks source link

Directly reading PmWiki PageFileFormat #1

Closed Utopiah closed 4 weeks ago

Utopiah commented 1 month ago

Thanks for the great filter!

I'm not familiar with Pandoc so maybe this is obvious for everybody else but I tried reading PmWiki files from its data directory wiki.d/ directory and that did not work.

Here is how I got some encouraging result :

cat wiki.d/Fabien.Principle | grep -a "^text=" | sed "s/^text=//" | sed "s/%0a/\n/g" | sed "s/%25/%/g" | sed "s/%3c/</g" | pandoc -f pmwiki_reader.lua -o Fabien.Principle.pdf

Namely getting only the text field (no history, skipping encoding, etc), removing its name, then splitting in multiple lines, fixing the percentage symbol, inferior than symbol all according to https://www.pmwiki.org/wiki/PmWiki/PageFileFormat

Is it supposed to be done this way?

Adding it there in case others might benefit from it or have suggestions.

tfager commented 4 weeks ago

Thanks, indeed that's quite an elegant representation of what I also did. If you don't mind I could add that to the README and close the issue?

Utopiah commented 4 weeks ago

Please do!

tfager commented 4 weeks ago

Added in https://github.com/tfager/pandoc-pmwiki-reader/pull/3