Skip to content

quiqueporta/adf2md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adf2md

Tests Lua License: MIT

A Lua library to convert Atlassian Document Format (ADF) to Markdown.

Installation

Using LuaRocks

luarocks install adf2md

Manual

Copy src/adf2md.lua to your project or add the src directory to your Lua path.

Usage

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

Supported Node Types

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 ![](url)
mention @username
emoji :shortName:
status Colored emoji + text (e.g., 🟢 DONE)
inlineCard [ISSUE-123](url) (extracts Jira key)
hardBreak Two spaces + newline

Supported Marks

Mark Markdown Output
strong **text**
em *text*
link [text](url)
code `text`
strike ~~text~~

Unsupported Types

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.

Development

Requirements

  • Lua 5.1+
  • Busted (testing framework)

Install dependencies

luarocks install busted

Run tests

busted

License

MIT License - see LICENSE file.

About

Atlassian Document Format to Markdown converter in lua

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages