• Stars
    star
    253
  • Rank 160,324 (Top 4 %)
  • Language
    Go
  • License
    Mozilla Public Li...
  • Created over 6 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Push markdown files to Confluence Cloud

markdown2confluence

Push markdown files to Confluence Cloud

Build Status

Installation

Download the latest release and add the binary in your local PATH

  • Linux

    curl -LO https://github.com/justmiles/go-markdown2confluence/releases/download/v3.4.6/go-markdown2confluence_3.4.6_linux_x86_64.tar.gz
    
    sudo tar -xzvf go-markdown2confluence_3.4.6_linux_x86_64.tar.gz -C /usr/local/bin/ markdown2confluence
  • OSX

    curl -LO https://github.com/justmiles/go-markdown2confluence/releases/download/v3.4.6/go-markdown2confluence_3.4.6_darwin_x86_64.tar.gz
    
    sudo tar -xzvf go-markdown2confluence_3.4.6_darwin_x86_64.tar.gz -C /usr/local/bin/ markdown2confluence
  • Windows

    Download the latest release and add to your system PATH

Use with Docker

docker run justmiles/markdown2confluence --version

Build using docker

docker run -v $PWD:/src -w /src goreleaser/goreleaser --snapshot --skip-publish --rm-dist

Environment Variables

For best practice we recommend you authenticate using an API token.

However, you may also use Personal Access Tokens, which may help if your company uses SSO.

  • CONFLUENCE_USERNAME - username for Confluence Cloud. When using API tokens set this to your full email.
  • CONFLUENCE_PASSWORD - API token or password for Confluence Cloud
  • CONFLUENCE_ENDPOINT - endpoint for Confluence Cloud, eg https://mycompanyname.atlassian.net/wiki
  • CONFLUENCE_ACCESS_TOKEN - Bearer access token to use (instead of API token)

Usage

Push markdown files to Confluence Cloud

Usage:
  markdown2confluence [flags]

Flags:
  -a, --access-token string   Confluence access-token. (Alternatively set CONFLUENCE_ACCESS_TOKEN environment variable)
  -c, --comment string        (Optional) Add comment to page
  -d, --debug                 Enable debug logging
  -e, --endpoint string       Confluence endpoint. (Alternatively set CONFLUENCE_ENDPOINT environment variable) (default "https://mydomain.atlassian.net/wiki")
  -x, --exclude strings       list of exclude file patterns (regex) for that will be applied on markdown file paths
  -w, --hardwraps             Render newlines as <br />
  -h, --help                  help for markdown2confluence
  -i, --insecuretls           Skip certificate validation. (e.g. for self-signed certificates)
  -m, --modified-since int    Only upload files that have modifed in the past n minutes
      --parent string         Optional parent page to next content under
  -p, --password string       Confluence password. (Alternatively set CONFLUENCE_PASSWORD environment variable)
  -s, --space string          Space in which page should be created
  -t, --title string          Set the page title on upload (defaults to filename without extension)
      --use-document-title    Will use the Markdown document title (# Title) if available
  -u, --username string       Confluence username. (Alternatively set CONFLUENCE_USERNAME environment variable)
      --version               version for markdown2confluence

Examples

Upload a local directory of markdown files called markdown-files to Confluence.

markdown2confluence \
  --space 'MyTeamSpace' \
  markdown-files

Upload the same directory, but only those modified in the last 30 minutes. This is particurlarly useful for cron jobs/recurring one-way syncs.

markdown2confluence \
  --space 'MyTeamSpace' \
  --modified-since 30 \
  markdown-files

Upload a single file

markdown2confluence \
  --space 'MyTeamSpace' \
  markdown-files/test.md

Upload a directory of markdown files in space MyTeamSpace under the parent page API Docs

markdown2confluence \
  --space 'MyTeamSpace' \
  --parent 'API Docs' \
  markdown-files

Upload a directory of markdown files in space MyTeamSpace under a nested parent page Docs/API and exclude mardown files/directories that match .*generated.* or .*temp.md

markdown2confluence \
  --space 'MyTeamSpace' \
  --parent 'API/Docs' \
  --exclude '.*generated.*' \
  --exclude '.*temp.md' \
   markdown-files

Upload a directory of markdown files in space MyTeamSpace under the parent page API Docs and use the markdown document-title instead of the filname as document title (if available) in Confluence.

markdown2confluence \
  --space 'MyTeamSpace' \
  --parent 'API Docs' \
  --use-document-title \
   markdown-files

Enhancements

It is possible to insert Confluence macros using fenced code blocks. The "language" for this is CONFLUENCE-MACRO, exactly like that in all-caps. Here is an example for a ToC macro using all headlines starting at Level 2:

    # Title

    ```CONFLUENCE-MACRO
    name:toc
    schema-version:1
      minLevel:2
    ```

    ## Section 1

In general almost all macros should be possible. The general syntax is:

    ```CONFLUENCE-MACRO
    name:Name of Macro
    schema-version:Schema Version (use `1`)
      attribute:Value of Attribute
      parameter-name:Value of Parameter
      next-parameter:Value of Parameter
    ```

So a fully fledged macro could look like:

    ```CONFLUENCE-MACRO
    name:toc
    schema-version:1
      maxLevel:5
      minLevel:2
      exclude:Beispiel.*
      style:none
      type:flat
      separator:pipe
    ```

Which will translate to:

<ac:structured-macro ac:name="toc" ac:schema-version="1" >
  <ac:parameter ac:name="maxLevel">5</ac:parameter>
  <ac:parameter ac:name="minLevel">2</ac:parameter>
  <ac:parameter ac:name="exclude">Beispiel.*</ac:parameter>
  <ac:parameter ac:name="style">none</ac:parameter>
  <ac:parameter ac:name="type">flat</ac:parameter>
  <ac:parameter ac:name="separator">pipe</ac:parameter>
</ac:structured-macro>

More Repositories

1

traefik-cloudflare-tunnel

Go
51
star
2

hubot-shell

Execute shell commands with your hubot.
CoffeeScript
13
star
3

justnotes

its just notes. pay no attention to me
Go
12
star
4

node-atlassian-confluence

Node.js library to interact with Atlassian Confluence
CoffeeScript
11
star
5

cq-source-crowdstrike

A crowdstrike source plugin for CloudQuery Falcon that loads data from crowdstrike to any database, data warehouse or data lake supported by CloudQuery
Go
8
star
6

standup-bot

Slack bot for Asynchronous Standups
Go
7
star
7

dev-sandbox

Dockerfile
7
star
8

ssm-parameter-store

A CLI to pull, diff, and push SSM Parameter Store to and from disk
Go
6
star
9

aws-policy-optimizer

analyze AWS CloudTrail Access Logs and generate least-privilege IAM policies based on utilization
Go
6
star
10

ecs-cli

run ad-hoc containers on AWS ECS
Go
5
star
11

go-get-ssm-params

Grab values out of the AWS SSM Parameter Store
Go
5
star
12

jumpcloud-cli

A quick and dirty CLI to interact with JumpCloud
Go
4
star
13

bootstrapping-winblows

Nix
4
star
14

go-confluence

A Go client library for accessing Confluence Cloud REST API
Go
4
star
15

ec2-run-command

Run adhoc workloads using EC2 and destroy them upon completion
Go
3
star
16

hubot-firebase-brain

A hubot script to persist hubot's brain using firebase
CoffeeScript
3
star
17

dotfiles

Shell
3
star
18

glue-deploy

An opinionated deployment process for AWS Glue
Go
2
star
19

confluence-cli

Push markdown files to Confluence
JavaScript
2
star
20

bender

Shell
2
star
21

athena-cli

Run SQL statements against Amazon Athena and return results to stdout
Go
2
star
22

node-qbittorrent-client

Node.js client for qBittorrent
CoffeeScript
2
star
23

ecs-deploy

Go
2
star
24

ssm-run-command

Execute commands on EC2 using the SSM RunCommand API
Go
2
star
25

kasa-cli

An unoffical tool to communicate with the remote Kasa API and control your smart devices
Go
1
star
26

hole-punch

Quickly launch a reverse SSH connection
Go
1
star
27

docker-necesse-dedicated-server

docker image for Necesse dedicated server
Dockerfile
1
star
28

os-scribe

Go
1
star
29

tinyproxy-container-image

This project containerizes Tinyproxy, adding basic HTTP health check support, Prometheus `/metrics` endpoint, and configuration via environment variables.
Shell
1
star
30

the-forest

Docker image for The Forest dedicated server
Dockerfile
1
star
31

lambda-pagerduty-kasa

Go
1
star
32

route53_subnet_seeder

CoffeeScript
1
star
33

restic-backup-explorer

Dockerfile
1
star
34

slacker-incoming-webhook-python

Python
1
star
35

slack-webcam

Turn your Slack avatar into an IP camera
Go
1
star
36

cwm

CloudWatch Manager - enable and disable alarms
CoffeeScript
1
star
37

docker-atom-http

Docker service to share atom over http. Useful for demos or syncing up with co-workers.
Shell
1
star
38

epd

Go
1
star
39

ya-bitbucket

Yet another Node.js client library to interact with Atlassian Bitbucket. Designed to support the latest APIs bitbucket offers.
CoffeeScript
1
star
40

emr-idle-check

Send EMR activity metrics to CloudWatch
Go
1
star
41

ssm-document-generator

Go
1
star
42

node-atlassian-jira

Node.js client library to interact with Atlassian Jira
CoffeeScript
1
star
43

docker-shell-sandbox

Dockerfile
1
star
44

grok-cli

Go
1
star
45

pass-to-bitwarden

Go
1
star
46

jira-thingy

CoffeeScript
1
star