A handy Ruby script to take a markdown file, convert it, and upload it to Confluence.
Switch branches/tags
Nothing to show
Clone or download
lanyonm Merge pull request #1 from alexharv074/add_support_for_ruby_2.0.0
Add support for newer versions of Ruby
Latest commit 8b1c14c Apr 26, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Gemfile Add support for Ruby 2.0.0 Apr 12, 2017
LICENSE initial commit Aug 15, 2014
README.md initial commit Aug 15, 2014
md2confl.rb more sensical upload comments Aug 16, 2014

README.md

markdown-to-confluence-uploader

A simple Ruby script to automate the conversion of Markdown files to Confluence storage format and then upload them to a Confluence server. It uses markdown2confluence to get the markdown to Confluence wiki format and then the confluence-soap to convert wiki format to storage format and then upload to Confluence.

Running

$ ./md2confl.rb -s <SPACE_NAME> -i <PAGE_ID>

A full list of options can be found by running md2confl.rb --help:

Usage: md2confl.rb [options...] -s <SPACE_NAME> -i <PAGE_ID>
assumes defaults that can be set in options parsing...
    -i, --pageId PAGE_ID             REQUIRED. The Confluence page id to upload the converted markdown to.
    -s, --space SPACE_NAME           REQUIRED. The Confluence space name in which the page resides.
    -f, --markdownFile FILE          Path to the Markdown file to convert and upload. Defaults to 'README.md'
    -c, --server CONFLUENCE_SERVER   The Confluence server to upload to. Defaults to 'http://confluence.example.com'
    -u, --user USER                  The Confluence user. Can also be specified by the 'CONFLUENCE_USER' environment variable.
    -p, --password PASSWORD          The Confluence user's password. Can also be specified by the 'CONFLUENCE_PASSWORD' environment variable.
    -v, --verbose                    Output more information
    -h, --help                       Display this screen

Installation

This assumes you have a functioning version of Ruby that's at least 1.9.3 (I tested with 2.1.1) and have Bundler installed.

bundle install