I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)
This gist explains how I do my PlantUML workspace in a project.
- The idea is to keep a
globals
directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent. - I use a
stylesheet.iuml
file that keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors. - The
style-presets.iuml
file defines these colors so you can make "presets" or "themes" out of them. - As stated in the
stylesheet.iuml
, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly. - You can choose to either run the PlantUML jar over your file/s, or use an IDE like VSCode with the PlantUML extension. Here's a preview of
example-sequence.puml
for example: https://imgur.com/Klk3w2F
Assume the following directory structure:
$ tree
.
├── globals
│ ├── style-presets.iuml
│ └── stylesheet.iuml
└── diagrams
├── example-sequence.puml
├── etc...
Once you have this configured, just run
# If you don't have PlantUML yet, install it!
# In macOS, you can just brew it
brew install plantuml
# Assuming you're in the base path already
plantuml diagrams/example-sequence.puml
# Done. You should have diagrams/example-sequence.png after running.
2023-07-31:
- Updated variable definitions to match with PlantUML's standard and corrections. Thanks GabrielF-C!
- Made sure this gist still works as of 2023/07/31, on version
PlantUML version 1.2023.10 (Wed Jul 12 23:54:07 PST 2023)
- Added instructions.
2020-01-27:
- Added a preview of how it looks like when it's exported / viewed with PlantUML: https://imgur.com/Klk3w2F
- Added a quick tip to use an IDE or the PlantUML jar to get this to work.
- Corrected the filename - example-sequence.puml. It was .iuml before. The extensions don't really matter from what I can tell though.
- Added this changelog.
Exactly what I want, big thumbs to you. 👍