Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

markdown-to-confluence-converter

mihaeu88MITdeprecated0.10.0

Use cosmere instead: https://www.npmjs.com/package/cosmere

Update confluence pages from your markdown files (like a README.md)

confluence, content confluence, update page confluence, update confluence, readme to confluence, page confluence, markdown, markdown wiki

readme

markdown-to-confluence

Update confluence pages from your markdown files (like a README.md)

Usage

Install the package

You can safely install it as a global package:

npm install -g markdown-to-confluence-converter

This will allow you to use the command md2c anywhere.

But, it's intended to development environments and I recommend to install it as dev dependency:

npm install --save-dev markdown-to-confluence-converter

...and excecuting it as a npm script.

Create the markdown-to-confluence.json file

It's mandatory and can be generated using:

md2c generate-config [--config=<path>]

which produces:

{
  "baseUrl": "YOUR_BASE_URL",
  "user": "YOUR_USERNAME",
  "pass": "YOUR_PASSWORD",
  "cachePath": "build",
  "prefix": "This document is automatically generated. Please don't edit it directly!",
  "pages": [
    {
      "pageId": "1234567890",
      "file": "README.md",
      "title": "Optional title in the confluence page, remove to use # h1 from markdown file instead"
    }
  ]
}

Use Environmental Variables to store username and password

If you wish to not use the config file to store your username and password, you may also use your Environmental Variables to do so. The name of the environmental variables must be as below:

CONFLUENCE_USER=YOUR_USERNAME
CONFLUENCE_PASSWORD=YOUR_PASSWORD

# or

 CONFLUENCE_USER=YOUR_USERNAME CONFLUENCE_PASSWORD=YOUR_PASSWORD markdown-to-confluence

Excecute as a node app

You can use the command in the working directory (if it was installed globally):

md2c --help

Or execute it from your node_modules in your working directory (installed locally):

node_modules/.bin/md2c

Or you can add this like a npm script in your package.json (recommended if it was installed as devDependencies):

{
  ...
  "scripts": {
    "pushdoc": "md2c"
  },
  ...
}

Troubleshooting

Custom certificates on Confluence instance

Prepend NODE_TLS_REJECT_UNAUTHORIZED=0 to your md2c call in order to not reject invalid certificates. This is risky and it's preferable to get proper certificates.

Need new features?

Please, feel free to create any issues and pull request that you need.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.10.0 - 2019-12-18

Changed

  • pageTitle config item is now optional if a level one header is found in the corresponding document. If neither is available an error is thrown.

0.9.0 - 2019-12-07

Fixed

  • Convert to storage representation directly instead of view to upload strings without encoding
  • Always load markdown files relative to the config file

0.8.1 - 2019-12-03

Fixed

  • Attachment upload

0.8.0 - 2019-12-03

Added

  • This changelog file

Changed

  • Update remote version only if there's an actual change

Fixed

  • Attachment upload

0.7.0 - 2019-12-02

Changed

  • Add backward compatibility for node 8 (fs.mkdir)