mdformat-ruff-0.1.3
توضیحات
Mdformat plugin to ruffen Python code blocks
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | mdformat-ruff-0.1.3 |
| نام | mdformat-ruff |
| نسخه کتابخانه | 0.1.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Wu Zhenyu |
| ایمیل نویسنده | wuzhenyu@ustc.edu |
| آدرس صفحه اصلی | https://github.com/Freed-Wu/mdformat-ruff |
| آدرس اینترنتی | https://pypi.org/project/mdformat-ruff/ |
| مجوز | MIT |
# mdformat-ruff
[](https://results.pre-commit.ci/latest/github/Freed-Wu/mdformat-ruff/main)
[](https://github.com/Freed-Wu/mdformat-ruff/actions)
[](https://github.com/Freed-Wu/mdformat-ruff/releases)
[](https://github.com/Freed-Wu/mdformat-ruff/releases/latest)
[](https://github.com/Freed-Wu/mdformat-ruff/issues)
[](https://github.com/Freed-Wu/mdformat-ruff/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/Freed-Wu/mdformat-ruff/pulls)
[](https://github.com/Freed-Wu/mdformat-ruff/pulls?q=is%3Apr+is%3Aclosed)
[](https://github.com/Freed-Wu/mdformat-ruff/discussions)
[](https://github.com/Freed-Wu/mdformat-ruff/milestones)
[](https://github.com/Freed-Wu/mdformat-ruff/network/members)
[](https://github.com/Freed-Wu/mdformat-ruff/stargazers)
[](https://github.com/Freed-Wu/mdformat-ruff/watchers)
[](https://github.com/Freed-Wu/mdformat-ruff/graphs/contributors)
[](https://github.com/Freed-Wu/mdformat-ruff/graphs/commit-activity)
[](https://github.com/Freed-Wu/mdformat-ruff/commits)
[](https://github.com/Freed-Wu/mdformat-ruff/releases/latest)
[](https://github.com/Freed-Wu/mdformat-ruff/blob/main/LICENSE)
[](https://github.com/Freed-Wu/mdformat-ruff)
[](https://github.com/Freed-Wu/mdformat-ruff)
[](https://github.com/Freed-Wu/mdformat-ruff)
[](https://github.com/Freed-Wu/mdformat-ruff)
[](https://github.com/Freed-Wu/mdformat-ruff)
[](https://github.com/Freed-Wu/mdformat-ruff)
[](https://pypi.org/project/mdformat-ruff/#description)
[](https://pypi.org/project/mdformat-ruff/#history)
[](https://pypi.org/project/mdformat-ruff/#files)
[](https://pypi.org/project/mdformat-ruff/#files)
[](https://pypi.org/project/mdformat-ruff/#files)
[](https://pypi.org/project/mdformat-ruff/#files)
> Mdformat plugin to ruffen Python code blocks
## Description
mdformat-ruff is an [mdformat](https://github.com/executablebooks/mdformat) plugin
that makes mdformat format Python code blocks with [ruff](https://github.com/psf/ruff).
## Usage
Install with:
```bash
pip install mdformat-ruff
```
You may pin ruff dependency for formatting stability:
```bash
pip install mdformat-ruff ruff==22.1.0
```
When using mdformat on the command line, ruff formatting will be automatically
enabled after install.
When using mdformat Python API, code formatting for Python will have to be
enabled explicitly:
````python
import mdformat
unformatted = "```python\n'''ruff converts quotes'''\n```\n"
formatted = mdformat.text(unformatted, codeformatters={"python"})
assert formatted == '```python\n"""ruff converts quotes"""\n```\n'
````
## Usage as a [pre-commit](https://pre-commit.com) hook
Add the following to your `.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.13 # Use the ref you want to point at
hooks:
- id: mdformat
additional_dependencies:
- mdformat-ruff
- ruff==22.1.0 # Pinning ruff here is optional
```
نیازمندی
| مقدار | نام |
|---|---|
| - | ruff |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl mdformat-ruff-0.1.3:
pip install mdformat-ruff-0.1.3.whl
نصب پکیج tar.gz mdformat-ruff-0.1.3:
pip install mdformat-ruff-0.1.3.tar.gz