GithubHelp home page GithubHelp logo

rour / microdocum Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 67 KB

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: MIT License

C# 100.00%

microdocum's Introduction

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

microdocum's People

Contributors

rour avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.