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
- Host: GitHub
- URL: https://github.com/hukkin/mdformat-beautysh
- Owner: hukkin
- License: mit
- Created: 2020-09-21T00:40:17.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-10-31T21:12:35.000Z (8 months ago)
- Last Synced: 2025-10-31T23:21:06.417Z (8 months ago)
- Topics: bash, beautysh, commonmark, markdown, mdformat, python
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[]()
[]()
# 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"
}
```
"""
````