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

https://github.com/hukkin/mdformat-beautysh

Mdformat plugin to beautify Bash scripts
https://github.com/hukkin/mdformat-beautysh

bash beautysh commonmark markdown mdformat python

Last synced: 3 months ago
JSON representation

Mdformat plugin to beautify Bash scripts

Awesome Lists containing this project

README

          

[![Build Status](https://github.com/hukkin/mdformat-beautysh/actions/workflows/tests.yml/badge.svg?branch=master)]()
[![PyPI version](https://badge.fury.io/py/mdformat-beautysh.svg)]()

# mdformat-beautysh

> Mdformat plugin to beautify Bash scripts

## Description

mdformat-beautysh is an [mdformat]() plugin
that makes mdformat format Bash scripts with [Beautysh]().
Fenced code blocks labeled as either `sh` or `bash` are formatted.

## Usage

Install with:

```bash
pip install mdformat-beautysh
```

When using mdformat on the command line, Beautysh formatting will be automatically enabled after install.

When using mdformat Python API, code formatting for Bash scripts will have to be enabled explicitly:

````python
import mdformat

unformatted = """```bash
function bad_func()
{
echo "test"
}
```
"""

formatted = mdformat.text(unformatted, codeformatters={"bash", "sh"})

assert formatted == """```bash
function bad_func()
{
echo "test"
}
```
"""
````