Sync your markdown files to confluence.
- upload new versions only when necessary
- upload/delete local images as attachments
- convert PlantUML code fence to Confluence PlantUML macro
\```plantuml @startuml a --> b @enduml \```
npm install -g cosmere
# or
yarn global add cosmere
npm install --save-dev cosmere
# or
yarn add --dev cosmere
To get started generate configuration using
cosmere 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"
}
]
}
In most scenarios it is not recommended to store your credentials in the configuration file, because you will probably add it to your VCS. Instead it is recommended to provide the following environment variables in your build pipeline (GitLab CI, GitHub Actions, Jenkins, ...):
CONFLUENCE_USERNAME=YOUR_USERNAME
CONFLUENCE_PASSWORD=YOUR_PASSWORD
or add it in front of the command when executing locally (add a space in front of the command when using bash in order to not write the credentials to the bash history):
CONFLUENCE_USER=YOUR_USERNAME CONFLUENCE_PASSWORD=YOUR_PASSWORD cosmere
# global installation
cosmere --help
# local installation with yarn
yarn cosmere --hhelp
# local installation with npm
npm run cosmere --help
# or plain
node_modules/.bin/cosmere --help
or create an alias:
{
"scripts": {
"pushdoc": "cosmere"
}
}
Prepend NODE_TLS_REJECT_UNAUTHORIZED=0
to your cosmere
call in order to not reject invalid certificates. This is risky and it's preferable to get proper certificates.
Please, feel free to create any issues and pull request that you need.
- Add feature/fix bugs etc.
- Document changes in
CHANGELOG.md
(with the new version) - Commit everything
- Push/merge to main
- Run
yarn release yarn np <major|minor|patch>
I had various scripts that stitched markdown files together and uploaded them. I forked md2confluence
by Jormar Arellano and started playing around with that, but quickly noticed that many markdown files broke due to the conversion process (wiki -> storage instead of directly to storage).
The project diverged from its original intent and so I decided to rename it. Cosmere is the wonderful universe of various books written by Brandon Sanderson. If you are into fantasy I strongly recommend checking him out.
See LICENSE.