Friday, August 24, 2018

Export Confluence HTML to Github Wiki

Confluence allows its HTML pages to be exported in a single zip. There is a Confluence-to-Github-Markdown tool that allows automatic export of these HTML files to markdown .md files with a single command from the core directory:
$ confluence-to-github-markdown

Now you can create separate pages in the GitHub wiki with these md files. However, there are a certain limitations that need to be manually handled to complete the process.

1. Image. GitHub wiki does not support uploading images. Images are posted via URLs in the wiki. Therefore, currently we need to upload the images to a public location and access the URL from there.

2. Metadata. The tool also converts metadata (which is actually good I think) to md. We need to manually remove them wherever unnecessary instead of showing them as plain text in the GitHub wiki.

3. The converter tool creates the name of the md file from the html title. If you have ' or any special characters in the title of your html, it will fail to convert and throw js errors. To fix, change the title header from something such as "Rakshak’s RESTful API" to "Rakshak RESTful API" before executing the converter tool.

4. Internal links (links to named anchors in the markdown) are not handled by the converter.  The anchors must be manually added.

5. Links to other pages in the confluence wiki are preserved as it is, rather than having them as a relative link. Therefore they need to be replaced by the respective new link in the markdown wiki.

6. Video embedding is not supported in Markdown. Therefore, the converter tool simply ignores any video files embedded in the HTML. To fix this, in the final wiki pages, manually add the videos as a simple HTML links as in, [screencast](https://www.youtube.com/embed/S8juo0Dx68I).

1 comment:

  1. Probably helpful improvement: https://github.com/meridius/confluence-to-markdown

    ReplyDelete

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.