MarkdownToDocxGenerator 1.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MarkdownToDocxGenerator --version 1.0.0
NuGet\Install-Package MarkdownToDocxGenerator -Version 1.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="MarkdownToDocxGenerator" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MarkdownToDocxGenerator --version 1.0.0
#r "nuget: MarkdownToDocxGenerator, 1.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.
// Install MarkdownToDocxGenerator as a Cake Addin
#addin nuget:?package=MarkdownToDocxGenerator&version=1.0.0

// Install MarkdownToDocxGenerator as a Cake Tool
#tool nuget:?package=MarkdownToDocxGenerator&version=1.0.0

MarkdownToDocxGenerator

This library is used to generate a docx file from a folder containing markdown files.

==========

Onboarding Instructions

Installation

  1. Add nuget package:

Install-Package MarkdownToDocxGenerator

  1. 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

Quality Gate Status .NET NuGet package

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.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 was computed.  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. 
.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. 
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
1.1.0-preview-8 357 7/3/2023
1.1.0-preview-7 109 7/3/2023
1.1.0-preview-6 114 6/30/2023
1.1.0-preview-5 93 6/30/2023
1.1.0-preview-4 100 6/26/2023
1.1.0-preview-3 101 6/26/2023
1.1.0-preview-12 79 12/18/2023
1.0.0 150 6/26/2023