-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
156 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using MdXaml.AnimatedGif; | ||
using MdXaml.Html; | ||
using MdXaml.Plugins; | ||
using MdXaml.Svg; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace MdXaml.Full | ||
{ | ||
public class Markdown : MdXaml.Markdown | ||
{ | ||
public override MdXamlPlugins? Plugins | ||
{ | ||
get => base.Plugins; | ||
set | ||
{ | ||
var nplg = value is null ? new MdXamlPlugins() : value; | ||
|
||
AddIfAbsent<HtmlPluginSetup>(nplg.Setups); | ||
AddIfAbsent<SvgPluginSetup>(nplg.Setups); | ||
AddIfAbsent<AnimatedGifPluginSetup>(nplg.Setups); | ||
|
||
base.Plugins = nplg; | ||
} | ||
} | ||
|
||
public Markdown() | ||
{ | ||
Plugins = new MdXamlPlugins(); | ||
} | ||
|
||
private void AddIfAbsent<T>(IList<IPluginSetup> plugins) where T : IPluginSetup, new() | ||
{ | ||
if (!plugins.Any(p => p is T)) | ||
{ | ||
plugins.Add(new T()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using MdXaml.AnimatedGif; | ||
using MdXaml.Html; | ||
using MdXaml.Plugins; | ||
using MdXaml.Svg; | ||
using Svg; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace MdXaml.Full | ||
{ | ||
public class MarkdownScrollViewer : MdXaml.MarkdownScrollViewer | ||
{ | ||
public override MdXamlPlugins? Plugins | ||
{ | ||
get => base.Plugins; | ||
set | ||
{ | ||
var nplg = value is null ? new MdXamlPlugins() : value; | ||
|
||
AddIfAbsent<HtmlPluginSetup>(nplg.Setups); | ||
AddIfAbsent<SvgPluginSetup>(nplg.Setups); | ||
AddIfAbsent<AnimatedGifPluginSetup>(nplg.Setups); | ||
|
||
base.Plugins = nplg; | ||
} | ||
} | ||
|
||
public MarkdownScrollViewer() | ||
{ | ||
Plugins = new MdXamlPlugins(); | ||
} | ||
|
||
private void AddIfAbsent<T>(IList<IPluginSetup> plugins) where T : IPluginSetup, new() | ||
{ | ||
if (!plugins.Any(p => p is T)) | ||
{ | ||
plugins.Add(new T()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<TargetFrameworks>$(PackageTargetFrameworks)</TargetFrameworks> | ||
<UseWPF>true</UseWPF> | ||
<PackageId>MdXaml.Full</PackageId> | ||
<Version>$(PackageVersion)</Version> | ||
<Authors>Bevan Arps(original); whistyun</Authors> | ||
<Company /> | ||
<Description>Markdown XAML processor</Description> | ||
<Copyright>Copyright (c) 2010 Bevan Arps, 2023 whistyun</Copyright> | ||
<PackageProjectUrl>https://github.com/whistyun/MdXaml</PackageProjectUrl> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageReadmeFile>MdXaml.Full.md</PackageReadmeFile> | ||
<PackageTags>Markdown WPF Xaml FlowDocument</PackageTags> | ||
<Configurations>Debug;Release</Configurations> | ||
<LangVersion>9</LangVersion> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<SignAssembly>true</SignAssembly> | ||
<AssemblyOriginatorKeyFile>..\key.snk</AssemblyOriginatorKeyFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\pack_readme\MdXaml.Full.md" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\MdXaml.AnimatedGif\MdXaml.AnimatedGif.csproj" /> | ||
<ProjectReference Include="..\MdXaml.Html\MdXaml.Html.csproj" /> | ||
<ProjectReference Include="..\MdXaml.Plugins\MdXaml.Plugins.csproj" /> | ||
<ProjectReference Include="..\MdXaml.Svg\MdXaml.Svg.csproj" /> | ||
<ProjectReference Include="..\MdXaml\MdXaml.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
| ||
using System.Windows.Markup; | ||
|
||
[assembly: XmlnsDefinition("https://github.com/whistyun/MdXaml.Full", "MdXaml.Full")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
| ||
using System.Windows.Markup; | ||
|
||
[assembly: XmlnsDefinition("https://github.com/whistyun/MdXaml", "MdXaml")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Transform Markdown to FlowDocument(WPF). | ||
|
||
**How to use** | ||
[How to transform markdown to FlowDocument-object.](https://whistyun.github.io/MdXaml/transform_markdow_to_flowdocument.html) | ||
[How to render markdown in WPF Control.](https://whistyun.github.io/MdXaml/render_markdown_in_control.html) | ||
[for more](https://github.com/whistyun/MdXaml/wiki) | ||
|
||
**Migration from Markdown.Xaml** | ||
MdXaml change namespace from Markdown.Xaml to MdXaml. So you should change namespace in your code. | ||
Or use [migration free edition](https://www.nuget.org/packages/MdXaml_migfree/) | ||
|
||
**Preview** | ||
![sc1](https://raw.githubusercontent.com/whistyun/MdXaml/master/docs/img.demo/sc1.png) | ||
![sc2](https://raw.githubusercontent.com/whistyun/MdXaml/master/docs/img.demo/sc2.png) | ||
![sc3](https://raw.githubusercontent.com/whistyun/MdXaml/master/docs/img.demo/sc3.png) | ||
![sc4](https://raw.githubusercontent.com/whistyun/MdXaml/master/docs/img.demo/sc4.png) | ||
![sc5](https://raw.githubusercontent.com/whistyun/MdXaml/master/docs/img.demo/sc5.png) |