-
Pull out content from <content> tag in exported XML file
-
Replace blank lines w/ </p><p>, add <p> as first line and </p> as last line
-
Put that content into the body of a basic HTML document structure (so it looks like an HTML file)
-
convert using
pandoc --no-wrap -f html -t asciidoc post-content.html > post-content.adoc
-
use sed to cleanup
sed -i s/^image:/image::/ post-content.adoc sed -i s/^----.*/----/ post-content.adoc
-
Add document title, author and date (manual, atm)
= Post title Jason Brooks 2012-08-31
-
run through Asciidoctor
asciidoctor -a linkcss! post-content.adoc
-
profit
Created
June 7, 2013 21:24
-
-
Save mojavelinux/5732518 to your computer and use it in GitHub Desktop.
Steps to convert WordPress post to AsciiDoc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing! In newer versions of pandoc, --no-wrap is replaced by --wrap=none