Skip to main content

Markdown formatter with configurable line length

Project description

formdt

Markdown formatter with configurable line length.

Installation

uv add formdt

Usage

CLI

# Print formatted output to stdout
formdt README.md

# Write changes back to file
formdt README.md --write

# Override line length
formdt README.md --line-length 120

Library

from formdt import format_markdown, Config

text = "This is a very long line that needs to be wrapped."
config = Config(line_length=40)

formatted = format_markdown(text, config)

Configuration

Create a .formdt file in your project root:

{
    "line_length": 80
}

Rules

  • Line wrapping: Lines are wrapped at the configured length (default: 80)
  • Single line breaks: Joined within paragraphs (markdown treats them as spaces)
  • Double line breaks: Preserved as paragraph separators

Development

# Install dependencies
uv sync

# Run tests
uv run pytest

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

formdt-0.2.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

formdt-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file formdt-0.2.0.tar.gz.

File metadata

  • Download URL: formdt-0.2.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for formdt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 11a26ab7d2250df34deae1dfc58feb04dd5b5e107d7ffe2948a0a25c525fb6b5
MD5 904c03bbf996588537eb68acefb945b3
BLAKE2b-256 0c16fe941c9e31908f3fef8c861cd4dc0f9377f816143371d773564bf57efa1d

See more details on using hashes here.

File details

Details for the file formdt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: formdt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for formdt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c82d86c625cacc8d26d4e23dc545f23b9dfc7f54354a3cadf0734131dd6c7d7e
MD5 6e1b1ae9254a0d0344e27256e5f38ee2
BLAKE2b-256 456acd49cfbd234f146577691e53e58d5dea1611764ba1b2e8bdda6904058e20

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