An open API service indexing awesome lists of open source software.

https://github.com/brendanmaguire/mdformat-lists

An mdformat plugin for configuring how lists are rendered
https://github.com/brendanmaguire/mdformat-lists

markdown mdformat python

Last synced: 4 months ago
JSON representation

An mdformat plugin for configuring how lists are rendered

Awesome Lists containing this project

README

          

# mdformat-lists

[![Build Status](https://github.com/brendanmaguire/mdformat-lists/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/brendanmaguire/mdformat-lists/actions?query=workflow%3ACI+branch%3Amain+event%3Apush)
[![codecov](https://codecov.io/gh/brendanmaguire/mdformat-lists/branch/main/graph/badge.svg)](https://codecov.io/gh/brendanmaguire/mdformat-lists)
[![PyPI version](https://img.shields.io/pypi/v/mdformat-lists)](https://pypi.org/project/mdformat-lists)
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/mdformat-lists.svg)](https://pypi.python.org/pypi/mdformat-lists/)

A [mdformat](https://github.com/hukkin/mdformat) plugin to configure list markers for unordered and ordered lists.

By default, mdformat uses `-` as the bullet character (alternating with `*` for consecutive lists) and `.` as the ordered list marker. This plugin allows you to choose between `-`, `*`, and `+` for bullets, and `.` and `)` for ordered list markers.

## Usage

Install with:

```bash
pip install mdformat-lists
```

Then simply run mdformat as usual:

```bash
mdformat
```

### Configuration

#### Unordered list bullet

Configure the bullet character in `.mdformat.toml`:

```toml
[plugin.lists]
bullet = "*"
```

Or via the command line:

```bash
mdformat --bullet="*"
```

Valid values are `-` (default), `*`, and `+`.

#### Ordered list marker

Configure the ordered list marker in `.mdformat.toml`:

```toml
[plugin.lists]
ordered_marker = ")"
```

Or via the command line:

```bash
mdformat --ordered-marker=")"
```

Valid values are `.` (default) and `)`.

When multiple ordered lists appear consecutively, the plugin alternates between the primary and secondary marker (`.` and `)`) to prevent Markdown parsers from merging separate lists into one.