This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

HTML2Confluence Java script

Current status: We don't know how to get this script to work. Here is what we've got so far. 

The documentation at http://jparsec.codehaus.org/Html2Confluence is incorrect. (And although they use a Confluence Wiki, the documentation is not editable).

Download JParsec at  http://jparsec.codehaus.org/Downloads -- BUT WE CANNOT FIND A VERSION THAT WORKS. THIS MAY BE THE KEY ISSUE.

Unzip JParsec into the same folder as you have the confluence_converter.jar. Change the line below to reflect the right path for JParsec.

That page says that the main class is Html2Confluence. This is incorrect. The main class is "jfun.markup.Html2Confluence". You can run this program from the jar by typing:

java -cp confluence_converter.jar:jparsec-1.0.jar jfun.markup.Html2Confluence  [source-html-file] [output-confluence file]
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 02, 2007

    Matthew Janulewicz says:

    I was able to get this to work, kinda sorta. My main goal was to attempt to conv...

    I was able to get this to work, kinda sorta. My main goal was to attempt to convert a Word doc to Confluence format. I started by saving the Word doc to 'Filtered HTML'. Then, the commandline I came up with looks like this:

    
    java -cp jparsec-1.2.jar;confluence_converter.jar jfun.markup.Html2Confluence TestWordDoc.htm test.out
    
    

    Note the latest version of jparsec (1.2) was used.

    Interesting things to note:

    1. With Windows, the ':' needs to be a ';' when separating .jar files on the commandline.

    2. You will get tons of errors on some forms of HTML. One major thing to remember is that every html parameter must be enclosed in quotes:

    align=center <--- NO!
    align="center" <--- YES!

    When running the converter it will give you an 'EOF' error when it encounters a tag that it expects to be in quotes.

    3. All quotes must be double quotes, not single quotes.

    4. Mainly, just watch the error messages on the commandline. After doing a few of these you'll start to recognize the things that come up over and over. You could probably 'macro-ize' the html 'schmoozing' with your favorite text editor's macro recorder/writer.

    -Matthew