DocuChef 0.1.1
dotnet add package DocuChef --version 0.1.1
NuGet\Install-Package DocuChef -Version 0.1.1
<PackageReference Include="DocuChef" Version="0.1.1" />
<PackageVersion Include="DocuChef" Version="0.1.1" />
<PackageReference Include="DocuChef" />
paket add DocuChef --version 0.1.1
#r "nuget: DocuChef, 0.1.1"
#:package DocuChef@0.1.1
#addin nuget:?package=DocuChef&version=0.1.1
#tool nuget:?package=DocuChef&version=0.1.1
DocuChef
The Master Chef for Document Templates - Cook delicious documents with your data and templates.
Overview
DocuChef provides a unified interface for document generation across multiple formats. It supports Excel document generation using ClosedXML.Report.XLCustom and PowerPoint document generation using DollarSignEngine, with future plans to integrate additional template engines for Word documents.
In the spirit of its culinary name, DocuChef offers both standard API methods and fun cooking-themed extension methods that make template processing feel like preparing a delicious dish!
Current Features
- Excel Template Processing: Generate Excel documents from templates using ClosedXML.Report.XLCustom
- PowerPoint Template Processing: Generate PowerPoint presentations from templates with embedded variables and functions
- Flexible Variable Binding: Add variables, complex objects, collections to your templates
- Global Variables: Access system information and date/time within your templates
- Custom Function Support: Register custom functions for Excel cell processing and PowerPoint shape processing
- Error Handling: Clear error reporting with specialized exception types
- Culinary API Theme: Optional cooking-themed extension methods for a more enjoyable API experience
- Consistent Document Interface: All document types implement the
IDish
interface for unified handling
Planned Features
- Word document support
- Additional built-in functions for Excel and PowerPoint templates
- Enhanced PowerPoint chart and table functionality
- Enhanced formatting options
Installation
Install-Package DocuChef
Or via .NET CLI:
dotnet add package DocuChef
Quick Start
Standard API Usage
// Create document processor
var chef = new Chef();
// Load your template (Excel or PowerPoint)
var recipe = chef.LoadTemplate("template.xlsx"); // or "template.pptx"
// Add your data
recipe.AddVariable("Title", "Sales Report");
recipe.AddVariable("Products", productList);
recipe.AddVariable("Date", DateTime.Now);
// Generate and save the document
recipe.Cook("result.xlsx"); // or "result.pptx"
Culinary-themed API
// Create document processor
var chef = new Chef();
// Load your recipe (template)
var recipe = chef.LoadRecipe("template.xlsx"); // or "template.pptx"
// Add ingredients (variables)
recipe.AddIngredient("Title", "Sales Report");
recipe.AddIngredients(productData); // Add all properties from an object
// Cook the document and serve it
var dish = recipe.CookDish();
dish.Serve("result.xlsx"); // or "result.pptx"
// Optionally, present the dish to the user
dish.Present(); // Opens in default application
One-step Document Generation
// Create document processor
var chef = new Chef();
// Prepare a dish directly from a template and data
chef.PrepareDish("template.xlsx", salesData, "result.xlsx");
Working with Excel Templates
Excel-specific Features
// Load Excel template
var recipe = chef.LoadTemplate("template.xlsx");
// Register custom functions for Excel processing
recipe.RegisterFunction("FormatCurrency", (cell, value, parameters) => {
if (value is decimal amount)
{
cell.Style.NumberFormat.Format = "$#,##0.00";
return amount;
}
return value;
});
// Or using the culinary API
recipe.RegisterTechnique("FormatCurrency", (cell, value, parameters) => {
// Same implementation
});
recipe.Cook("result.xlsx");
Working with PowerPoint Templates
PowerPoint Features
// Load PowerPoint template
var recipe = chef.LoadTemplate("template.pptx");
var categories = new List<Category>();
recipe.AddVariable("Categories", categories);
// recipe.AddVariable(data);
// Generate the presentation
recipe.Cook("result.pptx");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 was computed. 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. |
-
net8.0
- DollarSignEngine (>= 1.3.4)
- Iyulab.ClosedXML.Report (>= 0.2.12)
-
net9.0
- DollarSignEngine (>= 1.3.4)
- Iyulab.ClosedXML.Report (>= 0.2.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.