It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Import markdown into Confluence

Jason Haines Jan 31, 2017

According to the Confluence documentation on http://Importing Content Into Confluence, there is no supported way of importing markdown. Is this the case?

3rd party solutions seem not to work with current, self-hosted versions.

6 answers

4 votes
Tom Corcoran Nov 08, 2018 • edited Feb 11, 2019

There are a number of ways.

A. To insert markdown in the editor:

  1. Choose Insert > Markup 
  2. Select Markdown
  3. Type or paste your text - the preview will show you how it will appear on your page
  4. Choose Insert.

B. Use the Mardown macro which renders Markdown from a URL 

C. Use HTML Macro

  1. Use pandoc to convert your markdown file to html
    • e.g.  pandoc myfile.md -f markdown -s -o myfile.html
  2. On your confluence page insert a HTML macro which allows the use of HTML code within a Confluence page.
    • Note that HTML macros are disabled by default.
Rick Mann I'm New Here Mar 21, 2019 • edited

This doesn't work at all for me. It just pastes my text as regular body text in the page, and removes a lot of whitespace. We're using Confluence hosted by Atlassian.

Like Alexis Tremblay likes this
Alexis Tremblay May 08, 2019

Me too. The preview is fine, but then it's just a big block of regular text.

scwebster Wednesday

I get the same.  Preview looks good, but text on actual page not rendered correctly. Example:  inserted markdown has a '# HeadingExample'.  Preview looks great.  On the page, this is rendered as plain text 'h1. HeadingExample'.

2 votes
Ron Lusk Jul 17, 2018

Using pandoc, I just converted a page of Markdown (exported from the Notion app) into org-mode (an Emacs organizer/markup/task-management/everything "app"), and then used an export module to export that page to JIRA (Confluence) format. I could then paste that into a comment.

I wouldn't recommend it as a regular thing, but it did the job in this case, and I'm fairly fluent in all three markup languages, so I could fix something if it broke along the way.

1 vote
JORDAN STEWART Nov 07, 2018

I actually just copied, and pasted the rendered Markdown. Seems to work alright. The marcos were not working for me.

0 votes
Rob Woodgate Jan 31, 2017

Hi Jason,

These are the markdown add-ons that support server installations.  Of these, the only one that appears to do something close to an import is Marked, which is free and has very good reviews.  It allows you to point to a markdown file and show it in a Confluence page.

If this is a one time transfer of .md files, you might want to consider spinning up a free trial version of Confluence Cloud, installing the trial version of one of the Cloud markdown import add-ons (e.g. Confluence Pandoc), performing the import and then exporting the space and importing it into your server instance. (I've never tried this, so I don't know if it's possible, but it's worth exploring if you've got a large amount to import.)

 

0 votes

If you you have intermediate familiarity with Python, you may be able to create a simple utility that takes as input a MarkDown file, and creates a Confluence page (as a child of an existing ancestor) that is consistently styled. The utility will use Confluence Remote API, Python Requests, and Python Markdown.

Here are some resources for you:

Python Requests: http://docs.python-requests.org/en/master/

Python Markdown: http://pythonhosted.org/Markdown/

Confluence Server REST API: https://developer.atlassian.com/confdev/confluence-server-rest-api

Page Information: https://confluence.atlassian.com/conf510/view-page-information-829077461.html

The Page Information link is there because the Confluence Server REST API uses Page IDs, and you can use the Page Information menu item to obtain the Page ID of the Confluence page you're viewing.

0 votes
Miles Maddox I'm New Here Tuesday • edited

This solution may not work for everyone, but I wrote a tool to do just this. It takes a markdown file and uploads it to confluence. I use it to sync my notes daily. It's not perfect, but it works: https://github.com/justmiles/go-markdown2confluence

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

866 views 0 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you