+..\..\path\to\ilspycmd.exe ..\path\to\your\assembly.dll --generate-diagrammer --outputdir . ++ +With this script in place, run it to (re-)generate the HTML diagrammer at your leisure. Note that `--outputdir .` directs the output to the current directory. + +### Automatically + +If you want to deploy an up-to-date HTML diagrammer as part of your live documentation, +you'll want to automate its regeneration to keep it in sync with your code base. + +For example, you might like to share the diagrammer on a web server or - in general - with users +who cannot or may not regenerate it; lacking either access to the ilspycmd console app or permission to use it. + +In such cases, you can dangle the regeneration off the end of either your build or deployment pipeline. +Note that the macros used here apply to [MSBuild](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild) for [Visual Studio](https://learn.microsoft.com/en-us/visualstudio/ide/reference/pre-build-event-post-build-event-command-line-dialog-box) and your mileage may vary with VS for Mac or VS Code. + +#### After building + +To regenerate the HTML diagrammer from your output assembly after building, +add something like the following to your project file. +Note that the `Condition` here is optional and configures this step to only run after `Release` builds. + +```xml +
+ilspycmd.exe --generate-diagrammer-include Your\.Models\..+ --generate-diagrammer-exclude .+\+Metadata|.+\.Data\..+Map --generate-diagrammer-report-excluded ..\path\to\your\assembly.dll --generate-diagrammer --outputdir . ++ +This example +- includes all types in the top-level namespace `Your.Models` +- while excluding + - nested types called `Metadata` and + - types ending in `Map` in descendant `.Data.` namespaces. + +#### Strip namespaces from XML comments + +You can reduce the noise in the XML documentation comments on classes on your diagrams by supplying a space-separated list of namespaces to omit from the output like so: + +
+ilspycmd.exe --generate-diagrammer-strip-namespaces System.Collections.Generic System ..\path\to\your\assembly.dll --generate-diagrammer --output-folder . ++ +Note how `System` is replaced **after** other namespaces starting with `System.` to achieve complete removal. +Otherwise `System.Collections.Generic` wouldn't match the `Collections.Generic` left over after removing `System.`, resulting in partial removal only. + +#### Adjust for custom XML documentation file names + +If - for whatever reason - you have customized your XML documentation file output name, you can specify a custom path to pick it up from. + +
+ilspycmd.exe --generate-diagrammer-docs ..\path\to\your\docs.xml ..\path\to\your\assembly.dll --generate-diagrammer --output-folder . +diff --git a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj index 6ee7581b98..76a7b35044 100644 --- a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj +++ b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj @@ -65,6 +65,22 @@ +