Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -7862,11 +7862,29 @@
<a href="/document-processing/markdown/markdown-library/overview">Markdown Library</a>
<ul>
<li>
<a href="/document-processing/markdown/markdown-library/net/overview">Overview</a>
</li>
<li>
<a href="/document-processing/markdown/markdown-library/net/Getting-Started">Getting Started</a>
</li>
<a href="/document-processing/markdown/markdown-library/net/overview">NET</a>
<ul>
<li>
<a href="/document-processing/markdown/markdown-library/net/overview">Overview</a>
</li>
<li>
<a href="/document-processing/markdown/markdown-library/net/Assemblies-Required">Assemblies Required</a>
</li>
<li>
<a href="/document-processing/markdown/markdown-library/net/NuGet-Packages-Required">NuGet Packages Required</a>
</li>
<li>
<a href="/document-processing/markdown/markdown-library/net/Getting-Started">Getting Started</a>
</li>
<li>
<a href="/document-processing/markdown/markdown-library/net/Document-Object-Model-representation">Document Object Model representation</a>
</li>
<li>
<a href="/document-processing/markdown/markdown-library/net/Loading-and-Saving-document">Loading and Saving document</a>
</li>
</ul>
</li>

</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Assemblies required for .NET Markdown Library | Syncfusion
description: Learn the assemblies required to use the .NET Markdown library to create, read, and edit Markdown documents in your application.
platform: document-processing
control: Markdown
documentation: UG
---

# Assemblies Required for Markdown

The following assemblies need to be referenced in your application to use the Syncfusion<sup>&reg;</sup> Markdown library.

<table>
<thead>
<tr>
<th>Platform(s)<br/><br/></th>
<th>Assembly<br/><br/></th>
</tr>
</thead>
<tbody>
<tr>
<td>
Windows Forms, WPF, ASP.NET MVC
<br/><br/></td>
<td>
Syncfusion.Markdown.Base
<br/><br/></td>
</tr>
<tr>
<td>
ASP.NET Core, Blazor
<br/><br/></td>
<td>
Syncfusion.Markdown.Portable
<br/><br/></td>
</tr>
</tbody>
</table>

T> 1. Switch to NuGet packages for a seamless experience:
T> * Get frequent bug fixes every week.
T> * Upgrade quickly with no manual effort.
T> Note: To avoid trial watermark when using NuGet packages, it is recommended to register license key in application. Please refer to this [link](https://help.syncfusion.com/common/essential-studio/licensing/overview) to know about registering Syncfusion<sup>&reg;</sup> license key in your application to use our components.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Document Object Model of .NET Markdown library | Syncfusion
description: Learn here all about the Document Object Model (DOM) representation of Markdown documents and their elements in the Syncfusion .NET Markdown library.
platform: document-processing
control: Markdown
documentation: UG
---

# Document Object Model representation in Markdown

When an existing Markdown document is opened or a new document is created, the Markdown library creates a **Document Object Model** (DOM) of the document in main memory. This object model can be used to manipulate the document as needed.

![Document Object Model representation in Markdown](DocumentObjectModelrepresentation_images/DocumentObjectModelrepresentation_img1.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 14 additions & 109 deletions Document-Processing/Markdown/Markdown-Library/NET/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ documentation: UG
---
# Getting started with Markdown library

## Creating a simple Markdown document from scratch

In this page, you can learn how to create a simple Markdown document programmatically using the Syncfusion Markdown API.

<table>
Expand All @@ -31,30 +29,22 @@ Include the following namespace in your .cs or .vb code as shown below.

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}

using Syncfusion.Office.Markdown;
using System.Text;
using System.IO;

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}

Imports System.IO
Imports System.Text
Imports Syncfusion.Office.Markdown

{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

using Syncfusion.Office.Markdown;
using System.Text;
using System.IO;

{% endhighlight %}

{% endtabs %}

## Creating a new Markdown document from scratch with basic elements
Expand All @@ -65,21 +55,16 @@ The following code example demonstrates how to create an instance of the Markdow

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}
// Creates a new instance of MarkdownDocument.
MarkdownDocument markdownDocument = new MarkdownDocument();
{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}
' Creates a new instance of MarkdownDocument.
Dim markdownDocument As New MarkdownDocument()
{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}
// Creates a new instance of MarkdownDocument.
MarkdownDocument markdownDocument = new MarkdownDocument();
{% endhighlight %}

{% endtabs %}

A Markdown document can contain various block-level elements such as headings, paragraphs, lists, tables, and code blocks.
Expand All @@ -90,7 +75,7 @@ The following code example demonstrates how to add a heading to a Markdown docum

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}

// Adds a heading to the Markdown document.
MdParagraph mdHeadingParagraph = markdownDocument.AddParagraph();
Expand All @@ -101,7 +86,7 @@ mdHeadingTextRange.Text = "Adventure Works Cycles";

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}

' Adds a heading to the Markdown document.
Dim mdHeadingParagraph As MdParagraph = markdownDocument.AddParagraph()
Expand All @@ -112,17 +97,6 @@ mdHeadingTextRange.Text = "Adventure Works Cycles";

{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

// Adds a heading to the Markdown document.
MdParagraph mdHeadingParagraph = markdownDocument.AddParagraph();
// Applies the Heading 1 style to the paragraph.
mdHeadingParagraph.ApplyParagraphStyle("Heading 1");
MdTextRange mdHeadingTextRange = mdHeadingParagraph.AddTextRange();
mdHeadingTextRange.Text = "Adventure Works Cycles";

{% endhighlight %}

{% endtabs %}

### Adding a paragraph
Expand All @@ -131,7 +105,7 @@ The following code example demonstrates how to add a paragraph to a Markdown doc

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}

// Adds a paragraph to the Markdown document.
MdParagraph mdParagraph = markdownDocument.AddParagraph();
Expand All @@ -140,7 +114,7 @@ The following code example demonstrates how to add a paragraph to a Markdown doc

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}

' Adds a paragraph to the Markdown document.
Dim mdParagraph As MdParagraph = markdownDocument.AddParagraph()
Expand All @@ -149,15 +123,6 @@ The following code example demonstrates how to add a paragraph to a Markdown doc

{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

// Adds a paragraph to the Markdown document.
MdParagraph mdParagraph = markdownDocument.AddParagraph();
MdTextRange mdTextRange = mdParagraph.AddTextRange();
mdTextRange.Text = "Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company. The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets. While its base operation is in Bothell, Washington with 290 employees, several regional sales teams are located throughout their market base.";

{% endhighlight %}

{% endtabs %}

### Adding a list
Expand All @@ -166,7 +131,7 @@ The Markdown library allows you to create both bulleted and numbered lists. The

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}

// Adds the first list item.
MdParagraph item1 = markdownDocument.AddParagraph();
Expand All @@ -192,7 +157,7 @@ item3.AddTextRange().Text = "Third item";

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}

' Adds the first list item.
Dim item1 As MdParagraph = markdownDocument.AddParagraph()
Expand All @@ -218,32 +183,6 @@ item3.AddTextRange().Text = "Third item";

{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

// Adds the first list item.
MdParagraph item1 = markdownDocument.AddParagraph();
item1.ListFormat = new MdListFormat();
item1.ListFormat.IsNumbered = false;
item1.ListFormat.ListLevel = 0;
item1.ListFormat.ListValue = "- ";
item1.AddTextRange().Text = "First item";
// Adds the second list item.
MdParagraph item2 = markdownDocument.AddParagraph();
item2.ListFormat = new MdListFormat();
item2.ListFormat.IsNumbered = false;
item2.ListFormat.ListLevel = 0;
item2.ListFormat.ListValue = "- ";
item2.AddTextRange().Text = "Second item";
// Adds the third list item.
MdParagraph item3 = markdownDocument.AddParagraph();
item3.ListFormat = new MdListFormat();
item3.ListFormat.IsNumbered = false;
item3.ListFormat.ListLevel = 0;
item3.ListFormat.ListValue = "- ";
item3.AddTextRange().Text = "Third item";

{% endhighlight %}

{% endtabs %}

### Adding a table
Expand All @@ -252,7 +191,7 @@ The following code example demonstrates how to add a table to a Markdown documen

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}

// Adds a table to the Markdown document.
MdTable table = markdownDocument.AddTable();
Expand All @@ -277,7 +216,7 @@ cell2.Items.Add(new MdTextRange { Text = "AdventureWorks Cycles, the fictitious

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}

' Adds a table to the Markdown document.
Dim table As MdTable = markdownDocument.AddTable()
Expand All @@ -302,31 +241,6 @@ cell2.Items.Add(new MdTextRange { Text = "AdventureWorks Cycles, the fictitious

{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

// Adds a table to the Markdown document.
MdTable table = markdownDocument.AddTable();
table.ColumnAlignments.Add(MdColumnAlignment.Left);
table.ColumnAlignments.Add(MdColumnAlignment.Left);
// Adds the header row.
MdTableRow headerRow = table.AddTableRow();
MdTableCell header1 = headerRow.AddTableCell();
header1.Items.Add(new MdTextRange { Text = "Profile picture" });
MdTableCell header2 = headerRow.AddTableCell();
header2.Items.Add(new MdTextRange { Text = "Description" });

// Adds a data row.
MdTableRow dataRow = table.AddTableRow();
MdTableCell cell1 = dataRow.AddTableCell();
MdPicture picture = new MdPicture();
picture.Url = "Data\\photo.jpg";
picture.AltText = "Profile picture";
cell1.Items.Add(picture);
MdTableCell cell2 = dataRow.AddTableCell();
cell2.Items.Add(new MdTextRange { Text = "AdventureWorks Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company." });

{% endhighlight %}

{% endtabs %}

### Saving the Markdown document
Expand All @@ -335,7 +249,7 @@ After adding the required content, save the Markdown document to the file system

{% tabs %}

{% highlight c# tabtitle="C# [Windows-specific]" %}
{% highlight c# tabtitle="C#" %}

// Retrieves the Markdown document content.
string mdContent = markdownDocument.GetMarkdownText();
Expand All @@ -344,7 +258,7 @@ File.WriteAllText("Output.md", mdContent, Encoding.UTF8);

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
{% highlight vb.net tabtitle="VB.NET" %}

' Retrieves the Markdown document content
Dim mdContent As String = markdownDocument.GetMarkdownText()
Expand All @@ -353,15 +267,6 @@ File.WriteAllText("Output.md", mdContent, Encoding.UTF8);

{% endhighlight %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

// Retrieves the Markdown document content.
string mdContent = markdownDocument.GetMarkdownText();
// Saves the Markdown document to the file system.
File.WriteAllText("Output.md", mdContent, Encoding.UTF8);

{% endhighlight %}

{% endtabs %}

You can download a complete working sample from GitHub.
Expand Down
Loading