Parchment 2.0.0

dotnet add package Parchment --version 2.0.0
                    
NuGet\Install-Package Parchment -Version 2.0.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="Parchment" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Parchment" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Parchment" />
                    
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 Parchment --version 2.0.0
                    
#r "nuget: Parchment, 2.0.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 Parchment@2.0.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=Parchment&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Parchment&version=2.0.0
                    
Install as a Cake Tool

Parchment

Parchment is a Word (.docx) generation library that combines a .NET data model with either a docx template (token replacement) or a markdown template (full content rendering), driven by liquid via Fluid, Markdig, and OpenXmlHtml.

Docx template flow

var store = new TemplateStore();
store.RegisterDocxTemplate<Invoice>("invoice", File.ReadAllBytes("invoice-template.docx"));
var bytes = await store.Render("invoice", SampleData.Invoice());
File.WriteAllBytes("out.docx", bytes);

The template may include:

  • Substitution tokens: {{ customer.name }}
  • Paragraph-scope loops: {% for line in lines %}{% endfor %}
  • Table-row-scope loops: put {% for line in lines %} on its own in one row and {% endfor %} on its own in another
  • Conditionals: {% if customer.is_preferred %}{% endif %}

Markdown template flow

store.RegisterMarkdownTemplate<Report>("report", markdownSource, styleSource: brandDocxBytes);
var bytes = await store.Render("report", reportModel);

Source generator

Decorate the model class itself with [ParchmentModel] and Parchment's source generator validates the template tokens against it at compile time. Both .docx and .md templates are supported.

[ParchmentModel("Templates/invoice.docx")]
public partial class Invoice
{
    public string Number { get; set; } = "";
    // ...
}

[ParchmentModel("Templates/report.md")]
public partial class Report
{
    public string Title { get; set; } = "";
    // ...
}

See the readme for full documentation.

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

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
2.0.0 101 5/22/2026
1.2.0 94 5/22/2026
1.1.1 88 5/19/2026
1.0.3 98 5/19/2026
1.0.2 92 5/18/2026
1.0.1 93 5/18/2026
1.0.0 92 5/13/2026
0.5.0-beta.7 57 5/12/2026
0.5.0-beta.6 53 5/12/2026
0.5.0-beta.5 59 5/12/2026
0.5.0-beta.4 51 5/11/2026
0.5.0-beta.3 58 5/11/2026
0.5.0-beta.2 48 5/11/2026
0.5.0-beta.1 50 5/11/2026
0.4.5 100 5/8/2026
0.4.4 96 5/7/2026
0.4.3 86 5/7/2026
0.4.2 89 5/7/2026
0.4.1 91 5/7/2026
0.4.0 86 5/6/2026
Loading failed