md2adf

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 9 Imported by: 0

README

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
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
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

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