项目作者: hukkin

项目描述 :
Mdformat plugin to beautify Bash scripts
高级语言: Python
项目地址: git://github.com/hukkin/mdformat-beautysh.git
创建时间: 2020-09-21T00:40:17Z
项目社区:https://github.com/hukkin/mdformat-beautysh

开源协议:MIT License

下载


Build Status
PyPI version

mdformat-beautysh

Mdformat plugin to beautify Bash scripts

Description

mdformat-beautysh is an mdformat plugin
that makes mdformat format Bash scripts with Beautysh.

Usage

Install with:

  1. 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:

  1. import mdformat
  2. unformatted = """```bash
  3. function bad_func()
  4. {
  5. echo "test"
  6. }
  7. ```
  8. """
  9. formatted = mdformat.text(unformatted, codeformatters={"bash", "sh"})
  10. assert formatted == """```bash
  11. function bad_func()
  12. {
  13. echo "test"
  14. }
  15. ```
  16. """