Creating Software with Modern Diagramming Techniques
Build Better Software with Mermaid
by Ashley Peacock
Version: P1.0 (February 2023)
Copyright 2023 The Pragmatic Programmers, LLC. This book is licensed to the individual who purchased it. We don't copy-protect it because that would limit your ability to use it for your own purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copy with other members of your team, with friends, or via file sharing services. Thanks.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
About the Pragmatic Bookshelf
The Pragmatic Bookshelf is an agile publishing company. Were here because we want to improve the lives of developers. We do this by creating timely, practical titles, written by programmers for programmers.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been DRM-free. We pioneered the beta book concept, where you can purchase and read a book while its still being written, and provide feedback to the author to help make a better book for everyone. Free resources for all purchasers include source code downloads (if applicable), errata and discussion forums, all available on the book's home page at pragprog.com. Were here to make your life easier.
New Book Announcements
Want to keep up on our latest titles and announcements, and occasional special offers? Just create an account on pragprog.com (an email address and a password is all it takes) and select the checkbox to receive newsletters. You can also follow us on twitter as @pragprog.
About Ebook Formats
If you buy directly from pragprog.com, you get ebooks in all available formats for one price. You can synch your ebooks amongst all your devices (including iPhone/iPad, Android, laptops, etc.) via Dropbox. You get free updates for the life of the edition. And, of course, you can always come back and re-download your books when needed. Ebooks bought from the Amazon Kindle store are subject to Amazon's polices. Limitations in Amazon's file format may cause ebooks to display differently on different devices. For more information, please see our FAQ at pragprog.com/#about-ebooks. To learn more about this book and access the free resources, go to https://pragprog.com/book/apdiag, the book's homepage.
Thanks for your continued support,
The Pragmatic Bookshelf
The team that produced this book includes: Dave Rankin (CEO) Janet Furlow (COO) Tammy Coron (Managing Editor) Michael Swaine (Development Editor) L. Sakhi MacMillan (Copy Editor) Gilson Graphics (Layout) Andy Hunt and Dave Thomas (Founders)
For customer support, please contact .
For international rights, please contact .
Table of Contents
Copyright 2023, The Pragmatic Bookshelf.
Early Praise for Creating Software with Modern Diagramming Techniques
Since reading this book Ive recommended it to three people already. Whether youre completely new to diagramming or have diagrammed before but want to go deeper into the subject and gain more practical knowledge that you can apply in your day-to-day, I think youll find this book incredibly useful.
Robert Faldo |
Ruby Engineer, Simply Business |
As someone who has only ever drawn diagrams by hand, drawing lines and boxes and getting annoyed when the software doesnt do it how I want, I found this book to be a great guide to creating them programmatically. It will definitely increase my diagramming speed. Well worth a read.
Kevin Samuel |
Software Engineer, Simply Business |
I never realized how powerful diagramming your software could be. This book has everything you need to add a strong tool to your software development toolbox.
Adam Cox |
Software Test Engineer, Simply Business |
Acknowledgments
I never thought Id ever write a book, but Ive loved every minute of writing it. I couldnt have done it alone though, so I have some awesome people to thank.
Id like to thank the Pragmatic Bookshelf for believing in my book and vision and giving me the chance to write and publish this book. In particular, Id like to thank my editor Michael Swaine, who has been tremendous throughout in guiding me through writing the book. Additional thanks go to Tammy Coron and Margaret Eldridge.
Furthermore, Id like to thank my reviewers Thuan Nguyen, Adam Cox, Kelvin Samuel, and Rob Faldo, for their time and effort in helping shape the book through their feedback.
I couldnt have written this book at all without being able to practice and promote the use of diagrams at work, so for any work colleagues, past and present, thank you for being open to trying diagramming!
This book wouldnt have been possible without Mermaid. I truly believe its a real step forward for diagramming, and it supercharges all the use cases in this book. Therefore, I want to thank each and every contributor to the library.
My girlfriend has been incredibly supportive while I write the book, thank you for your support, for taking an interest, and for listening to my many hours of book-related ramblings.
Last, but certainly not least, Id like to thank my family for their never-ending support. In my thirty-one years on this planet, Ive never felt anything besides love, support, and encouragement from my entire family, and for that I am forever grateful. Thank you for everything youve done for me; I love you all very much.
Copyright 2023, The Pragmatic Bookshelf.
Preface
Welcome reader, and future diagram master!
Over many years, I learned the power of being able to turn words and thoughts into diagrams. I started out like most diagrammers, using a language called UML, which well learn all about in this book. Instantly, I saw the power a diagram could have. Id go as far to say its become a superpower. The ease with which you can explain something with a diagram is like nothing else, but it always felt a bit cumbersome to do with the tools that were on offer.
Then, along came Mermaid, a tool to write diagrams as you would code and automatically render them from that code. It wasnt the first to do this, but Id argue its the first to go mainstream and see widespread adoption and support. Suddenly, diagramming became so much more accessible. You didnt need a special programall you needed was a text editor. Since then, Ive advocated for adopting Mermaid with the companies and individuals I work with and never looked back.