Table of Contents
Overview
This is the documentation page for the Swiki module of the Universal Wiki Converter
Status
The Swiki converter is a user contributed module. Users interested in improving it are encouraged to submit patches or code by contacting Laura Kolker or Brendan Patterson.
Supported Conversions
- Basic Syntax
- headers
- Some preformatted syntax
- from <pre> tags
- starting with =
- but preformatted text is also scanned for Wiki syntax so things like * will cause the link checker to choke
- some html syntax such
>, <br/>, <i>
etc.
- HTML checking is by line (i.e., some start and end tags are only handled properly if they are on the same line)
- horizontal rules
- bold
- italics
- emphasis
- underline
- Attachments
- Links, including:
- email links
- anchors
- Lists
- Some combinations of # and - are handled by explicit REGEX but all possible combinations or depths are not handled generically
- Confluence require a space after the - so the conversion adds one if it did not exist before
- Lists are not terminated the same as in Swiki (i.e., two numbered lists separated by a horizontal rule in Swiki create 123-123 but will create 123-456 in Confluence)
Two props files
There are two swiki properties files to choose from right now.
The earlier version (see UCAR Notes) is identified as converter.swiki-earlier.properties
The more recent version (which is built on the earlier version, but is untested) is the default converter.swiki.properties
The conversions listed above reflect the more recent version.
UCAR Notes
Markus Stobbs of UCAR contributed his work on the Swiki converter. His notes are as follows:
What does it do?
Converts Swikis into Confluence spaces. Swiki is an open source wiki. For more information on it, see: http://wiki.squeak.org/swiki/
Export
Exports Swiki xml files into text files. It will parse each xml page looking for Swiki style links and follow those links exporting each xml file into a text file. The name tag of the xml file will be the name of the text file.
Export with Command Line Interface
| as of v. 50 This feature will be available as of v. 50 |
Alternatively, as of v.50, you can use the SWikiExporter's command line interface. Usage:
$shell$ java -classpath $CLASSPATH com.atlassian.uwc.exporters.SwikiExporter <swiki exporter prop file>
Example shell script for running the SwikiExporter from the command line:
CLASSPATHORIG="$CLASSPATH" CLASSPATH="./uwc.jar" CLASSPATH="$CLASSPATH:$CLASSPATHORIG" java -Xms512m -Xmx512m -classpath $CLASSPATH com.atlassian.uwc.exporters.SwikiExporter conf/exporter.swiki.properties
Convert
Coverts exported Swiki text files into confluence syntax then uploads those files and attachments to the confluence server. (reflects converter.swiki-earlier.properties)
- Headers
- Horizontal lines
- Tables
- Preformatted (No format)
- Links
- Internal
- External
- Anchors
- Email address
- Aliasing
- Some html tags i.e. bold, italics, underlines
- Attachments
- Bullet lists
- Numbered lists
What it can't handle?
Any other HTML tags not listed above imbedded in the page.
Export Swiki XML files
To prepare Swiki xml files and attachments for conversion use the UWC exporter. This will export the complete Swiki space for import. You can copy the whole Swiki space to an alternative place and as long as you have both the pages and uploads directories it will export those files.
Using the exporter:
- Configure the conf/exporter.swiki.properties file.
- Select the export tab in the UWC and choose Swiki and click Run Exporter.
Configuring the exporter.swiki.properties file:exporter.class Leave this as is. exported.input.dir The pages directory in the Swiki space this
is the xml files. i.e. swiki/weg/pagesexported.input.attachments.dir The uploads directory in the Swiki space. i.e. swiki/weg/uploads exported.output.dir This is the directory to export the xml files to. i.e. /home/kmeese/exported/weg exported.output.attachment.dir This is the directory to export the attachments to.
i.e. /home/kmeese/exported/weg/attachments
Convert to Confluence syntax:
- Click the "Choose Wiki Type" and select Swiki then click "Choose Wiki"
- Confluence settings should be specific to you confluence server.
- Confluence URL - This is the URL for the confluence server you will upload the space to.
- Login - This is the wiki user that will upload the space
- Password - The users password
- Space Key - This is the space key that the converted pages will be uploaded to.
- File name pattern - This should remain as .txt
- Attachment directory - Where the attachment were copied to. This is from the exported.output.attachment.dir
- Choose Next
- Select Converters: This should remain as is unless you want to remove a converter or add an additional one.
- Choose Pages to convert - Select the directory or pages you want to convert to confluence syntax.
- Send Pages to Confluence - This is where you will convert the pages and upload them to the confluence server.
Adding your own converters:
In the conf/converter.swiki.properties file you may add your own converters. Before you do this you may want to check out the UWC Developer Documentation at UWC Developer Documentation.
Bug/Feature Reports
Bug Reports and Feature requests are encouraged. Please see UWC Bug Reporting for more info.
