ktsu.Frontmatter
1.2.6
Prefix Reserved
See the version list below for details.
dotnet add package ktsu.Frontmatter --version 1.2.6
NuGet\Install-Package ktsu.Frontmatter -Version 1.2.6
<PackageReference Include="ktsu.Frontmatter" Version="1.2.6" />
<PackageVersion Include="ktsu.Frontmatter" Version="1.2.6" />
<PackageReference Include="ktsu.Frontmatter" />
paket add ktsu.Frontmatter --version 1.2.6
#r "nuget: ktsu.Frontmatter, 1.2.6"
#:package ktsu.Frontmatter@1.2.6
#addin nuget:?package=ktsu.Frontmatter&version=1.2.6
#tool nuget:?package=ktsu.Frontmatter&version=1.2.6
ktsu.Frontmatter
A .NET library for processing and manipulating YAML frontmatter in markdown files.
Features
- Extract, add, replace, and remove frontmatter from markdown documents
- Combine multiple frontmatter sections into a single section
- Standardize property names using intelligent matching
- Sort properties according to standard conventions
- Merge similar properties using different strategies
- High performance with caching for repeated operations
Installation
dotnet add package ktsu.Frontmatter
Usage
using ktsu.Frontmatter;
// Extract frontmatter from a markdown document
string markdown = File.ReadAllText("document.md");
var frontmatter = Frontmatter.ExtractFrontmatter(markdown);
// Add frontmatter to a document
var properties = new Dictionary<string, object>
{
{ "title", "My Document" },
{ "date", DateTime.Now },
{ "tags", new[] { "documentation", "markdown" } }
};
string withFrontmatter = Frontmatter.AddFrontmatter(markdown, properties);
// Replace frontmatter
string replaced = Frontmatter.ReplaceFrontmatter(markdown, properties);
// Remove frontmatter
string withoutFrontmatter = Frontmatter.RemoveFrontmatter(markdown);
// Combine multiple frontmatter sections
string combined = Frontmatter.CombineFrontmatter(markdown);
// Customize property naming and ordering
string customized = Frontmatter.CombineFrontmatter(
markdown,
FrontmatterNaming.Standard, // Standardize property names
FrontmatterOrder.Sorted, // Sort properties in standard order
FrontmatterMergeStrategy.Conservative // Merge similar properties
);
// Extract just the document body (content after frontmatter)
string body = Frontmatter.ExtractBody(markdown);
Advanced Features
Property Naming
Control how property names are handled:
FrontmatterNaming.AsIs: Keep property names as-isFrontmatterNaming.Standard: Standardize property names using common conventions
Property Ordering
Control how properties are ordered:
FrontmatterOrder.AsIs: Keep properties in the order they appearFrontmatterOrder.Sorted: Sort properties according to standard conventions
Merge Strategies
Control how similar properties are merged:
FrontmatterMergeStrategy.None: Do not merge any propertiesFrontmatterMergeStrategy.Conservative: Only merge properties using predefined mappingsFrontmatterMergeStrategy.Aggressive: Merge properties using basic pattern matchingFrontmatterMergeStrategy.Maximum: Merge properties using semantic analysis
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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 is compatible. |
| .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
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
.NETStandard 2.1
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
net10.0
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
net5.0
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
net6.0
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
net7.0
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
net8.0
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
-
net9.0
- HashDepot (>= 2.0.3)
- ktsu.Extensions (>= 1.5.14)
- ktsu.FuzzySearch (>= 1.2.8)
- Microsoft.SourceLink.AzureRepos.Git (>= 10.0.103)
- Microsoft.SourceLink.GitHub (>= 10.0.103)
- Polyfill (>= 9.9.0)
- YamlDotNet (>= 16.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.7-pre.1 | 37 | 2/17/2026 |
| 1.2.6 | 45 | 2/16/2026 |
| 1.2.5 | 81 | 2/16/2026 |
| 1.2.5-pre.1 | 48 | 2/16/2026 |
| 1.2.4 | 79 | 2/14/2026 |
| 1.2.3 | 80 | 2/14/2026 |
| 1.2.3-pre.12 | 39 | 2/11/2026 |
| 1.2.3-pre.11 | 42 | 2/6/2026 |
| 1.2.3-pre.10 | 48 | 2/5/2026 |
| 1.2.3-pre.9 | 48 | 2/4/2026 |
| 1.2.3-pre.8 | 42 | 2/3/2026 |
| 1.2.3-pre.7 | 50 | 2/3/2026 |
| 1.2.3-pre.6 | 41 | 2/2/2026 |
| 1.2.3-pre.5 | 53 | 2/1/2026 |
| 1.2.3-pre.4 | 45 | 1/31/2026 |
| 1.2.3-pre.3 | 45 | 1/31/2026 |
| 1.2.3-pre.2 | 49 | 1/31/2026 |
| 1.2.3-pre.1 | 46 | 1/30/2026 |
| 1.2.2 | 92 | 1/30/2026 |
| 1.2.2-pre.3 | 47 | 1/29/2026 |
## v1.2.6 (patch)
Changes since v1.2.5:
- Bump Polyfill from 9.8.1 to 9.9.0 ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Bump the ktsu group with 2 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.5 (patch)
Changes since v1.2.4:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.5-pre.1 (prerelease)
No significant changes detected since v1.2.5.
## v1.2.4 (patch)
Changes since v1.2.3:
- Remove legacy build scripts ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.2.3 (patch)
Changes since v1.2.2:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Bump the microsoft group with 2 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Bump the microsoft group with 2 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Bump MSTest.Sdk from 4.0.2 to 4.1.0 ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Bump Polyfill from 9.7.7 to 9.8.1 ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Bump the ktsu group with 1 update ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync COPYRIGHT.md ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync COPYRIGHT.md ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Bump the ktsu group with 5 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.3-pre.12 (prerelease)
Changes since v1.2.3-pre.11:
- Bump the microsoft group with 2 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.3-pre.11 (prerelease)
Changes since v1.2.3-pre.10:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.3-pre.10 (prerelease)
Changes since v1.2.3-pre.9:
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Bump the microsoft group with 2 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.3-pre.9 (prerelease)
Changes since v1.2.3-pre.8:
- Bump MSTest.Sdk from 4.0.2 to 4.1.0 ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.3-pre.8 (prerelease)
Changes since v1.2.3-pre.7:
- Bump Polyfill from 9.7.7 to 9.8.1 ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.3-pre.7 (prerelease)
Changes since v1.2.3-pre.6:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.3-pre.6 (prerelease)
Changes since v1.2.3-pre.5:
- Bump the ktsu group with 1 update ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.3-pre.5 (prerelease)
Changes since v1.2.3-pre.4:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.3-pre.4 (prerelease)
Changes since v1.2.3-pre.3:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync COPYRIGHT.md ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.3-pre.3 (prerelease)
Changes since v1.2.3-pre.2:
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync scripts\PSBuild.psm1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.3-pre.2 (prerelease)
Changes since v1.2.3-pre.1:
- Sync scripts\update-winget-manifests.ps1 ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync COPYRIGHT.md ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.3-pre.1 (prerelease)
No significant changes detected since v1.2.3.
## v1.2.2 (patch)
Changes since v1.2.1:
- Remove .github\workflows\project.yml ([@matt-edmondson](https://github.com/matt-edmondson))
- Bump Polyfill from 9.7.6 to 9.7.7 ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Bump the ktsu group with 5 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
- Merge remote-tracking branch 'refs/remotes/origin/main' ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync global.json ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .github\workflows\dotnet.yml ([@ktsu[bot]](https://github.com/ktsu[bot]))
- Sync .gitignore ([@ktsu[bot]](https://github.com/ktsu[bot]))
## v1.2.2-pre.3 (prerelease)
Changes since v1.2.2-pre.2:
- Bump Polyfill from 9.7.6 to 9.7.7 ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.2-pre.2 (prerelease)
Changes since v1.2.2-pre.1:
- Bump the ktsu group with 5 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))
## v1.2.2-pre.1 (prerelease)
No significant changes detected since v1.2.2.
## v1.2.1 (patch)
Changes since v1.2.0:
- Migrate to dotnet 10 ([@matt-edmondson](https://github.com/matt-edmondson))
- Update project configuration and scripts for improved build processes ([@matt-edmondson](https://github.com/matt-edmondson))
- Update configuration files and scripts for improved build and test processes ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove obsolete build configuration files and scripts ([@matt-edmondson](https://github.com/matt-edmondson))
- Update project SDK references in Frontmatter and Frontmatter.Test ([@matt-edmondson](https://github.com/matt-edmondson))
- Enhance Frontmatter validation and refactor PropertyMerger logic ([@matt-edmondson](https://github.com/matt-edmondson))
- Enhance Frontmatter and PropertyMerger functionality ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor YamlSerializer for improved deserialization and serialization ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor YamlSerializer for improved deserialization and serialization ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor Frontmatter extraction and PropertyMerger logic ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor NameStandardizer and PropertyMerger for improved property mapping ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor PropertyMerger and YamlSerializer for improved performance and reliability ([@matt-edmondson](https://github.com/matt-edmondson))
- Enhance PropertyMerger and YamlSerializer functionality ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor Frontmatter and PropertyMerger logic ([@matt-edmondson](https://github.com/matt-edmondson))
- Refactor Frontmatter extraction and standardization logic ([@matt-edmondson](https://github.com/matt-edmondson))
- Add additional unit tests for Frontmatter functionality ([@matt-edmondson](https://github.com/matt-edmondson))
- Add comprehensive unit tests for Frontmatter handling ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove obsolete test methods from PropertyMergerTests ([@matt-edmondson](https://github.com/matt-edmondson))
- Add unit tests for PropertyMerger's similarity mapping ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove obsolete test files for PropertyMerger ([@matt-edmondson](https://github.com/matt-edmondson))
- Add isolation tests for PropertyMerger class ([@matt-edmondson](https://github.com/matt-edmondson))
- Add unit tests for PropertyMerger class ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.2.0 (minor)
Changes since v1.1.0:
- Add unit tests for Frontmatter functionality and update solution file ([@matt-edmondson](https://github.com/matt-edmondson))
## v1.1.0 (major)
- Initial commit ([@matt-edmondson](https://github.com/matt-edmondson))