prettier-plugin-dot is a prettier plugin for Graphviz Dot.
Format your Dot using Prettier.
A Prettier plugin must first parse the source code of the target language into a traversable data structure (Usually an Abstract Syntax Tree) and then print out that data structure in a "pretty" style.
The Graphviz Dot AST generated by ts-graphviz implemented in JavaScript using the 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.
If you're using the npm or yarn CLI, then add the plugin by:
# 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:
$ yarn run prettier --write '**/*.dot'
# or
$ npx prettier --write '**/*.dot'
digraph G {Hello->World}
digraph G {
Hello -> World;
}
Related projects can be found at ts-graphviz GitHub Organization.
The TypeScript/JavaScript ecosystem provides a variety of OSS with the goal of making Graphviz more connected and easier to use.
Thanks goes to these wonderful people (emoji key):
Yuki Yamazaki 📖 |
Chris Wilkinson 🐛 |
Irakli Safareli 🤔 |
Michael Bock 🐛 |
This project follows the all-contributors specification. Contributions of any kind welcome!
The easiest way to contribute is to use the library and star repository.
Feel free to ask questions on GitHub Discussions.
Please register at GitHub Issues.
See CONTRIBUTING.md.
Please support core member kamiazya.
Note Even just a dollar is enough motivation for me to develop 😊
This software is released under the MIT License, see LICENSE.