Skip to content

Commit 1b301ce

Browse files
committed
Add package icon and readme
1 parent bca6f41 commit 1b301ce

File tree

3 files changed

+102
-2
lines changed

3 files changed

+102
-2
lines changed

src/DendroDocs.Shared/DendroDocs.Shared.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<NeutralLanguage>en-US</NeutralLanguage>
1414
<Version>0.1.0</Version>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
16+
<PackageIcon>icon.png</PackageIcon>
17+
<PackageReadmeFile>README.md</PackageReadmeFile>
1618

1719
<IncludeSymbols>true</IncludeSymbols>
1820
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
@@ -22,8 +24,8 @@
2224
<Using Include="System.ComponentModel" />
2325
<Using Include="System.Diagnostics" />
2426
<Using Include="System.Runtime.Serialization" />
25-
<Using Include="System.Text.Json"/>
26-
<Using Include="System.Text.Json.Serialization"/>
27+
<Using Include="System.Text.Json" />
28+
<Using Include="System.Text.Json.Serialization" />
2729
<Using Remove="System.IO" />
2830
<Using Remove="System.Net.Http" />
2931
</ItemGroup>
@@ -33,4 +35,9 @@
3335
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
3436
</ItemGroup>
3537

38+
<ItemGroup>
39+
<None Update="icon.png" Pack="true" PackagePath="\" />
40+
<None Update="README.md" Pack="true" PackagePath="\" />
41+
</ItemGroup>
42+
3643
</Project>

src/DendroDocs.Shared/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# DendroDocs.Shared
2+
3+
**DendroDocs.Shared** is a shared library used across multiple components of the DendroDocs ecosystem.
4+
It provides common utilities, abstractions, and extensions that are essential for the functionality of tools like [DendroDocs.Tool](https://github.com/dendrodocs/dotnet-tool) and other .NET-based projects using DendroDocs.
5+
6+
## Features
7+
8+
- **Data Models**: Comprehensive data models for representing .NET code structure including types, methods, properties, fields, and documentation comments
9+
- **Code Analysis**: Tools for parsing and representing .NET code elements with support for modifiers, attributes, and inheritance
10+
- **JSON Serialization**: Optimized JSON serialization utilities with custom converters for efficient data exchange
11+
- **String Extensions**: Helper methods for namespace and class name manipulation
12+
- **Statement Representations**: Models for control flow statements like if/else, switch, and foreach
13+
- **Documentation Parsing**: XML documentation comment parsing with support for all standard tags
14+
15+
## Installation
16+
17+
To use **DendroDocs.Shared** in your project, install it as a NuGet package:
18+
19+
```shell
20+
dotnet add package DendroDocs.Shared
21+
```
22+
23+
## Example usage
24+
25+
```csharp
26+
using DendroDocs;
27+
using DendroDocs.Extensions;
28+
using DendroDocs.Json;
29+
using Newtonsoft.Json;
30+
31+
// Working with type descriptions
32+
var types = new List<TypeDescription>();
33+
34+
// more code
35+
36+
var result = JsonConvert.SerializeObject(types.OrderBy(t => t.FullName), serializerSettings);
37+
```
38+
39+
## Library Components
40+
41+
### Data Models (`DendroDocs` namespace)
42+
43+
The library provides comprehensive data models for representing .NET code structure:
44+
45+
- **`TypeDescription`**: Represents classes, interfaces, structs, enums, and delegates with their members
46+
- **`MethodDescription`**: Represents methods with parameters, return types, and method body statements
47+
- **`PropertyDescription`**: Represents properties with getters and setters
48+
- **`FieldDescription`**: Represents fields and constants
49+
- **`ConstructorDescription`**: Represents class constructors
50+
- **`EventDescription`**: Represents events and event handlers
51+
- **`AttributeDescription`**: Represents attributes applied to code elements
52+
- **`DocumentationCommentsDescription`**: Represents parsed XML documentation comments
53+
54+
### String Extensions (`DendroDocs.Extensions` namespace)
55+
56+
Utility methods for working with fully qualified type names:
57+
58+
- **`ClassName()`**: Extracts the class name from a fully qualified name
59+
- **`Namespace()`**: Extracts the namespace from a fully qualified name
60+
- **`NamespaceParts()`**: Splits a namespace into its component parts
61+
62+
### JSON Utilities (`DendroDocs.Json` namespace)
63+
64+
Optimized JSON serialization for DendroDocs data models:
65+
66+
- **`JsonDefaults`**: Provides pre-configured settings for both Newtonsoft.Json and System.Text.Json
67+
- **`SkipEmptyCollectionsContractResolver`**: Custom contract resolver to optimize JSON output
68+
- **`ConcreteTypeConverter`**: Handles polymorphic type serialization
69+
70+
### Statement Models (`DendroDocs` namespace)
71+
72+
Represents control flow and code statements:
73+
74+
- **`Statement`**: Base class for all statement types
75+
- **`If`** / **`IfElseSection`**: Conditional statements
76+
- **`Switch`** / **`SwitchSection`**: Switch statements
77+
- **`ForEach`**: Iteration statements
78+
- **`InvocationDescription`**: Method and property invocations
79+
- **`AssignmentDescription`**: Variable assignments
80+
- **`ReturnDescription`**: Return statements
81+
82+
## The DendroDocs Ecosystem
83+
84+
**DendroDocs.Shared** is a crucial part of the broader DendroDocs ecosystem.
85+
Explore [DendroDocs](https://github.com/dendrodocs) to find more tools, libraries, and documentation resources that help you bridge the gap between your code and its documentation.
86+
87+
## Contributing
88+
89+
Contributions are welcome! Please feel free to create [issues](https://github.com/dendrodocs/dotnet-shared-lib/issues) or [pull requests](https://github.com/dendrodocs/dotnet-shared-lib/pulls).
90+
91+
## License
92+
93+
This project is licensed under the MIT License.

src/DendroDocs.Shared/icon.png

15.1 KB
Loading

0 commit comments

Comments
 (0)