Jens Geyer created THRIFT-6026:
----------------------------------
Summary: Add Mermaid diagram generator (--gen mmd)
Key: THRIFT-6026
URL: https://issues.apache.org/jira/browse/THRIFT-6026
Project: Thrift
Issue Type: New Feature
Reporter: Jens Geyer
The Thrift compiler already ships a Graphviz generator (--gen gv) for
visualising IDL type graphs. This ticket adds an analogous Mermaid classDiagram
generator (--gen mmd) that produces .mmd files renderable natively on GitHub,
GitLab, Confluence, Obsidian, and other platforms without requiring external
tooling.
Features:
- All IDL constructs mapped to Mermaid classDiagram: enum (<<enumeration>>),
struct (<<struct>>), union (<<union>>), exception (<<exception>>), typedef
(<<typedef>>), service (<<service>>)
- Service extends rendered as inheritance arrows (--|>)
- Container generics using tilde syntax (list~T~, map~K,V~) for Mermaid
compatibility
- Optional :exceptions flag to draw dashed dependency arrows from service
functions to declared exception types
- When invoked with -r, the root program diagram aggregates types from all
transitively included programs into a single output file
- Constants intentionally omitted (visual noise, no structural value in a type
diagram)
- Output in gen-mmd/<programname>.mmd
Implementation: single new file
compiler/cpp/src/thrift/generate/t_mmd_generator.cc plus one
THRIFT_ADD_COMPILER entry in compiler/cpp/CMakeLists.txt. No library changes.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)