Skip to main content

Fix ragged right edges in LLM-generated ASCII/Unicode box diagrams

Project description

raggedy

Fix ragged right edges in LLM-generated ASCII/Unicode box diagrams.

LLMs consistently generate ASCII box diagrams with inconsistent right borders — missing corners, short rules, content lines without closing borders. raggedy autodetects these diagrams inside markdown fenced code blocks and fixes them.

Install & Run

# Run directly with uvx (no install needed)
uvx raggedy file.md

# Or install with pip/uv
pip install raggedy
raggedy file.md

Usage

raggedy [OPTIONS] FILE [FILE...]

Options:
  -b, --backup      Create .bak backup before editing
  --mdtable         Also fix markdown tables
  --check           Exit 1 if changes needed (no modification; for CI)
  --diff            Show diff without modifying
  -h, --help        Show help

What It Fixes

Given a markdown file containing:

```
┌──────────────────┐
│ Header           │
├──────────────────┤
│ Row 1
│ Row 2 is longer content
│ Short
└──────────────────┘
```

Running raggedy file.md produces:

```
┌────────────────────────┐
│ Header                 │
├────────────────────────┤
│ Row 1                  │
│ Row 2 is longer content│
│ Short                  │
└────────────────────────┘
```

Supports both Unicode (┌│├└) and ASCII (+|-) box-drawing styles.

CI Usage

Use --check in CI to enforce clean diagrams:

raggedy --check docs/**/*.md

Local Development

When running raggedy from the working tree via uvx, use --no-cache so the latest local code is rebuilt and executed:

uvx --from . --no-cache raggedy -b mantissa.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raggedy-0.1.1.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raggedy-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file raggedy-0.1.1.tar.gz.

File metadata

  • Download URL: raggedy-0.1.1.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for raggedy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4c0b3a1aa9f1bb187622ad381999734ba252a9c41c04f5977ac82c5602dfc2cc
MD5 c46cd6d356bdd9b5a41c24a736a2e536
BLAKE2b-256 3d87d774e0accb2f4b591dd448f91784bd3aa20e054f8c486fa2818a70cdb4e8

See more details on using hashes here.

File details

Details for the file raggedy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: raggedy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for raggedy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9872c49bb794c846ab2170315bf2969114afd506ca02c4eaf2e4f7e29c42b2c8
MD5 02fc6788ed5e7e42501223bfcc8748e2
BLAKE2b-256 71dee4261e41e7cd4c10b31ac4dc5ed6423a287ff3c39a843f11161af1b6f7be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page