Markdown Importer for Confluence
- Markdown Importer for Confluence
- Privacy Policy
- Terms of Service
- Refund Policy
- Support
- Markdown Importer for Confluence documentation
Imports a Markdown folder, MkDocs site, Obsidian vault or GitHub wiki into Confluence Cloud as a page tree.
Runs from three places:
- Confluence app (Forge): "Import Markdown here" in a page's ••• menu. Pick a folder or a .zip, check the preview, then import. Admin settings live under Apps → Markdown Importer.
- CLI:
confluence-md-importruns bulk imports with your own API token. - GitHub Action: keeps a
docs/folder in sync on every push.
What it converts
| Source | Confluence |
|---|---|
Folders; index.md / README.md / _index.md / Folder/Folder.md | Page tree. The index file becomes the folder's page; a folder with no index file gets a page that lists its children |
MkDocs mkdocs.yml nav and docs_dir | Page order, nav titles and sections. Files not in the nav go to the top level, with a warning |
| Title | nav title, then front matter title, then the first # H1 (removed from the body), then the file name (02-getting-started.md → "Getting started") |
Front matter tags / labels | Labels |
| Other front matter keys | Page Properties table (so the Page Properties Report macro can list them) |
Relative links ../a/b.md#anchor; links to folders | Page links with anchors |
Obsidian [[Note]], [[Note|text]], [[Note#Heading]], ![[image.png|300]], ![[Note]], %%comments%%, #tags | Page links, sized images, Include Page macro, removed, labels |
GitHub wiki [[Text|Page-Name]], Home.md, _Sidebar.md | Page links; Home is the top page; sidebar and footer are skipped |
| Images and linked files (pdf, zip, …) | Attachments on the page; remote image URLs stay remote |
| Fenced code | Code macro with its language. Mermaid is kept as code titled "mermaid" |
Tables, nested lists, - [ ] task lists | Tables, lists, Confluence tasks |
MkDocs !!! note / ??? tip, GitHub > [!WARNING], Obsidian > [!tip]- callouts | Info / tip / note / warning macros; collapsible ones go inside an Expand macro |
| Raw HTML | <img>, <br>, <b>, <sub>, <kbd> and similar map to Confluence; other tags are removed and their text kept, with a warning |
Reliability
- Re-runnable: each page stores an import record (a content property naming the import and the source file). Running the same import again matches pages by that record. Unchanged pages cost no writes, changed ones are updated in place, and renamed titles rename the same page. Nothing is duplicated.
- Continues past errors: a file that fails is reported with its cause and the rest still import. Children of a failed page go under the nearest imported ancestor until a re-run fixes it.
- Resumable: after a cancel, crash or network drop, run it again and it picks up where it stopped. Where Confluence's v1 create endpoint is available, a new page and its import record are written in a single request.
- Safe: it never overwrites a page it did not create. If a title is taken, it adds a suffix, or skips the file if you choose that. It never overwrites a page someone edited in Confluence since the last import, unless you pass
--overwrite-edited. It never deletes: files removed from the source are listed in the report. - Per-file report: in the app, a table plus JSON; from the CLI,
--report(JSON) and--summary(Markdown, also written to the GitHub job summary).
CLI and GitHub Action
export CONFLUENCE_SITE=https://your-team.atlassian.net
export CONFLUENCE_EMAIL=you@example.com
export CONFLUENCE_API_TOKEN=... # classic or scoped; never on the command line
node cli/index.js plan docs # preview, no network (npm package not published yet)
node cli/index.js import docs --space DOCS [--parent 123456] [--dry-run] [--report report.json]
Scoped tokens only work through api.atlassian.com/ex/confluence/<cloudId>. The CLI detects that case and switches automatically. Scopes it needs: read:page:confluence, write:page:confluence, read:space:confluence, read:space.property:confluence, write:attachment:confluence, write:label:confluence. When Confluence asks it to slow down (HTTP 429), it waits for Retry-After.
- uses: actions/checkout@v4
- uses: MarcBittner/confluence-md-importer@v1
with:
path: docs # the folder with mkdocs.yml, for MkDocs
space: DOCS
site: https://your-team.atlassian.net
email: ${{ secrets.CONFLUENCE_EMAIL }}
api-token: ${{ secrets.CONFLUENCE_API_TOKEN }}
Free: up to 50 Markdown files per run. With a subscription, an admin turns on sync for a space under Apps → Markdown Importer. That stores a signed key in the space, the CLI and Action read it, and the limit is removed.
Exit codes: 0 everything imported · 1 some files need attention (see the report) · 2 nothing imported (setup or auth problem).
Help
See Support or email support@tanglement.ai.