This repository contains two Bash scripts to automatically render Graphviz .dot files into both SVG and PNG formats.
render_graphs.sh: Renders a single.dotfile into both SVG and PNG.render_graphs_all.sh: Finds and renders all.dotfiles in the current directory by callingrender_graphs.sh.
Before using the scripts, you need to have Graphviz installed on your system. Graphviz provides the dot command used for rendering .dot files.
On most Linux distributions (Ubuntu/Debian-based), you can install Graphviz using the package manager:
sudo apt-get update
sudo apt-get install graphvizFor Fedora-based distributions:
sudo dnf install graphvizFor Arch Linux:
sudo pacman -S graphvizIf you are using macOS, you can install Graphviz using Homebrew:
brew install graphvizThis script renders a single .dot file into both SVG and PNG formats.
./render_graphs.sh <input_file.dot>./render_graphs.sh my_graph.dotThis will generate my_graph.svg and my_graph.png in the same directory as the .dot file.
This script finds all .dot files in the current directory and calls render_graphs.sh to render each one.
./render_graphs_all.shSimply run the script in the directory containing .dot files:
./render_graphs_all.shThis will generate SVG and PNG files for all .dot files in the directory.
-
render_graphs.sh: This script takes one argument, the name of the.dotfile, and outputs both an SVG and a PNG of the graph. -
render_graphs_all.sh: This script loops through all.dotfiles in the current directory and callsrender_graphs.shto process each one.
After downloading or creating the scripts, make them executable by running:
chmod +x render_graphs.sh
chmod +x render_graphs_all.shThis project is open-source and can be modified or distributed under the Unlicense License.