Better Programming

Advice for programmers.

Follow publication

Member-only story

Mermaid Output Formats in ChatGPT Are a Game-changer

Marco Kotrotsos
Better Programming
Published in
4 min readMar 28, 2023

Output graphs like this using ChatGPT and Mermaid

It’s been a couple of months since I last wrote about ChatGPT and the table output it can generate, along with some other very basic examples.

Well, ChatGPT has grown up just a little bit, and so did its capabilities outputting different formats, with or without a helper app like Mermaid. (https://mermaid.live)

The use of a helper app will probably not be necessary when someone releases a Mermaid ChatGPT plugin, but before that becomes generally available, this is the (a) way to do it.

The general idea is because ChatGPT, for now, can only output text, we need a service that can take that text and transform it into a graph. Mermaid is perfect for such a thing. It’s easy to use, it supports a ridiculous amount of graph types, and it’s free for our use case.

Just copy the generated ChatGPT code and paste it into the Live Editor on the Mermaid site (https://mermaid.live). Remember to pre or postfix the prompt you see here with something like your own code- or a longer description of what you want the graph to represent.

First, your starter prompt. This will make sure that ChatGPT outputs code that Mermaid can understand.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Marco Kotrotsos
Marco Kotrotsos

Written by Marco Kotrotsos

Tech person. I write about technology, Generative AI, the cloud, design and development.

Write a response

Thanks for posting. Mermaid is great since humans and machines can both read it.

16

I’d really appreciate it! Have a great one!

Welcome aboard! ⛵This piece is wonderful! 🙏So glad I found you on Medium! 👉Here's a tip…read and 📢📢📢comment on as many pieces by other writers as you can and your Medium🌱🌱🌱 will grow!💰💰💰 I PROMISE IT WORKS!

9

Although I think there is a future out there with GPT-assisted AI diagrams – I do not think that Mermaid integration with ChatGPT is a "game changer." The chance of ChatGPT using the exact steps that I'd want to include in my diagram are low for any…

8