Docfx.ResultSnippets
1.0.0
See the version list below for details.
dotnet add package Docfx.ResultSnippets --version 1.0.0
NuGet\Install-Package Docfx.ResultSnippets -Version 1.0.0
<PackageReference Include="Docfx.ResultSnippets" Version="1.0.0" />
paket add Docfx.ResultSnippets --version 1.0.0
#r "nuget: Docfx.ResultSnippets, 1.0.0"
// Install Docfx.ResultSnippets as a Cake Addin #addin nuget:?package=Docfx.ResultSnippets&version=1.0.0 // Install Docfx.ResultSnippets as a Cake Tool #tool nuget:?package=Docfx.ResultSnippets&version=1.0.0
Docfx Result Snippets
Features
- Export results to tables
- Convert
Types
to class diagrams - Export results to any format supported by markdig
using Docfx.ResultSnippets;
...
// some return value
const string result = "Some result to save";
// now it can be saved as an example
result.SaveResults();
// we can also add a part to the name
"Some other result".SaveResults(partName: "part2");
Which generates a Markdown file that can be added via the include file like so,
[!INCLUDE[SomeExample](some/path/to/code/__examples__/ClassName.MethodName.{Optional-PartName}.md)]
Getting Started
To use this library, simply include Docfx.ResultSnippets.dll
in your project
or grab it from NuGet,
and add this to the top of each .cs
file that needs it:
using Docfx.ResultSnippets;
Why?
Docfx has amazing tools for including code snippets in your documentation but not the results from executing that code.
For some code examples the formatted result of executing that code is as important as the code itself.
For example code that returns an IEnumerable, the most natural way to show the result would be a table. This library provides the tools to make it happen and more.
This code,
// some complex data which will convert to a table
var data = Enumerable
.Range(1, 3)
.Select(
i =>
new
{
Name = $"Name {i}",
Id = i,
Nested = new { ChildId = i + 1 }
}
);
var tableResult = data.AsTableResult();
Results in this,
Name | Id | Nested |
---|---|---|
Name 1 | 1 | {"ChildId":2} |
Name 2 | 2 | {"ChildId":3} |
Name 3 | 3 | {"ChildId":4} |
The aim of this library is to support Markdown friendly code results so the readers of your documentation can get a complete picture of what the code will produce. Think of it as serverside rendering of code results, like a pre executed Jupyter notebook.
For more details/information have a look the documentation, test project or create an issue.
Attributions
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 7.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Docfx.ResultSnippets:
Package | Downloads |
---|---|
SparkTest.NET
Support for testing Spark dotnet applications |
GitHub repositories
This package is not used by any popular GitHub repositories.