Skip to content

Commit 200daa1

Browse files
Added package infos.
1 parent 37d4a67 commit 200daa1

File tree

3 files changed

+83
-4
lines changed

3 files changed

+83
-4
lines changed

DotNetElements.Wpf.Markdown/DotNetElements.Wpf.Markdown.csproj

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,28 @@
66
<UseWPF>true</UseWPF>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>
9-
9+
10+
<ItemGroup>
11+
<PackageReference Include="Markdig" Version="0.38.0" />
12+
</ItemGroup>
13+
1014
<PropertyGroup>
1115
<PackageId>DotNetElements.Wpf.Markdown</PackageId>
12-
<Version>0.1.0</Version>
16+
<Title>DotNetElements - WPF Markdown Component</Title>
17+
<Description>Markdown component for WPF</Description>
18+
<Authors>Felix-CodingClimber</Authors>
19+
<Copyright>Felix-CodingClimber</Copyright>
20+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
21+
<PackageProjectUrl>https://github.com/Felix-CodingClimber/DotNetElements.Wpf.Markdown</PackageProjectUrl>
22+
<RepositoryUrl>https://github.com/Felix-CodingClimber/DotNetElements.Wpf.Markdown</RepositoryUrl>
23+
<RepositoryType>git</RepositoryType>
24+
<PackageReadmeFile>README.md</PackageReadmeFile>
25+
<PackageIcon>logo-small-nuget.png</PackageIcon>
1326
</PropertyGroup>
14-
27+
1528
<ItemGroup>
16-
<PackageReference Include="Markdig" Version="0.38.0" />
29+
<None Include="..\README.md" Pack="true" PackagePath="\"/>
30+
<None Include="..\brand\logo-small-nuget.png" Pack="true" PackagePath="\"/>
1731
</ItemGroup>
1832

1933
</Project>

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
## About
2+
3+
This project provides a simple markdown renderer for WPF.
4+
This implementation uses the popular [Markdig](https://github.com/xoofx/markdig) library for parsing.
5+
At the current state, not all markdown features are supported. Styling options for the markdown blocks need to be improved.
6+
7+
### Supported features:
8+
-[x] Paragraphs
9+
-[x] InlineEmphasis
10+
-[x] Headings
11+
-[x] InlineCode
12+
-[x] InlineHyperlink
13+
-[x] Lists (unordered & ordered)
14+
-[x] ThematicBreak
15+
16+
### Features to implement:
17+
-[ ] CodeBlocks
18+
-[ ] Images
19+
-[ ] Tables
20+
21+
## Recommended setup
22+
23+
1. Install nuget package `> dotnet add package DotNetElements.Wpf.Markdown --version <insert-latest-version-here>`
24+
25+
2. Add styles to `App.xaml`
26+
```xaml
27+
<Application.Resources>
28+
<ResourceDictionary>
29+
<ResourceDictionary.MergedDictionaries>
30+
<ResourceDictionary Source="pack://application:,,,/DotNetElements.Wpf.Markdown;Component/Themes/Generic.xaml" />
31+
</ResourceDictionary.MergedDictionaries>
32+
</ResourceDictionary>
33+
</Application.Resources>
34+
```
35+
36+
2. Add xaml namespace
37+
```xaml
38+
xmlns:markdown="clr-namespace:DotNetElements.Wpf.Markdown;assembly=DotNetElements.Wpf.Markdown"
39+
```
40+
41+
3. Add `MarkdownTextBlock`
42+
```xaml
43+
<markdown:MarkdownTextBlock x:Name="MarkdownTextBlock" FontFamily="Segoe UI" />
44+
```
45+
46+
4. Set the `Text` property (binding is supported)
47+
```cs
48+
MarkdownTextBlock.Text = "Hello world from **DotNetElements.Wpf.Markdown**";
49+
```
50+
51+
5. To change the styling options for the different markdown blocks, add a customized `MarkdownThemes.cs`
52+
```cs
53+
MarkdownThemes myTheme = MarkdownThemes.Default;
54+
myTheme.InlineCodeBackground = new SolidColorBrush(Colors.HotPink);
55+
56+
MarkdownConfig myConfig = MarkdownConfig.Default;
57+
myConfig.Themes = myTheme;
58+
59+
MarkdownTextBlock.Config = myConfig;
60+
```
61+
62+
## Third party notices
63+
64+
The project is a port of the CommunityToolkit MarkdownTextBlock component to the WPF framework
65+
see [CommunityToolkit/Labs-Windows/MarkdownTextBlock](https://github.com/CommunityToolkit/Labs-Windows/tree/a37acd33031037daa4d39318e3a10741b1c046ea/components/MarkdownTextBlock)

brand/logo-small-nuget.png

3.81 KB
Loading

0 commit comments

Comments
 (0)