Skip to content

Commit 5a9ff06

Browse files
committed
docs: add acknowledgements section to README
- and nuget-specific readme
1 parent cfdd70a commit 5a9ff06

File tree

3 files changed

+85
-3
lines changed

3 files changed

+85
-3
lines changed

.github/workflows/build-and-package.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
<projectUrl>https://github.com/AlrikOlson/D2Sharp</projectUrl>
135135
<repository type="git" url="https://github.com/AlrikOlson/D2Sharp.git" />
136136
<tags>d2 diagram visualization</tags>
137-
<readme>README.md</readme>
137+
<readme>README.nuget.md</readme>
138138
<dependencies>
139139
<group targetFramework="net8.0">
140140
<dependency id="Microsoft.Extensions.Logging" version="8.0.0" />
@@ -144,7 +144,7 @@ jobs:
144144
<files>
145145
<file src="lib/net8.0/D2Sharp.dll" target="lib/net8.0" />
146146
<file src="runtimes/**/*" target="runtimes" />
147-
<file src="../README.md" target="\" />
147+
<file src="../README.nuget.md" target="\" />
148148
</files>
149149
</package>
150150
EOF

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,12 @@ Running the web demo:
6262
```
6363
cd examples/D2Sharp.Web
6464
dotnet run
65-
```
65+
```
66+
67+
## Acknowledgements
68+
69+
This project would not be possible without the following open-source projects:
70+
71+
- [D2](https://github.com/terrastruct/d2): The underlying diagramming engine
72+
- [.NET](https://github.com/dotnet/runtime): The runtime and framework
73+
- [Go](https://github.com/golang/go): Used for the native wrapper

README.nuget.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# D2Sharp
2+
3+
D2Sharp is a .NET wrapper for the D2 diagramming library, allowing you to create diagrams programmatically in your .NET applications.
4+
5+
## Installation
6+
7+
You can install D2Sharp via NuGet Package Manager:
8+
9+
```
10+
Install-Package D2Sharp
11+
```
12+
13+
Or via .NET CLI:
14+
15+
```
16+
dotnet add package D2Sharp
17+
```
18+
19+
## Usage
20+
21+
Here's a basic example of how to use D2Sharp:
22+
23+
```csharp
24+
using D2Sharp;
25+
using Microsoft.Extensions.Logging;
26+
27+
// Create a logger (optional)
28+
var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
29+
var logger = loggerFactory.CreateLogger<D2Wrapper>();
30+
31+
// Create an instance of D2Wrapper
32+
var wrapper = new D2Wrapper(logger);
33+
34+
// Define your D2 script
35+
var script = @"
36+
direction: right
37+
A -> B -> C
38+
";
39+
40+
// Render the diagram
41+
try
42+
{
43+
string svg = wrapper.RenderDiagram(script);
44+
// Use the SVG string as needed (e.g., save to file, display in a web page)
45+
}
46+
catch (Exception ex)
47+
{
48+
Console.WriteLine($"Error rendering diagram: {ex.Message}");
49+
}
50+
```
51+
52+
## Features
53+
54+
- Render D2 diagrams as SVG
55+
- Cross-platform support (Windows, macOS, Linux)
56+
- Integration with .NET logging
57+
58+
## Requirements
59+
60+
- .NET 8.0 or later
61+
62+
## License
63+
64+
This project is licensed under the MIT License - see the LICENSE file for details.
65+
66+
## Acknowledgements
67+
68+
D2Sharp is built on top of the following open-source projects:
69+
- [D2](https://github.com/terrastruct/d2): The underlying diagramming engine
70+
- [.NET](https://github.com/dotnet/runtime): The runtime and framework
71+
72+
## Issues and Contributions
73+
74+
For issues, feature requests, or contributions, please visit the [GitHub repository](https://github.com/AlrikOlson/D2Sharp).

0 commit comments

Comments
 (0)