93. Convert Confluence XHTML to AsciiDoc
You can convert Atlassian Confluence XHTML pages to Asciidoctor using this Groovy script.
The script calls Pandoc to convert single or multiple HTML files exported from Confluence to AsciiDoc files. You’ll need Pandoc installed before running this script.
| If you have trouble running this script, you can use the Pandoc command referenced inside the script to convert XHTML files to AsciiDoc manually. |
link:https://gist.githubusercontent.com/melix/6020336/raw/059d83a3dae933de71d585c3f6b229a3c62fa857/convert.groovy[]
The script is designed to be run locally on HTML files or directories containing HTML files exported from Confluence.
-
Save the script contents to a
convert.groovyfile in a working directory. -
Make the file executable according to your specific OS requirements.
-
Place individual files, or a directory containing files into the working directory.
-
Run
groovy convert filename.htmlto convert a single file. -
Confirm the output file meets requirements
-
Recurse through a directory by using this command pattern:
groovy convert directory/*.html
This script was created by Cédric Champeau (melix). You can find the source of this script hosted at this GitHub Gist.