An open API service indexing awesome lists of open source software.

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.

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