MarkdownToDocxGenerator 1.1.0
dotnet add package MarkdownToDocxGenerator --version 1.1.0
NuGet\Install-Package MarkdownToDocxGenerator -Version 1.1.0
<PackageReference Include="MarkdownToDocxGenerator" Version="1.1.0" />
paket add MarkdownToDocxGenerator --version 1.1.0
#r "nuget: MarkdownToDocxGenerator, 1.1.0"
// Install MarkdownToDocxGenerator as a Cake Addin #addin nuget:?package=MarkdownToDocxGenerator&version=1.1.0 // Install MarkdownToDocxGenerator as a Cake Tool #tool nuget:?package=MarkdownToDocxGenerator&version=1.1.0
MarkdownToDocxGenerator
This library is used to generate a docx file from a folder containing markdown files.
==========
Onboarding Instructions
Installation
- Add nuget package:
Install-Package MarkdownToDocxGenerator
- In your application, you can initialize the tools in the service collection. Open your program.cs or Startup.cs and add the following code:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddMarkdownToDocxGenerator();
});
Note : The library used the ILogger class to generate logs. So you need to register the logger before calling the AddMarkdownToDocxGenerator function.
A MdReportGenenerator object is now registered in the dependency injection container. You can now inject it in your services or controllers.
public class MyService
{
private readonly MdReportGenenerator reportGenerator;
public MyService(MdReportGenenerator reportGenerator)
{
this.reportGenerator = reportGenerator;
}
}
Usage
To work, you need to call the function GenerateReport :
public class MyService
{
private readonly MdReportGenenerator reportGenerator;
public MyService(MdReportGenenerator reportGenerator)
{
this.reportGenerator = reportGenerator;
}
public void GenerateReport()
{
var rootFolder = Path.Combine(Environment.CurrentDirectory, "MdFiles");
var templatePath = Path.Combine(Environment.CurrentDirectory, "Dotx/sample.dotx");
var outputPath = Path.Combine(Environment.CurrentDirectory, "Dotx/sample.docx");
reportGenerator.Transform(outputPath, rootFolder, templatePath);
}
}
The function Transform has 3 parameters :
- outputPath : The path of the output file (Docx file)
- rootFolder : The path of the folder containing the markdown files (MdFiles/*.md)
- templatePath : The path of the template file (Optional. It let you to use a dotx file as template)
IC
Documentation : I want more
Do not hesitate to check unit tests on the solution. It's a good way to check how transformations are tested.
Also, to get more samples, go to the Wiki.
Do not hesitate to contribute.
Support / Contribute
If you have any questions, problems or suggestions, create an issue or fork the project and create a Pull Request.
You want more ? Feel free to create an issue or contribute by adding new functionnalities by forking the project and create a pull request.
And if y like this project, don't forget to star it !
You can also support me with a coffee :
Product | Versions 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. |
.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 was computed. |
.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
- Markdig (>= 0.38.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Console (>= 9.0.0)
- OpenXMLSDK.Engine (>= 2022.10312.0-preview-041)
-
net8.0
- Markdig (>= 0.38.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Console (>= 9.0.0)
- OpenXMLSDK.Engine (>= 2022.10312.0-preview-041)
-
net9.0
- Markdig (>= 0.38.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging.Console (>= 9.0.0)
- OpenXMLSDK.Engine (>= 2022.10312.0-preview-041)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MarkdownToDocxGenerator:
Package | Downloads |
---|---|
MDev.Dotnet.SemanticKernel.Plugins.Oxml.Docx
Plugin for semantic kernel that let you (or the LLM) to create docx documents |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.0 | 156 | 12/16/2024 |
1.1.0-preview-8 | 1,647 | 7/3/2023 |
1.1.0-preview-7 | 132 | 7/3/2023 |
1.1.0-preview-6 | 140 | 6/30/2023 |
1.1.0-preview-5 | 119 | 6/30/2023 |
1.1.0-preview-4 | 129 | 6/26/2023 |
1.1.0-preview-3 | 126 | 6/26/2023 |
1.1.0-preview-12 | 113 | 12/18/2023 |
1.1.0-preview-021 | 66 | 12/16/2024 |
1.1.0-preview-020 | 73 | 12/4/2024 |
1.1.0-preview-019 | 65 | 12/4/2024 |
1.0.0 | 198 | 6/26/2023 |