MarkdownSnippets.MsBuild
28.2.0
dotnet add package MarkdownSnippets.MsBuild --version 28.2.0
NuGet\Install-Package MarkdownSnippets.MsBuild -Version 28.2.0
<PackageReference Include="MarkdownSnippets.MsBuild" Version="28.2.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="MarkdownSnippets.MsBuild" Version="28.2.0" />
<PackageReference Include="MarkdownSnippets.MsBuild"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add MarkdownSnippets.MsBuild --version 28.2.0
#r "nuget: MarkdownSnippets.MsBuild, 28.2.0"
#:package MarkdownSnippets.MsBuild@28.2.0
#addin nuget:?package=MarkdownSnippets.MsBuild&version=28.2.0
#tool nuget:?package=MarkdownSnippets.MsBuild&version=28.2.0
MarkdownSnippets
A dotnet tool or MsBuild Task that extract snippets from code files and merges them into markdown documents.
See https://github.com/SimonCropp/MarkdownSnippets for full documentation.
Behavior
- Recursively scan the target directory for code files containing snippets.
- Recursively scan the target directory for markdown (
.mdormdx) files. - Merge the snippets into those markdown files.
Installation
Ensure dotnet CLI is installed.
Install MarkdownSnippets.Tool
dotnet tool install -g MarkdownSnippets.Tool
Usage
mdsnippets C:\Code\TargetDirectory
If no directory is passed the current directory will be used, but only if it exists with a git repository directory tree. If not an error is returned.
Defining Snippets
Any code wrapped in a convention based comment will be picked up. The comment needs to start with begin-snippet: which is followed by the key. The snippet is then terminated by end-snippet.
// begin-snippet: MySnippetName
My Snippet Code
// end-snippet
Named C# regions will also be picked up, with the name of the region used as the key.
#region MySnippetName
My Snippet Code
#endregion
Using Snippets in Markdown
The raw snippet key can be used in any markdown document by subsequent surrounding it with snippet::
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (26)
Showing the top 20 popular GitHub repositories that depend on MarkdownSnippets.MsBuild:
| Repository | Stars |
|---|---|
|
hardkoded/puppeteer-sharp
Headless Chrome .NET API
|
|
|
VerifyTests/Verify
Verify is a snapshot testing tool that simplifies the assertion of complex data models and documents.
|
|
|
shouldly/shouldly
Should testing for .NET—the way assertions should be!
|
|
|
toddams/RazorLight
Template engine based on Microsoft's Razor parsing engine for .NET Core
|
|
|
SimonCropp/Delta
An approach to implementing a 304 Not Modified leveraging DB change tracking
|
|
|
Fody/Home
The landing page for Fody repositories
|
|
|
SimonCropp/Replicant
A wrapper for HttpClient that caches to disk. Cached files, over the max specified, are deleted based on the last access times.
|
|
|
approvals/ApprovalTests.Net
ApprovalTest verification library for .Net
|
|
|
CopyText/TextCopy
A cross platform package to copy text to and from the clipboard.
|
|
|
SimonCropp/WinDebloat
A dotnet tool that removes the bloat in Windows
|
|
|
spectresystems/snitch
A tool that help you find duplicate transitive package references.
|
|
|
SimonCropp/Polyfill
Source only package that exposes newer APIs, .net features, and C# features to older runtimes.
|
|
|
Abc-Arbitrage/ZeroLog
A high-performance, zero-allocation .NET logging library.
|
|
|
SimonCropp/GraphQL.EntityFramework
Adds EntityFramework Core IQueryable support to GraphQL
|
|
|
justeattakeaway/httpclient-interception
A .NET library for intercepting server-side HTTP requests
|
|
|
SimonCropp/NaughtyStrings
Provides a strong typed .NET API for the Big List of Naughty Strings https://github.com/minimaxir/big-list-of-naughty-strings
|
|
|
destructurama/attributed
Use attributes to control how complex types are logged to Serilog.
|
|
|
VerifyTests/DiffEngine
Manages launching and cleanup of diff tools
|
|
|
SimonCropp/LocalDb
Provides a wrapper around SqlLocalDB to simplify running tests or samples that require a SQL Server Database
|
|
|
SimonCropp/WaffleGenerator
Produces text which, on first glance, looks like real, ponderous, prose; replete with clichés.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 28.2.0 | 0 | 4/15/2026 |
| 28.1.0 | 744 | 4/14/2026 |
| 28.0.2 | 3,538 | 3/30/2026 |
| 28.0.1 | 4,668 | 3/5/2026 |
| 28.0.0 | 5,583 | 2/7/2026 |
| 28.0.0-beta.25 | 2,250 | 1/25/2026 |
| 28.0.0-beta.24 | 336 | 1/24/2026 |
| 28.0.0-beta.23 | 89 | 1/24/2026 |
| 28.0.0-beta.22 | 190 | 1/23/2026 |
| 28.0.0-beta.21 | 128 | 1/23/2026 |
| 28.0.0-beta.20 | 169 | 1/23/2026 |
| 28.0.0-beta.19 | 292 | 1/22/2026 |
| 28.0.0-beta.18 | 221 | 1/22/2026 |
| 28.0.0-beta.17 | 287 | 1/22/2026 |
| 28.0.0-beta.16 | 328 | 1/21/2026 |
| 28.0.0-beta.15 | 336 | 1/21/2026 |
| 28.0.0-beta.13 | 691 | 1/19/2026 |
| 28.0.0-beta.11 | 1,397 | 1/14/2026 |
| 28.0.0-beta.10 | 5,024 | 12/18/2025 |
| 28.0.0-beta.9 | 366 | 12/18/2025 |