You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.4 KiB
33 lines
1.4 KiB
4 years ago
|
////
|
||
|
Header: Convert Confluence XHTML to AsciiDoc
|
||
|
|
||
|
Included in:
|
||
|
|
||
|
- user-manual
|
||
|
////
|
||
|
You can convert Atlassian Confluence XHTML pages to Asciidoctor using this http://www.groovy-lang.org/download.html[Groovy] script.
|
||
|
|
||
|
The script calls https://pandoc.org/[Pandoc] to convert single or multiple HTML files exported from Confluence to AsciiDoc files.
|
||
|
You'll need Pandoc installed before running this script.
|
||
|
|
||
|
NOTE: If you have trouble running this script, you can use the Pandoc command referenced inside the script to convert XHTML files to AsciiDoc manually.
|
||
|
|
||
|
.convert.groovy
|
||
|
[source,groovy]
|
||
|
----
|
||
|
include::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.
|
||
|
|
||
|
.Usage
|
||
|
. Save the script contents to a `convert.groovy` file 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.html` to 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 (https://gist.github.com/melix[melix]).
|
||
|
You can find the source of this script hosted at this https://gist.github.com/melix/6020336[GitHub Gist].
|