md2adf

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 11 Imported by: 0

README

md2adf

A command-line tool to convert Markdown to Atlassian Document Format (ADF) JSON.

Uses the goldmark-adf library.

Quick Start

brew tap ajbeck/tap
brew install md2adf

Updates are available via:

brew update
brew upgrade md2adf
Install from Source

Requires Go 1.25+ with the experimental json/v2 package:

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 (default: true)
      --no-gfm                Disable GFM extensions
      --external-media        Render images as external media instead of links
      --image-layout=STRING   Layout for media images (default: center)
                              Options: center, wide, full-width, wrap-left,
                                       wrap-right, align-start, align-end
      --indent="  "           Indentation for JSON output
Input Priority
  1. If --source is provided, use that string directly
  2. If --source-path is provided, read from that file
  3. Otherwise, read from stdin

Examples

# From stdin (GFM enabled by default)
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

# Disable GFM extensions
md2adf --no-gfm --source-path document.md

# Render images as external media (displays in Jira/Confluence)
md2adf --external-media --source "![alt](https://example.com/image.png)"

# External media with custom layout
md2adf --external-media --image-layout=wide --source-path doc.md

# Piping
cat document.md | md2adf > 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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL