Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ts-graphviz/prettier-plugin-dot
✨ A prettier plugin for Graphviz Dot.
https://github.com/ts-graphviz/prettier-plugin-dot
formatter graphviz graphviz-dot-language hacktoberfest prettier prettier-plugin
Last synced: about 1 month ago
JSON representation
✨ A prettier plugin for Graphviz Dot.
- Host: GitHub
- URL: https://github.com/ts-graphviz/prettier-plugin-dot
- Owner: ts-graphviz
- License: mit
- Created: 2021-06-30T15:11:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T03:20:48.000Z (over 1 year ago)
- Last Synced: 2024-10-29T20:19:06.814Z (3 months ago)
- Topics: formatter, graphviz, graphviz-dot-language, hacktoberfest, prettier, prettier-plugin
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/prettier-plugin-dot
- Size: 432 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![NodeCI](https://github.com/ts-graphviz/prettier-plugin-dot/workflows/NodeCI/badge.svg)](https://github.com/ts-graphviz/prettier-plugin-dot/actions?workflow=NodeCI)
[![npm version](https://badge.fury.io/js/prettier-plugin-dot.svg)](https://badge.fury.io/js/prettier-plugin-dot)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg)](#contributors)# Prettier for Graphviz Dot
prettier-plugin-dot is a prettier plugin for Graphviz Dot.
Format your Dot using Prettier.
## How it works? 🤔
A Prettier plugin must first parse the source code of the target language into a traversable data structure (Usually an **A**bstract **S**yntax **T**ree)
and then print out that data structure in a "pretty" style.The Graphviz Dot AST generated by [ts-graphviz](https://github.com/ts-graphviz/ts-graphviz) implemented in JavaScript using the [peggy](https://github.com/peggyjs/peggy).
What this means is that unlike many other prettier plugins, prettier-plugin-dot has no additional runtime pre-requisites (e.g: Python executable). It could even be used inside a browser.## Getting started ✨
If you're using the npm or yarn CLI, then add the plugin by:
[![NPM](https://nodei.co/npm/prettier-plugin-dot.png)](https://nodei.co/npm/prettier-plugin-dot/)
```bash
# yarn
$ yarn add -D prettier prettier-plugin-dot
# or npm
$ npm install --save-dev prettier prettier-plugin-dot
```The prettier executable is now installed and ready for use:
```bash
$ yarn run prettier --write '**/*.dot'
# or
$ npx prettier --write '**/*.dot'
```## Example 📑
### Input ⬅️
```dot
digraph G {Hello->World}
```### Output ➡️
```dot
digraph G {
Hello -> World;
}
```## Related Projects 💫
Related projects can be found at [**ts-graphviz** GitHub Organization](https://github.com/ts-graphviz).
The TypeScript/JavaScript ecosystem provides a variety of OSS with the goal of making Graphviz more connected and easier to use.
## Contributors 👥
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Yuki Yamazaki
📖 ⚠️ 💻
Chris Wilkinson
🐛
Irakli Safareli
🤔
Michael Bock
🐛
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## How to Contribute 💪
The easiest way to contribute is to use the library and star [repository](https://github.com/ts-graphviz/prettier-plugin-dot).
### Questions 💭
Feel free to ask questions on [GitHub Discussions](https://github.com/ts-graphviz/prettier-plugin-dot/discussions).
### Report bugs / request additional features 💡
Please register at [GitHub Issues](https://github.com/ts-graphviz/prettier-plugin-dot/issues/new/choose).
### Development / Bug Fixes 🧑💻
See [CONTRIBUTING.md](https://github.com/ts-graphviz/prettier-plugin-dot/blob/main/CONTRIBUTING.md).
### Financial Support 💸
Please support core member [kamiazya](https://github.com/sponsors/kamiazya).
> **Note** Even just a dollar is enough motivation for me to develop 😊
## License ⚖️
This software is released under the MIT License, see [LICENSE](./LICENSE).