BlockDiag Diagrams in Markdown
A Python-inspired syntax for generating clean block and packet diagrams.
BlockDiag is a declarative text-to-image generator that heavily relies on a syntax identical to Graphviz’s DOT language, but it focuses exclusively on block diagrams. It handles the layout algorithm slightly differently than Graphviz, often resulting in more structured, grid-like enterprise architecture charts.
To use it in MarkdownToPrettyPDF, wrap your syntax in a blockdiag code block.
Basic Syntax
Block diagrams are declared simply by pointing nodes at each other using ->. By default, the layout engine arranges them left-to-right or top-to-bottom.
|
|
|
Attributes and Styling
You can assign properties to nodes, such as color, shape, and labels, exactly like you do in DOT/Graphviz.
|
|
|
Grouping
Grouping nodes into clusters is often necessary when drawing system boundaries or network partitions (like “Frontend”, “Backend”, “AWS VPC”).
|
|
|
Advanced Shapes
BlockDiag supports numerous built-in shapes to represent servers, databases, actors, and network components:
boxroundedboxcircleellipseactor(A stick figure)cloud(Often used for the Internet)flowpan(A database cylinder)
|
|
|
When to use BlockDiag?
Use BlockDiag when Graphviz’s auto-layout feels too chaotic or unpredictable. BlockDiag strongly adheres to a neat grid system, which forces your architecture diagrams to look perfectly aligned without manual tweaking.