Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/g-plane/pretty_yaml
Semi-tolerant and configurable YAML formatter with dprint integration.
https://github.com/g-plane/pretty_yaml
dprint dprint-plugin formatter formatting prettier yaml
Last synced: 7 days ago
JSON representation
Semi-tolerant and configurable YAML formatter with dprint integration.
- Host: GitHub
- URL: https://github.com/g-plane/pretty_yaml
- Owner: g-plane
- License: mit
- Created: 2024-06-02T15:28:25.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-29T02:44:20.000Z (2 months ago)
- Last Synced: 2025-01-23T12:06:54.109Z (17 days ago)
- Topics: dprint, dprint-plugin, formatter, formatting, prettier, yaml
- Language: Rust
- Homepage: https://dprint.dev/plugins/pretty_yaml/
- Size: 581 KB
- Stars: 24
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Pretty YAML
Pretty YAML is a semi-tolerant and configurable YAML formatter.
![GitHub Downloads](https://img.shields.io/github/downloads/g-plane/pretty_yaml/latest/plugin.wasm?style=flat-square)
## Getting Started
### dprint
We've provided [dprint](https://dprint.dev/) integration.
Run the command below to add plugin:
```shell
dprint config add g-plane/pretty_yaml
```After adding the dprint plugin, update your `dprint.json` and add configuration:
```jsonc
{
// ...
"yaml": { // <-- the key name here is "yaml", not "pretty_yaml"
// Pretty YAML config comes here
},
"plugins": [
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
]
}
```You can also read [dprint CLI documentation](https://dprint.dev/cli/) for using dprint to format files.
## Configuration
Please refer to [Configuration](https://pretty-yaml.netlify.app/).
## Using in Rust
### Formatter
The formatter can be used in Rust. Please read the [documentation](https://docs.rs/pretty_yaml).
### Parser
If you want to use the underlying parser, please refer to the [documentation](https://docs.rs/yaml_parser).
## Credit
Tests come from [Prettier](https://github.com/prettier/prettier/tree/main/tests/format/yaml).
## License
MIT License
Copyright (c) 2024-present Pig Fang