|
| 1 | +# DendroDocs.Client |
| 2 | + |
| 3 | +[![NuGet][NUGET_BADGE]][NUGET_FEED] [![Coverage Status][COVERALLS_BADGE]][COVERALLS_LINK] |
| 4 | + |
| 5 | +**DendroDocs.Client** is a client library for the DendroDocs ecosystem that provides |
| 6 | +powerful extension methods for working with code analysis data. |
| 7 | +This library enables developers to manipulate and query code structure information, |
| 8 | +making it easier to work with TypeDescription, MethodDescription, InvocationDescription, |
| 9 | +and other code analysis models used in living documentation generation. |
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +* **Type Analysis Extensions** - Query and manipulate TypeDescription collections |
| 14 | + with methods for inheritance resolution, member population, and type lookups |
| 15 | +* **Method Analysis Extensions** - Filter and analyze MethodDescription collections |
| 16 | + by name and other criteria |
| 17 | +* **Invocation Analysis Extensions** - Match method invocations, trace call consequences, |
| 18 | + and analyze method parameters |
| 19 | +* **String Utilities** - Helper methods for working with type names, generic types, |
| 20 | + and formatting for diagrams |
| 21 | +* **Attribute Extensions** - Filter and query attribute descriptions and their |
| 22 | + relationships |
| 23 | +* **Inheritance Support** - Automatically populate inherited base types and members |
| 24 | + from type hierarchies |
| 25 | + |
| 26 | +## Prerequisites |
| 27 | + |
| 28 | +.NET 8.0 SDK or newer. |
| 29 | + |
| 30 | +## Installation |
| 31 | + |
| 32 | +To use **DendroDocs.Client** in your project, install it as a NuGet package: |
| 33 | + |
| 34 | +```shell |
| 35 | +dotnet add package DendroDocs.Client |
| 36 | +``` |
| 37 | + |
| 38 | +## Example Usage |
| 39 | + |
| 40 | +```csharp |
| 41 | +using DendroDocs.Extensions; |
| 42 | + |
| 43 | +// Working with type collections |
| 44 | +var types = new List<TypeDescription>(); |
| 45 | +// ... populate types from analysis |
| 46 | +
|
| 47 | +// Find a specific type |
| 48 | +var myType = types.FirstOrDefault("MyNamespace.MyClass"); |
| 49 | + |
| 50 | +// Populate inherited members |
| 51 | +types.PopulateInheritedMembers(); |
| 52 | + |
| 53 | +// Working with method invocations |
| 54 | +var invocation = new InvocationDescription(); |
| 55 | +var matchingMethods = types.GetInvokedMethod(invocation); |
| 56 | +var consequences = types.GetInvocationConsequences(invocation); |
| 57 | + |
| 58 | +// String formatting utilities |
| 59 | +var typeName = "System.Collections.Generic.List<System.String>"; |
| 60 | +var diagramName = typeName.ForDiagram(); // "List<String>" |
| 61 | +var isGeneric = typeName.IsGeneric(); // true |
| 62 | +var genericTypes = typeName.GenericTypes(); // ["System.String"] |
| 63 | +
|
| 64 | +// Method filtering |
| 65 | +var methods = new List<MethodDescription>(); |
| 66 | +var namedMethods = methods.WithName("MyMethod"); |
| 67 | +``` |
| 68 | + |
| 69 | +## The DendroDocs Ecosystem |
| 70 | + |
| 71 | +**DendroDocs.Client** is a key component of the broader DendroDocs ecosystem. |
| 72 | +It works together with: |
| 73 | + |
| 74 | +* [DendroDocs.Tool](https://github.com/dendrodocs/dotnet-tool) - Command-line |
| 75 | + analyzer for generating JSON from .NET projects |
| 76 | +* [DendroDocs.Shared](https://github.com/dendrodocs/dotnet-shared-lib) - Shared |
| 77 | + library with common utilities and models |
| 78 | + |
| 79 | +Explore [DendroDocs](https://github.com/dendrodocs) to find more tools, libraries, |
| 80 | +and documentation resources that help you bridge the gap between your code and its |
| 81 | +documentation. |
| 82 | + |
| 83 | +## Contributing |
| 84 | + |
| 85 | +Contributions are welcome! Please feel free to create |
| 86 | +[issues](https://github.com/dendrodocs/dotnet-client-lib/issues) or |
| 87 | +[pull requests](https://github.com/dendrodocs/dotnet-client-lib/pulls). |
| 88 | + |
| 89 | +## License |
| 90 | + |
| 91 | +This project is licensed under the [MIT License](./LICENSE). |
| 92 | + |
| 93 | +[NUGET_BADGE]: https://img.shields.io/nuget/v/DendroDocs.Client.svg?style=plastic |
| 94 | +[NUGET_FEED]: https://www.nuget.org/packages/DendroDocs.Client/ |
| 95 | +[COVERALLS_BADGE]: https://coveralls.io/repos/github/dendrodocs/dotnet-client-lib/badge.svg?branch=main |
| 96 | +[COVERALLS_LINK]: https://coveralls.io/github/dendrodocs/dotnet-client-lib?branch=main |
0 commit comments