ktsu.Frontmatter 1.3.0

Prefix Reserved
dotnet add package ktsu.Frontmatter --version 1.3.0
                    
NuGet\Install-Package ktsu.Frontmatter -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ktsu.Frontmatter" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ktsu.Frontmatter" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="ktsu.Frontmatter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ktsu.Frontmatter --version 1.3.0
                    
#r "nuget: ktsu.Frontmatter, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ktsu.Frontmatter@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ktsu.Frontmatter&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=ktsu.Frontmatter&version=1.3.0
                    
Install as a Cake Tool

ktsu.Frontmatter

A .NET library for processing and manipulating YAML frontmatter in markdown files.

License NuGet Version NuGet Version NuGet Downloads GitHub commit activity GitHub contributors GitHub Actions Workflow Status

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-is
  • FrontmatterNaming.Standard: Standardize property names using common conventions

Property Ordering

Control how properties are ordered:

  • FrontmatterOrder.AsIs: Keep properties in the order they appear
  • FrontmatterOrder.Sorted: Sort properties according to standard conventions

Merge Strategies

Control how similar properties are merged:

  • FrontmatterMergeStrategy.None: Do not merge any properties
  • FrontmatterMergeStrategy.Conservative: Only merge properties using predefined mappings
  • FrontmatterMergeStrategy.Aggressive: Merge properties using basic pattern matching
  • FrontmatterMergeStrategy.Maximum: Merge properties using semantic analysis

License

MIT

Product 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ktsu.Frontmatter:

Package Downloads
ktsu.KtsuTools.Markdown

KtsuTools is a unified developer tools suite that consolidates multiple ktsu-dev utilities into a single CLI application with consistent UX powered by Spectre.Console.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 0 9/26/2026
1.2.41 46 9/26/2026
1.2.40 38 9/25/2026
1.2.39 70 9/25/2026
1.2.38 45 9/24/2026
1.2.37 71 9/23/2026
1.2.36 74 9/22/2026
1.2.35 111 9/22/2026
1.2.34 70 9/21/2026
1.2.33 146 9/18/2026
1.2.32 108 9/17/2026
1.2.31 134 9/16/2026
1.2.30 137 9/16/2026
1.2.29 113 9/15/2026
1.2.28 128 9/14/2026
1.2.27 107 9/14/2026
1.2.26 134 9/11/2026
1.2.25 532 9/4/2026
1.2.24 118 9/3/2026
1.2.23 250 8/28/2026
Loading failed

## v1.3.0 (minor)

Changes since v1.2.0:

- Recognise frontmatter delimiters only as whole lines at the top of a document ([@Claude](https://github.com/Claude))
- [patch] Stop a single-character key being containment-matched onto unrelated properties ([@Claude](https://github.com/Claude))
- Key the content caches by their input, not a 32-bit hash ([@Claude](https://github.com/Claude))
- [patch] Clear the five SonarCloud findings on the new code ([@Claude](https://github.com/Claude))
- [patch] Fold the two NormalizePropertyName helpers and stop decoration-only keys being renamed ([@Claude](https://github.com/Claude))
- Throw rather than assert on the nullable in the test helper ([@Claude](https://github.com/Claude))
- [patch] Rank standardized property names by fuzzy similarity ([@Claude](https://github.com/Claude))
- Gate Dependabot auto-merge on CI actually being green ([@Claude](https://github.com/Claude))
- ci: adopt the consolidated .NET workflow [patch] ([@Claude](https://github.com/Claude))
- fix: parse frontmatter by the document's line endings, not the host's [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- ci: make the SonarQube quality gate opt in [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- ci: adopt the unified dotnet workflow [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- chore: store icon.png in LFS as .gitattributes declares ([@matt-edmondson](https://github.com/matt-edmondson))
- docs: scope build badge to the default branch ([@matt-edmondson](https://github.com/matt-edmondson))
- docs: correct README, DESCRIPTION and TAGS metadata ([@matt-edmondson](https://github.com/matt-edmondson))
- Stop Update SDKs failing when there is nothing to update ([@matt-edmondson](https://github.com/matt-edmondson))
- Fix build errors from ktsu.Sdk analyzer update [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- Sync .editorconfig ([@KtsuTools](https://github.com/KtsuTools))
- Sync global.json ([@KtsuTools](https://github.com/KtsuTools))
- chore: update ktsu.Sdk to 2.21.1 [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- chore: remove unused SourceLink package versions ([@matt-edmondson](https://github.com/matt-edmondson))
- chore: remove redundant package version and source link entries ([@matt-edmondson](https://github.com/matt-edmondson))
- Add TAGS.md with NuGet package tags ([@matt-edmondson](https://github.com/matt-edmondson))
- Remove legacy build scripts ([@matt-edmondson](https://github.com/matt-edmondson))
- 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))