Live data from Hacker News

The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

jessems.com

1–10 of 113 posts

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#2
I have found these fun to work with, and ChatGPT has been pretty useful to play with: using it take code and create a sequence diagram, take a sequence diagram and create code (in one language, then another). It's pretty interesting and code generated can be tested so this feels like a good workbench to have for development. I am looking forward to trying Copilot Chat which should have these same capabilities (I hope).

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#4
For an easy, out of the block, self-hosted experience, allow me to recommend:

Docusaurus.io framework. Why? It's compatible with MermaidJS-- simply run 1 install command, and setup 2 config settings-- shown here: https://docusaurus.io/docs/next/api/themes/@docusaurus/theme...

Docusaurus provides: Docs, Blog, Pages. Via Markdown. And for pages, it even allows basic JSX (reactjs style components).

Lately I've really been enjoying the combination of Docusaurus & Mermaid to document my personal projects.

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#6
post #3

I really, _really_ wish I could generate SVGs of these without JavaScript and a headless browser.

Have you looked at d2lang - it supports SVG output: https://d2lang.com/tour/exports/

The syntax is a bit different though, so it depends on where your source is coming from, see here: https://text-to-diagram.com/?example=sequence&b=mermaid

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#8
I can highly recommend PlantUML as a simple language for creating sequence diagrams. It also supports other UML diagram types, which, despite what the article says, are also useful sometimes (so long as you don't worry about every last silly detail that's specified in the standard).

   @startuml
   Alice -> Bob: Authentication Request
   Bob --> Alice: Authentication Response

   Alice -> Bob: Another authentication Request
   Alice 
https://plantuml.com/sequence-diagram

Re: The Unreasonable Effectiveness of Sequence Diagrams in MermaidJS

#9
post #3

I really, _really_ wish I could generate SVGs of these without JavaScript and a headless browser.

Having to use npm did put me off initially (as I had never used it, or JS, before), but it was quite painless, and now I have pretty sequence diagrams inline my org-mode docs. Its is about a billion time better than using the confluence builtin WYSIWYG graph builder.
Post reply on HN