How to run examples

We offer multiple solutions on how you can run GroupDocs.Markdown examples, by building your own or using our back-end or front-end examples.

Build a project from scratch

You can build a project from scratch using Visual Studio or .NET CLI. We’ll step you through both cases.

Build a project using .NET CLI

  1. Make sure you have .NET SDK installed https://dotnet.microsoft.com/download.
  2. Create a directory for your console app by executing the mkdir my-console-app command in your terminal.
  3. Navigate to the my-console-app directory by executing the cd my-console-app command.
  4. Create an empty console app by executing the dotnet new console command.
  5. Add the GroupDocs.Markdown for .NET package by executing the dotnet add package GroupDocs.Markdown command.
  6. Edit Program.cs and add the following lines to the Main method:
  using GroupDocs.Markdown;

  string documentPath = @"C:\sample.docx"; // NOTE: Put here actual path for your document
  string outputPath = @"C:\output\converted.md";

  using (var converter = new MarkdownConverter(documentPath))
  {
  	converter.Convert(CoutputPath);
  }
  1. Replace the documentPath value with the actual path to the document you’re going to convert.
  2. Run the project by executing the dotnet run command.
  3. The converted document will be saved in the C:\\output\\ directory.

Build a project using Visual Studio

  1. Open Visual Studio and go to File -> New -> Project.
  2. Select the appropriate project type - Console App, ASP.NET Web Application etc.
  3. Install GroupDocs.Markdown for .NET from Nuget or the official GroupDocs website following this guide.
  4. Add the following code to the Main method:
  using GroupDocs.Markdown;

  string documentPath = @"C:\sample.docx"; // NOTE: Put here actual path for your document
  string outputPath = @"C:\output\converted.md";

  using (var converter = new MarkdownConverter(documentPath))
  {
  	converter.Convert(CoutputPath);
  }
  1. Replace the documentPath value with the actual path to the document you’re going to convert.
  2. Build and Run your project.
  3. The converted document will be saved in the C:\\output\\ directory.

Run back-end examples

You can find many back-end examples in our GitHub repository. You can either download the ZIP file from here or clone the repository from GitHub using your favorite Git client.
In case you download the ZIP file, extract the folders on your local disk.

  1. Navigate to the Examples directory and open the GroupDocs.Markdown.Examples.CSharp.sln solution using Visual Studio.
  2. Open the RunExamples.cs file and uncomment the example(s) that you would like to run.
  3. Optionally, you can set the path to the license in Utils.cs file.

Run demo projects

To run any demo from GroupDocs.Markdown for .NET Demo projects, you can either:

  • Clone the repository:

    git clone git@github.com:groupdocs-markdown/GroupDocs.Markdown-for-.NET.git  
    
  • or download the source code.

Contribute

If you like to add or improve an example, we encourage you to contribute to the project. All examples in this repository are open source and can be freely used in your own applications.
To contribute, you can fork the repository, edit the code and create a pull request. We will review the changes and include them in the repository if found helpful.