diff --git a/MarkdownEditor.sln b/MarkdownEditor.sln index 1739f2d..f6e9071 100644 --- a/MarkdownEditor.sln +++ b/MarkdownEditor.sln @@ -1,10 +1,15 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 +# Visual Studio Version 18 +VisualStudioVersion = 18.4.11626.88 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdownEditor", "MarkdownEditor\MarkdownEditor.csproj", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdownEditor.Tests", "MarkdownEditor.Tests\MarkdownEditor.Tests.csproj", "{B2C3D4E5-F6A7-8901-BCDE-F12345678901}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvaloniaEdit", "external\AvaloniaEdit\src\AvaloniaEdit\AvaloniaEdit.csproj", "{223088E5-4B35-757B-5726-5F02A44AA9DD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdownRender", "MarkdownEditor\MarkdownRender.csproj", "{FEE3F7BE-C82F-487E-84C7-FD6682BF90F1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -19,5 +24,19 @@ Global {B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Debug|Any CPU.Build.0 = Debug|Any CPU {B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|Any CPU.ActiveCfg = Release|Any CPU {B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|Any CPU.Build.0 = Release|Any CPU + {223088E5-4B35-757B-5726-5F02A44AA9DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {223088E5-4B35-757B-5726-5F02A44AA9DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {223088E5-4B35-757B-5726-5F02A44AA9DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {223088E5-4B35-757B-5726-5F02A44AA9DD}.Release|Any CPU.Build.0 = Release|Any CPU + {FEE3F7BE-C82F-487E-84C7-FD6682BF90F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FEE3F7BE-C82F-487E-84C7-FD6682BF90F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FEE3F7BE-C82F-487E-84C7-FD6682BF90F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FEE3F7BE-C82F-487E-84C7-FD6682BF90F1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6D9F5F3B-718F-44D3-9D8F-D102C8DC2A62} EndGlobalSection EndGlobal diff --git a/MarkdownEditor/Engine/Document/IncrementalParseManager.cs b/MarkdownEditor/Engine/Document/IncrementalParseManager.cs index e9531ad..f7d827b 100644 --- a/MarkdownEditor/Engine/Document/IncrementalParseManager.cs +++ b/MarkdownEditor/Engine/Document/IncrementalParseManager.cs @@ -8,7 +8,7 @@ namespace MarkdownEditor.Engine.Document; /// - ReparseFull:全量重新解析(与旧 RenderEngine.ParseFullDocument 行为一致); /// - ReparseRange:基于行区间的局部重解析,只替换受影响块所在的 BlockSpan,其他块保持引用不变。 /// -internal sealed class IncrementalParseManager +public sealed class IncrementalParseManager { /// 最新一次解析得到的原始块列表(尚未做脚注归一化)。 public IReadOnlyList Blocks => _blocks; diff --git a/MarkdownEditor/Engine/RenderEngine.cs b/MarkdownEditor/Engine/RenderEngine.cs index 3485a55..e61d12d 100644 --- a/MarkdownEditor/Engine/RenderEngine.cs +++ b/MarkdownEditor/Engine/RenderEngine.cs @@ -144,7 +144,7 @@ public void InvalidateBlockPictureCache() } /// 获取累积高度数组的副本,供布局任务复用以保持 cum 一致性。若尚未布局则返回 null。 - internal float[]? GetCumulativeYSnapshot() + public float[]? GetCumulativeYSnapshot() { var cum = _cumulativeY; if (cum == null || cum.Length < 2) @@ -155,13 +155,13 @@ public void InvalidateBlockPictureCache() } /// 获取布局引擎,供后台布局任务使用。 - internal ILayoutEngine GetLayoutEngine() => _layout; + public ILayoutEngine GetLayoutEngine() => _layout; /// 获取引擎配置,供后台布局任务使用。 - internal EngineConfig GetConfig() => _config; + public EngineConfig GetConfig() => _config; /// 当前内容区域宽度,供调用方判断 SetWidth 是否会清空布局。 - internal float GetWidth() => _width; + public float GetWidth() => _width; public void SetWidth(float width) { diff --git a/MarkdownEditor/MarkdownEditor.csproj b/MarkdownEditor/MarkdownEditor.csproj index d4cdaa4..483e842 100644 --- a/MarkdownEditor/MarkdownEditor.csproj +++ b/MarkdownEditor/MarkdownEditor.csproj @@ -44,29 +44,19 @@ PreserveNewest - + PreserveNewest - + PreserveNewest - - - + + + @@ -75,13 +65,13 @@ - - - - - - - + + + + + + + diff --git a/MarkdownEditor/MarkdownRender.csproj b/MarkdownEditor/MarkdownRender.csproj new file mode 100644 index 0000000..9d93303 --- /dev/null +++ b/MarkdownEditor/MarkdownRender.csproj @@ -0,0 +1,102 @@ + + + + Library + net10.0 + enable + enable + + Markdown Document Skia Render + 跨平台 Markdown 文档渲染器 - AOT 编译,高性能 + + + + + PreserveNewest + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MarkdownEditor/MewkdownRender.csproj b/MarkdownEditor/MewkdownRender.csproj new file mode 100644 index 0000000..d44c24d --- /dev/null +++ b/MarkdownEditor/MewkdownRender.csproj @@ -0,0 +1,106 @@ + + + + Library + net10.0 + enable + enable + + Markdown Document MewUI Render + 跨平台 Markdown 文档渲染器 - AOT 编译,高性能 + + + + + PreserveNewest + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index e474019..9e9b33b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# Markdown Editor +# 【分叉项目:拟移植查看器控件至 MewUI】 +Markdown Editor是个人用下来,最好用的.NET客户端.md编辑器器。其中.md查看器的解析及渲染能力强,性能非常好。 +Mew UI是.NET 跨平台UI新秀,架构极其简洁优秀,依赖极少,性能极高,计划把.md查看器移植至MewUI,实现强强组合:
+(1)先分离出渲染器和查看器控件,不依赖窗体及其他功能;【已完成,添加MarkdownRender.csproj,使用SkiaSharp替代Avalonia.Skia】
+(2)把渲染器的实现,从SkiaSharp Canvas替换为MewUI GraphicsContext;
+(3)把编辑器控件的实现,从AvaloniaUI Control替换为MewUI Control;
+(4)打包形成独立MewMdViewer。
+ +# 【源项目:Markdown Editor】 基于 AvaloniaUI 的跨平台 Markdown 文档编辑管理器,使用 .NET 10,100% C# 实现,支持 Native AOT 发布。