Skip to content

Tool for automatic generation of documentation in the form of images. Using Reflections. Find all the classes, which have a custom attribute. Get their links in the form of a graph. Generate file for GraphViz. Visualize your links between DTO. Customize colors and labels.

License

Notifications You must be signed in to change notification settings

RouR/MicroDocum

Repository files navigation

MicroDocum

Build status AppVeyor tests

Quality Gate Quality Gate Quality Gate Quality Gate Quality Gate Quality Gate

NuGet MicroDocum.Analyzers

NuGet MicroDocum.Graphviz

NuGet MicroDocum.Themes

Tool for automatic generation of documentation in the form of images. Using Reflections. Find all the classes, which have a custom attribute. Get their links in the form of a graph. Generate file for GraphViz. Visualize your links between DTO. Customize colors and labels.

Install

Getting started

  1. Implement your theme (IGraphvizTheme) or get DefaultTheme (IGraphvizTheme) from MicroDocum.Themes.DefaultTheme

  2. Mark your DTO with your custom attributes and custom interfaces

[LabelAlt("altLabel")]
[Tags("someTag")]
[TagsAlt("altTag")]
[TTL(10)]
[ServiceName("Test")]
public class Struct1 : IProduce<IInterface1>
{
}
  1. Analize your assembly
var a = new AssemblyAnalizer<DefaultLinkStyle>(theme);
var asm = AppDomain.CurrentDomain.GetAssemblies();
var graph = a.Analize(asm, theme.GetAvailableThemeAttributes(), t => t.FullName?.StartsWith(_classname) ?? false);
  1. Generate Graphviz file
var graphwizFileData = new GraphvizDotGenerator<DefaultLinkStyle>(theme);
  1. Visualize by online tool https://dreampuf.github.io/GraphvizOnline/ or generate image locally
Install-Package GraphViz.NET
Install-Package GraphViz
using GraphVizWrapper;
using GraphVizWrapper.Commands;
using GraphVizWrapper.Queries;

var getStartProcessQuery = new GetStartProcessQuery();
var getProcessStartInfoQuery = new GetProcessStartInfoQuery();
var registerLayoutPluginCommand = new RegisterLayoutPluginCommand(getProcessStartInfoQuery, getStartProcessQuery);
var wrapper = new GraphGeneration(getStartProcessQuery,
    getProcessStartInfoQuery,
    registerLayoutPluginCommand);
byte[] bytes = wrapper.GenerateGraph(graphwizFileData, GraphVizWrapper.Enums.GraphReturnType.Png);
SaveResultImage(bytes, $"./{TestContext.CurrentContext.Test.FullName}.png");

Example

https://github.com/RouR/ToDo-ToBuy/blob/ff367c92ce21d1bf9ebea40438965d6fa1c9d23d/build/Microdocum.cs#L37 https://github.com/RouR/ToDo-ToBuy/blob/ff367c92ce21d1bf9ebea40438965d6fa1c9d23d/DTO_routing.png example

About

Tool for automatic generation of documentation in the form of images. Using Reflections. Find all the classes, which have a custom attribute. Get their links in the form of a graph. Generate file for GraphViz. Visualize your links between DTO. Customize colors and labels.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages