A Lua library to convert Atlassian Document Format (ADF) to Markdown.
luarocks install adf2mdCopy src/adf2md.lua to your project or add the src directory to your Lua path.
local adf2md = require("adf2md")
local adf_document = {
type = "paragraph",
content = {
{ type = "text", text = "Hello ", marks = {{ type = "strong" }} },
{ type = "text", text = "World" }
}
}
local markdown = adf2md(adf_document)
print(markdown) -- Output: **Hello **World| ADF Node | Markdown Output |
|---|---|
| paragraph | Plain text |
| heading | # to ###### (levels 1-6) |
| bulletList | + item |
| orderedList | 1. item |
| taskList | - [ ] task / - [x] task |
| codeBlock | ```language\ncode\n``` |
| blockquote | > text |
| panel | > [!NOTE], > [!WARNING], etc. (GFM) |
| table | GFM table with | and --- |
| rule | --- |
| mediaSingle |  |
| mention | @username |
| emoji | :shortName: |
| status | Colored emoji + text (e.g., 🟢 DONE) |
| inlineCard | [ISSUE-123](url) (extracts Jira key) |
| hardBreak | Two spaces + newline |
| Mark | Markdown Output |
|---|---|
| strong | **text** |
| em | *text* |
| link | [text](url) |
| code | `text` |
| strike | ~~text~~ |
When the library encounters an unsupported node type, it outputs a marker:
[unsupported: nodeType]
This makes it easy to identify which ADF features are not yet converted.
- Lua 5.1+
- Busted (testing framework)
luarocks install bustedbustedMIT License - see LICENSE file.