https://github.com/nallenscott/c2md
Export Confluence pages to Markdown using the Atlassian API + Pandoc.
https://github.com/nallenscott/c2md
atlassian bash confluence jq markdown pandoc
Last synced: 3 months ago
JSON representation
Export Confluence pages to Markdown using the Atlassian API + Pandoc.
- Host: GitHub
- URL: https://github.com/nallenscott/c2md
- Owner: nallenscott
- Created: 2025-06-23T16:44:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-23T17:16:10.000Z (about 1 year ago)
- Last Synced: 2025-07-02T05:04:26.533Z (about 1 year ago)
- Topics: atlassian, bash, confluence, jq, markdown, pandoc
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# c2md
**c2md** is a one-liner CLI tool for exporting Confluence pages to Markdown.
It fetches the raw XHTML using the Atlassian API and converts it to clean, portable Markdown using `pandoc`.
No cloning, no browser, no nonsense.
---
## ๐ Quick Start
```bash
bash <(curl -s https://raw.githubusercontent.com/nallenscott/c2md/main/convert.sh)
```
You'll be prompted for:
- Confluence **org name** (e.g. `acme`)
- Page ID
- Confluence email (username)
- API token (input is hidden)
---
## ๐ Requirements
- [`pandoc`](https://pandoc.org/installing.html)
- [`jq`](https://stedolan.github.io/jq/)
Install via Homebrew:
```bash
brew install pandoc jq
```
---
## ๐ฆ What It Does
- Hits the Confluence API
- Extracts the raw XHTML from `body.storage.value`
- Cleans it up
- Converts to Markdown using `pandoc`
- Saves output to `page.md`
---
## ๐งช Example
```bash
Confluence org: acme
Page ID: 1234567890
Output: ./page.md
```
---
## ๐โโ๏ธ Why
- Atlassian doesnโt support Markdown export natively
- This makes it dead simple to extract content without dealing with a browser
---
## โ ๏ธ Heads up
- Macros like Jira links, attachments, and embedded diagrams will show up as raw `` tags
- Attachments arenโt downloaded
- Some cleanup might still be needed for edge cases like nested formatting
For most text-heavy pages, it just works.
---
## ๐ License
MIT