Skip to content
18 changes: 9 additions & 9 deletions Document-Processing/Markdown/Conversions/html-conversions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ documentation: UG

# Markdown to HTML and HTML to Markdown Conversions

Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to HTML document and vice versa.
Markdown is a lightweight markup language that adds formatting elements to plain text documents. The Syncfusion<sup>&reg;</sup> .NET Word (DocIO) library supports converting Markdown to an HTML document and vice versa.

## Assemblies and NuGet packages required

Refer to the following links for assemblies and NuGet packages required based on platforms to convert between Markdown and HTML documents using the .NET Word Library.
Refer to the following links for the assemblies and NuGet packages required, based on the target platform, to convert between Markdown and HTML documents using the .NET Word Library.

* [Markdown conversions assemblies](https://help.syncfusion.com/document-processing/word/word-library/net/assemblies-required)
* [Markdown conversions NuGet packages](https://help.syncfusion.com/document-processing/word/word-library/net/nuget-packages-required)
Expand Down Expand Up @@ -40,15 +40,15 @@ using (WordDocument document = new WordDocument(Path.GetFullPath("Input.md")))
//Open an existing Markdown file.
using (WordDocument document = new WordDocument("Input.md"))
{
//Save as a HTML document.
//Save as an HTML document.
document.Save("Output.html");
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
'Open an existing Markdown file.
Using document As WordDocument = New WordDocument("Input.md")
'Save as a HTML document.
'Save as an HTML document.
document.Save("Output.html")
End Using
{% endhighlight %}
Expand Down Expand Up @@ -172,7 +172,7 @@ End Sub

{% endtabs %}

N> Hook the event handler before opening a Markdown document as per the above code example.
N> Hook the event handler before opening a Markdown document as shown in the above code example.

### Encoding

Expand Down Expand Up @@ -282,20 +282,20 @@ The following code example illustrates how to save Image files during an HTML to
{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
//Open an existing HTML document.
//Open an existing HTML document.
using (WordDocument document = new WordDocument(@"Input.html"))
{
//Hook the event to customize the image.
//Hook the event to customize the image.
document.SaveOptions.MarkdownSaveOptions.ImageNodeVisited += SaveImage;
//Save an HTML document as a Markdown file.
document.Save("HtmlToMd.md", FormatType.Markdown);
}
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
'Open an existing HTML document.
'Open an existing HTML document.
Using document As WordDocument = New WordDocument("Input.html")
'Hook the event to customize the image.
'Hook the event to customize the image.
document.SaveOptions.MarkdownSaveOptions.ImageNodeVisited += SaveImage
'Save an HTML document as a Markdown file.
document.Save("HtmlToMd.md", FormatType.Markdown)
Expand Down
6 changes: 3 additions & 3 deletions Document-Processing/Markdown/Conversions/markdown-to-pdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation: UG

# Markdown to PDF Conversion

Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to PDF document.
Markdown is a lightweight markup language that adds formatting elements to plain text documents. The .NET Word library supports the conversion of Markdown to a PDF document.

## Assemblies and NuGet packages required

Expand All @@ -21,7 +21,7 @@ Refer to the following links for assemblies and NuGet packages required based on

Convert an existing markdown file to a PDF document using the .NET Word library.

The following code example shows how to convert Markdown to PDF document.
The following code example shows how to convert a Markdown file to a PDF document.

N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications.

Expand Down Expand Up @@ -88,7 +88,7 @@ When opening an existing Markdown document, the .NET Word library provides custo

The .NET Word library provides an `ImageNodeVisited` event, which customizes image data while importing a Markdown file. Implement the logic to customize the image data by using this `ImageNodeVisited` event.

The following code example shows how to load image data based on the image source path when importing the Markdown files.
The following code example shows how to load image data based on the image source path when importing the Markdown file.

{% tabs %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ control: Markdown
documentation: UG
---

# Assemblies Required for Markdown
# Assemblies Required for .NET Markdown Library

The following assemblies need to be referenced in your application to use the .NET Markdown library.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ documentation: UG

# Loading and Saving a Markdown Document

The Syncfusion<sup>&reg;</sup> Markdown library allows you to load an existing Markdown document and save it to the file system or stream programmatically.
The Syncfusion<sup>&reg;</sup> .NET Markdown library allows you to load an existing Markdown document and save it to the file system or stream programmatically.

## Namespaces required

The following namespaces of Essential<sup>&reg;</sup> Markdown need to be included in your application to load and save the Markdown document.
The following namespaces need to be included in your application to load and save a Markdown document.

N> Refer to the appropriate tabs in the code snippets section: ***C#*** for ASP.NET Core, Blazor, ASP.NET MVC, UWP, .NET MAUI, WinUI, WinForms and WPF; ***VB.NET*** for VB.NET applications.

Expand Down Expand Up @@ -283,7 +283,6 @@ MarkdownDocument markdownDocument = new MarkdownDocument();
// Opens an existing Markdown document using the Open method.
markdownDocument.Open("Input.md");
// To-Do some manipulation
// To-Do some manipulation
// Saves the Markdown document to the file system
markdownDocument.Save("Output.md");
// Disposes the document to release all memory
Expand All @@ -298,7 +297,6 @@ Dim markdownDocument As New MarkdownDocument()
' Opens an existing Markdown document using the Open method.
markdownDocument.Open("Input.md")
'To-Do some manipulation
'To-Do some manipulation
' Saves the Markdown document to the file system
markdownDocument.Save("Output.md")
' Disposes the document to release all memory
Expand All @@ -323,7 +321,6 @@ MarkdownDocument markdownDocument = new MarkdownDocument();
// Opens an existing Markdown document using the Open method.
markdownDocument.Open("Input.md");
// To-Do some manipulation
// To-Do some manipulation
// Creates an instance of memory stream
MemoryStream stream = new MemoryStream();
// Saves the Markdown document to the stream
Expand All @@ -340,7 +337,6 @@ Dim markdownDocument As New MarkdownDocument()
' Opens an existing Markdown document using the Open method.
markdownDocument.Open("Input.md")
'To-Do some manipulation
'To-Do some manipulation
'Creates an instance of memory stream
Dim stream As New MemoryStream()
' Saves the Markdown document to the stream
Expand Down Expand Up @@ -453,7 +449,6 @@ The following code example demonstrates how to get the Markdown content as text.
// Opens an existing Markdown document.
MarkdownDocument markdownDocument = new MarkdownDocument("Input.md");
// To-Do some manipulation
// To-Do some manipulation
// Retrieves the Markdown document content as text.
string mdContent = markdownDocument.GetMarkdownText();
// Disposes the document to release all memory
Expand All @@ -466,7 +461,6 @@ markdownDocument.Dispose();
' Opens an existing Markdown document.
Dim markdownDocument As MarkdownDocument = New MarkdownDocument("../../Data/Input.md")
' To-Do some manipulation
' To-Do some manipulation
' Retrieves the Markdown document content as text.
Dim mdContent As String = markdownDocument.GetMarkdownText()
' Disposes the document to release all memory
Expand All @@ -491,7 +485,6 @@ Once the document manipulation and save operations are completed, you should clo
// Opens, saves and closes a Markdown document.
MarkdownDocument markdownDocument = new MarkdownDocument("Input.md");

// To-Do some manipulation
// To-Do some manipulation

// Saves the Markdown document to the file system
Expand All @@ -507,7 +500,6 @@ markdownDocument.Dispose();
' Opens, saves and closes a Markdown document.
Dim markdownDocument As New MarkdownDocument("Input.md")

'To-Do some manipulation
'To-Do some manipulation

' Saves the Markdown document to the file system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ control: Markdown
documentation: UG
---

# NuGet Packages Required for Markdown Library
# NuGet Packages Required for .NET Markdown Library

## Installing Syncfusion<sup>&reg;</sup> Markdown through NuGet Packages

NuGet is the one of the easiest way to download and install Markdown library to create, read, and edit the Markdown documents. The following NuGet packages need to be installed in your application.
NuGet is one of the easiest ways to download and install the Markdown library to create, read, and edit Markdown documents. The following NuGet package needs to be installed in your application.

<table>
<thead>
Expand Down Expand Up @@ -44,7 +44,7 @@ N> 2. Starting with v34.x.x, if you reference Syncfusion® assemblies from trial

## NuGet Package Installation and Uninstallation

To use Syncfusion<sup>&reg;</sup> NuGet packages in your project, please refer the NuGet Package [Installation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-packages) and [Uninstallation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-uninstallation-process#) sections.
To use Syncfusion<sup>&reg;</sup> NuGet packages in your project, refer to the NuGet package [Installation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-packages) and [Uninstallation](https://help.syncfusion.com/extension/syncfusion-nuget-packages/nuget-uninstallation-process#) sections.

Markdown NuGet packages can be installed and uninstalled using Package Manager Console.

Expand Down
4 changes: 2 additions & 2 deletions Document-Processing/Markdown/Markdown-Library/NET/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ documentation: UG
---
# Overview of Syncfusion<sup>&reg;</sup> Markdown library

Essential<sup>&reg;</sup> Markdown Document Processing library is a native .NET Markdown library that is used by developers to create, read, edit, and manage Markdown documents by using C#, VB.NET, and managed C++ code from any of the following .NET platforms — Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, and .NET MAUI applications.
Essential<sup>&reg;</sup> Markdown Document Processing library is a native .NET library used by developers to create, read, edit, and manage Markdown documents in C# and VB.NET from Windows Forms, WPF, ASP.NET MVC, ASP.NET Core, Blazor, and .NET MAUI applications.

It is a non-UI component that provides a full-fledged document instance model to interact with the Markdown document elements programmatically and perform the necessary manipulation. The library is built from scratch in C# and does not require any Markdown editor or third-party tools to be installed on the machine.
It is a non-UI component that provides a full-fledged document instance model to interact with Markdown document elements programmatically and perform the required operations. The library is built from scratch in C# and does not require any Markdown editor or third-party tools to be installed on the machine.

**Key Features**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ documentation: UG

# Working with Images in Markdown Library

Images are essential elements of Markdown documents that enhance visual communication and documentation. The Syncfusion<sup>&reg;</sup> Markdown library facilitates adding, modifying, and managing images in a Markdown document. Images in Markdown are represented by the `MdPicture` class, which is an inline element that can be added to a `MdParagraph`. The library supports both URL-based and byte array-based images, allowing you to reference external image files or embed images directly into the document.
Images are essential elements of Markdown documents that enhance visual communication and documentation. The Syncfusion<sup>&reg;</sup> .NET Markdown library facilitates adding, modifying, and managing images in a Markdown document. Images in Markdown are represented by the `MdPicture` class, which can be added to the inline collection of an `MdParagraph`. The library supports both URL-based and byte array-based images, allowing you to reference external image files or embed images directly into the document. Supported image formats include PNG, JPEG, BMP, GIF, WebP, and SVG.

When saving a Markdown document using the `Save(fileName)` overloads, the library creates a new folder parallel to the output file name and exports all the images into it as default.
When saving a Markdown document using the `Save(fileName)` overloads, the library creates a new folder parallel to the output file name and exports all the images into it by default.

When using the `Save(Stream)` overloads, the library preserves the images as base64 format in the output Markdown file as default.
When using the `Save(Stream)` overloads, the library preserves the images as base64 data URIs in the output Markdown file by default.

If the image contains both a URL and stream values, or contains only a URL, the URL will be used in the output document.

Expand Down Expand Up @@ -66,7 +66,9 @@ markdownDocument.Dispose()

{% endtabs %}

## Adding image from file path
A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-image-from-URL/.NET).

## Adding an image from a file path

The Syncfusion Markdown library supports adding images from file paths. The following code example demonstrates how to add an image from a file path.

Expand Down Expand Up @@ -112,11 +114,13 @@ markdownDocument.Dispose()

{% endtabs %}

A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-image-from-local-file-path/.NET).

## Adding image from image bytes

The Syncfusion Markdown library allows embedding images directly into a Markdown document using byte arrays. This is particularly useful when you need to include images that are dynamically generated, retrieved from a database, or loaded from memory.
The Syncfusion<sup>&reg;</sup> .NET Markdown library allows embedding images directly into a Markdown document using byte arrays. This is useful when you need to include images that are dynamically generated, retrieved from a database, or loaded from memory. When the document is saved with the `Save(fileName)` overload, the bytes are written to the auto-generated images folder; when saved with the `Save(Stream)` overload, the bytes are embedded as a base64 data URI.

The following code example demonstrates how to add an image from a image bytes.
The following code example demonstrates how to add an image from a byte array.

{% tabs %}

Expand Down Expand Up @@ -164,7 +168,7 @@ markdownDocument.Dispose()

{% endtabs %}


A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-image-from-image-bytes/.NET).

## Replacing images

Expand Down Expand Up @@ -235,7 +239,7 @@ markdownDocument.Dispose()

{% endtabs %}


A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Replacing-image/.NET).

## Removing images

Expand Down Expand Up @@ -301,13 +305,13 @@ markdownDocument.Dispose()
{% endtabs %}



A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Removing-image/.NET).

## Working with alternative text

Alternative text (alt text) is essential for accessibility, providing textual descriptions of images for screen readers and situations where images cannot be displayed. The Syncfusion Markdown library allows you to set and modify alternative text for images using the `AltText` property.

The following code example demonstrates how to add descriptive alternative text to images.
The following code example demonstrates how to add descriptive alternative text to an image.

{% tabs %}

Expand Down Expand Up @@ -355,7 +359,7 @@ markdownDocument.Dispose();

{% endtabs %}


A complete working sample is available on [GitHub](https://github.com/SyncfusionExamples/Markdown-Examples/tree/master/Image/Add-alternative-text/.NET).



Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ markdownDocument.Dispose();

## Applying paragraph styles

Paragraph styles define the visual appearance of a paragraph in a Markdown document. The Syncfusion Markdown library supports heading styles (Heading 1 through Heading 6), blockquote style, and the default normal paragraph style. You can apply a style to a paragraph by using the `ApplyParagraphStyle` method of the `MdParagraph` class.
Paragraph styles define the visual appearance of a paragraph in a Markdown document. The Syncfusion<sup>&reg;</sup> .NET Markdown library supports heading styles (Heading 1 through Heading 6), the blockquote style, and the default paragraph style (Normal). You can apply a style to a paragraph by using the `ApplyParagraphStyle` method of the `MdParagraph` class. Omitting the call leaves the paragraph in the default Normal style.

The following are the supported paragraph styles in the Syncfusion Markdown library:

Expand Down Expand Up @@ -504,7 +504,7 @@ markdownDocument.Dispose()

## Working with hyperlinks

Hyperlink is a reference to data that can link to external content like images, files, webpage, and more. In a Markdown document, a hyperlink may target to any one of the following sources:
A hyperlink is a reference to data that can link to external content such as images, files, webpages, and more. In a Markdown document, a hyperlink may target any one of the following sources:

* Webpage: Represents the web content.
* File: Represents the file in some location.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ documentation: UG

# Working with Code Blocks

Code blocks are fundamental elements in technical documentation and Markdown documents used to display programming code, configuration files, command-line instructions, and other preformatted text. The Syncfusion<sup>&reg;</sup> Markdown library enables you to create, modify, and manage code blocks programmatically in a Markdown document. Code blocks are represented by the `MdCodeBlock` class.
Code blocks are fundamental elements in technical documentation and Markdown documents. They are used to display programming code, configuration files, command-line instructions, and other preformatted text. The Syncfusion<sup>&reg;</sup> .NET Markdown library enables you to create, modify, and manage code blocks programmatically in a Markdown document. Code blocks are represented by the `MdCodeBlock` class.

## Types of code blocks

The Syncfusion Markdown library supports two primary types of code blocks:
The Syncfusion<sup>&reg;</sup> .NET Markdown library supports two primary types of code blocks:

* **Fenced code blocks**: Code blocks enclosed with triple backticks (```) or triple tildes (~~~), allowing optional language specification for syntax highlighting.
* **Indented code blocks**: Traditional code blocks created by indenting each line with four spaces or one tab.

N> The `IsFencedCode` property controls the code block type. By default, code blocks are created as fenced code blocks.

## Creating fenced code blocks
## Creating a fenced code block

You can add a code block to a `MarkdownDocument` by using the `AddCodeBlock` method. The following code example demonstrates how to create a fenced code block explicitly.

Expand Down Expand Up @@ -124,10 +124,9 @@ markdownDocument.Dispose()
{% endtabs %}


## Modifying an existing code block

## Modifying existing code blocks

Existing code blocks in a parsed Markdown document can be modified by iterating through the blocks and updating the `Lines` collection. The following code example demonstrates how to modify code blocks.
Existing code blocks in a parsed Markdown document can be modified by iterating through the blocks and updating the `Lines` collection. The following code example demonstrates how to modify a code block.

{% tabs %}

Expand Down
Loading