Skip to content

Mermaid Class Diagram Generator: Generate a Mermaid Class Diagram from C# class files

License

Notifications You must be signed in to change notification settings

fwullschleger/mcdg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mermaid Class Diagram Generator (mcdg)

What is mcdg

mcdg (Mermaid Class Diagram Generator) is a dotnet tool for generating mermaid.js class diagrams directly from C# source code (.cs files).

Unlike other tools that require compiled assemblies (DLLs), mcdg uses Roslyn to parse your source code files recursively from a directory. This allows you to generate diagrams for projects that may not currently build or to quickly visualize a folder of scripts.

Credits

This project is a source-code analysis port of dll2mmd. The core graph generation logic and structure were originally written by rtfs, and this project adapts that logic to work with the Microsoft.CodeAnalysis (Roslyn) API instead of reflection.

Installing mcdg

  1. Install .Net SDK 6.0 or later.

  2. Install mcdg as a global dotnet tool.

    $ dotnet tool install --global mcdg
    You can invoke the tool using the following command: mcdg
    Tool 'mcdg' (version '1.0.0') was successfully installed.

    Alternatively, if running from source:

    $ dotnet run --project src/MermaidClassDiagramGenerator/MermaidClassDiagramGenerator.csproj -- [options]

Usage

Description:
  Generate mermaid.js class-diagram from C# source code files.

Usage:
  mcdg [options]

Options:
  -o, --output <output>           Output file. [default: output.md]
  -ns, --namespace <namespace>    Namespace filter. []
  -p, --path <path> (REQUIRED)    Path to the folder containing .cs files.
  -t, --type-names <type-names>   Specific classes to include. []
  --ignore-dependency             If true, skip dependency arrows.
  --version                       Show version information
  -?, -h, --help                  Show help and usage information

About

Mermaid Class Diagram Generator: Generate a Mermaid Class Diagram from C# class files

Topics

Resources

License

Stars

Watchers

Forks

Languages