Table of Contents
Docfx.ResultSnippets

Docfx Result Snippets


Nuget Coverage Quality Gate Status CD Build Check Markdown

Include the executed results from code in your Docfx documentation!


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.ToTableResult();

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.