Package | Type | Status |
---|---|---|
Analyzer Tool | Released | |
Analyzer Tool | Preview |
// TODO: Write more explaination
The analyzer is a dotnet global tool.
dotnet tool install --global LivingDocumentation.Analyzer
Using LivingDocumentation to generate documentation follows the following process flow:
- Run the LivingDocumentation.Analyzer with your Visual Studio solution file as input. The tool will analyze all source code in the solution, and generate an intermediate JSON file as output containing all classes, interfaced, enums, etc.
- You create a "render application" where you use the JSON file as input, and you are able to create all kinds of views on your source code. Like aggregate class diagrams, event flow sequence diagrams, etc.
- Output your diagrams, text, etc. in text-based formats, like Markdown, AsciiDoc and PlantUML.
Both during local development, as during your CI&CD pipeline, can follow the same flow.
The analysis of a solution might take quite "long" (30s - 90s). Therefore we create an intermediate JSON file, so you only need to do rerun the analysis if your source solution changes. Generating the documentation takes less than a second. So you can have a fast feedback loop when developing your renderers as you don't need to recreate the JSON file every time.
A renderer application can be as simple as a command line tool that takes in the generated JSON files, makes conclusions based on the type information and writes this to a plain text file format.
To be able to quickly start your should make a dependency on the NuGet packages.
This is a hierarchical list of all NuGet packages and their contents & purpose.
-
LivingDocumentation.RenderExtensions
This package contains extension methods and dependencies on all types that describe the serialized analysis of the solution.
-
LivingDocumentation.Descriptions
This package contains all classes that describe the analyzed solution, like types, methods, xml comments, etc.
-
LivingDocumentation.Abstractions
This package contains interfaces, base classes, and enums.
-
LivingDocumentation.Extensions
This package contains extension methods.
-
-
LivingDocumentation.Statements
This package contains all classes that describe the statements in the analyzed solution, like foreach, if/else, switch, etc.
-
-
LivingDocumentation.Json
This package contains the Json serializers and contract resolvers to deserialize the generated JSON file.
-
LivingDocumentation.UML
This package contains a lot of supporting methods to make it easier to build valid PlantUML output.
These steps expect the eShopOnContainers and LivingDocumentation repos to be subdirectories of the location where you execute these commands:
|
+-- eShopOnContainers
+-- LivingDocumentation
-
Install the analyzer as a global tool
-
Make sure you've build the solution you want to document
dotnet build eShopOnContainers/eShopOnContainers-ServicesAndWebApps.sln -c Release
-
Run the analyzer and store the intermediate output
livingdoc-analyze --solution eShopOnContainers/eShopOnContainers-ServicesAndWebApps.sln --output analysis.json
-
Run you project specific renderer
dotnet run --project LivingDocumentation\samples\LivingDocumentation.eShopOnContainers -c Release