Skip to content

Commit 0bcc6b5

Browse files
Mark down to word
Mathematical equation
1 parent 2eff36c commit 0bcc6b5

File tree

145 files changed

+380
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+380
-53
lines changed

Markdown-to-Word-conversion/Convert-Markdown-to-Word/.NET/Convert-Markdown-to-Word/Convert-Markdown-to-Word.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@
1010
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<None Update="Data\Input.md">
15+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
16+
</None>
17+
<None Update="Output\.gitkeep">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</None>
20+
</ItemGroup>
21+
1322
</Project>

Markdown-to-Word-conversion/Convert-Markdown-to-Word/.NET/Convert-Markdown-to-Word/Input.md renamed to Markdown-to-Word-conversion/Convert-Markdown-to-Word/.NET/Convert-Markdown-to-Word/Data/Input.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


Markdown-to-Word-conversion/Convert-Markdown-to-Word/.NET/Convert-Markdown-to-Word/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ class Program
99
static void Main(string[] args)
1010
{
1111
//Open a file as a stream.
12-
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"../../../Input.md"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
12+
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Input.md"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
1313
{
1414
//Load the file stream into a Markdown file.
1515
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Markdown))
1616
{
1717
//Create a file stream.
18-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../MarkdownToWord.docx"), FileMode.Create, FileAccess.ReadWrite))
18+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/MarkdownToWord.docx"), FileMode.Create, FileAccess.ReadWrite))
1919
{
2020
//Save a Word document to the file stream.
2121
document.Save(outputFileStream, FormatType.Docx);

Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Customize-image.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,19 @@
1010
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<None Update="Data\Image_1.png">
15+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
16+
</None>
17+
<None Update="Data\Image_2.png">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</None>
20+
<None Update="Data\Input.md">
21+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
22+
</None>
23+
<None Update="Output\.gitkeep">
24+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
25+
</None>
26+
</ItemGroup>
27+
1328
</Project>

Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Image_1.png renamed to Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Data/Image_1.png

File renamed without changes.

Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Image_2.png renamed to Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Data/Image_2.png

File renamed without changes.

Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Input.md renamed to Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Data/Input.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


Markdown-to-Word-conversion/Customize-image/.NET/Customize-image/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ static void Main(string[] args)
1616
//Hook the event to customize the image while importing Markdown.
1717
document.MdImportSettings.ImageNodeVisited += MdImportSettings_ImageNodeVisited;
1818
//Open the Markdown file.
19-
document.Open(new FileStream("../../../Input.md", FileMode.Open, FileAccess.Read), FormatType.Markdown);
19+
document.Open(new FileStream("Data/Input.md", FileMode.Open, FileAccess.Read), FormatType.Markdown);
2020

2121
//Create a file stream.
22-
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Sample.docx"), FileMode.Create, FileAccess.ReadWrite))
22+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Sample.docx"), FileMode.Create, FileAccess.ReadWrite))
2323
{
2424
//Save a Markdown file to the file stream.
2525
document.Save(outputFileStream, FormatType.Docx);
@@ -30,9 +30,9 @@ private static void MdImportSettings_ImageNodeVisited(object sender, Syncfusion.
3030
{
3131
//Set the image stream based on the image name from the input Markdown.
3232
if (args.Uri == "Image_1.png")
33-
args.ImageStream = new FileStream("../../../Image_1.png", FileMode.Open);
33+
args.ImageStream = new FileStream("Data/Image_1.png", FileMode.Open);
3434
else if (args.Uri == "Image_2.png")
35-
args.ImageStream = new FileStream("../../../Image_2.png", FileMode.Open);
35+
args.ImageStream = new FileStream("Data/Image_2.png", FileMode.Open);
3636
//Retrive the image from the website and use it.
3737
else if (args.Uri.StartsWith("https://"))
3838
{

0 commit comments

Comments
 (0)