md2adf
A command-line tool to convert Markdown to Atlassian Document Format (ADF) JSON.
Uses the goldmark-adf library.
Requirements
- Go 1.25+
GOEXPERIMENT=jsonv2 environment variable
Installation
GOEXPERIMENT=jsonv2 go install github.com/ajbeck/md2adf@latest
Usage
md2adf [flags]
Flags:
-h, --help Show help
-v, --version Show version
-s, --source=STRING Markdown content as a string
-f, --source-path=FILE Path to markdown file to read
-o, --output=FILE Output file path (default: stdout)
--gfm Enable GFM extensions (tables, strikethrough, etc.)
--indent=" " Indentation for JSON output
- If
--source is provided, use that string directly
- If
--source-path is provided, read from that file
- Otherwise, read from stdin
Examples
# From stdin
echo "# Hello" | md2adf
# From string
md2adf --source "# Hello World"
# From file
md2adf --source-path README.md
# To file
md2adf --source-path README.md --output output.json
# With GFM extensions (tables, strikethrough, etc.)
md2adf --gfm --source-path table.md
# Piping
cat document.md | md2adf --gfm > output.json
Building
# Build
GOEXPERIMENT=jsonv2 go build -o md2adf .
# With version
GOEXPERIMENT=jsonv2 go build -ldflags "-X main.version=1.0.0" -o md2adf .
License
MIT