Import Markdown Into Confluence



Import from Bitbucket, Github and Gitlab Instantly render markdown including table, text, and HTML formatting in Confluence pages. +1-416-273-6883 / +1-855-366-8444. I'm trying to work out a way to post into confluence a R statistical program Markdown file. So far I have converted the markdown to PDF and imported that but I would like to be able to embed the markdown page directly. Here are the import types supported: Markdown or HTML files. Markdown files, or.md files, are a standard format supported by many editors. Slab will let you import arbitrary markdown files. In addition, HTML files or.html files are also supported. Simply click on 'Team Settings' in the top left dropdown, and then 'Import / Export' 'Files'.

Convert

A recent working experience needed me to write doc on Atlassian Confluance documentation product. I will show you how to convert your markdown doc to Confluance version.

Confluance’s web doc editor is very powerfull, but I a markdown guy, I write everything in markdown in pure text mode and versioning it. I need sth. to convert markdown to Confluance.

Checked on the official doc, it says that Confluence supports markdown import, but after a test, not really, at least not for table.

Solution:

Convert the markdown or rst files to a HTML file.

There’re many plugins on the net, I use VSCode editor, I choose the extension Markdown All in One, it has a method called “Markdown: Print current document to HTML”.

Once I get the HTML version, than just past the HTML content into Confluence directly. Done.

Here’s the tutorial on how to insert the HTML marco.

Import Markdown Into Confluence

Checked on the official doc, it says that Confluence supports wiki import, but I haven’t tested yet.

I recently did some investigations at work on how to keep documentation up to date. I guess we’ve all been in the situation that the documentation we have is drifting from how the actual systems/applications look like. I believe that it’s easier to keep the documentation close the the actual code, e.g by README’s in markdown, than by have them as separate confluence pages that no one remembers to keep up to date. If you are using Confluence you can create/update documentation by using the REST api, however Confluence does not accept markdown so you have two options;

Markdown
  • install markdown plugins (that’s available in the api)
  • or convert markdown to confluence markup language

I went with the latter options since that felt a bit easier. I found this ruby gem. Unfortunately it’s installed as a gem with dependencies you might not have available and it only runs as a cli-tool which might not be ideal if you want to include this as a step in your CI/CD pipeline. I quickly hacked together a way to run this gem as a REST server instead inside a docker container, which eliminates bothersome dependencies and make’s it easier to include in your pipeline.

Confluence Markdown Code

Quick Tutorial

Import Markdown Into Confluence Chrome

  • Run the container by pulling the image from docker hub:
  • Test the conversion (example script in ruby)
Confluence

Asciicast Demo

Import Markdown Into Confluence Tutorial

Complete Example

If you want to check out the complete source code you can take a look at this repo and follow the README.