[MarkdownTextBlock] Support Extensions
まだ誰も着手していません。
評価
調査の方向性
まず、MarkdownTextBlock と既存の Markdig MarkdownPipeline および renderer の統合箇所を見つけます。提案されている組み込みの UseFoo プロパティと XAML CustomElements/IElement アプローチを比較します。拡張機能を解析とレンダリングの両方に対して宣言的に構成できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Proposal: Extensions
The underlying parser Markdig supports extensions. Some of these come bundled with that package, such as Pipe Tables and Diagrams. Others can be added with extra code.
Simple properties for built-in extensions
<md:MarkdownTextBlock UseEmphasisExtras="True" UseAutoLinks="True" Text="..." />
We can ship with a few UseFoo properties that allow to configure the built-in extensions that end up both in the MarkdownPipeline and the Renderer. This makes it super easy to control which Markdown extensions get enabled without having to mess around with a MarkdownPipeline or any C# code.
Custom extensions
Declaration in XAML:
<md:MarkdownTextBlock Text="...">
<md:MarkdownTextBlock.CustomElements>
<foo:CustomElement />
</md:MarkdownTextBlock.CustomElements>
</md:MarkdownTextBlock>
And C#, implementing a new interface we ship IElement:
class CustomElement : IElement<CustomObject>
{
// Parsing
public void AddToPipeline(MarkdownPipelineBuilder pipelineBuilder)
{
pipelineBuilder.Extensions.Add(...);
}
// Rendering
public UWPObjectRenderer<CustomObject> GetObjectRenderer() => new CustomRenderer();
}
With this approach, we can allow users to add arbitrary extensions on top of the control in a very simple and declarative manner. A quick glance at the XAML tells you all the built-in and custom extensions currently being used.
Originally posted by @jcoc611-microsoft in https://github.com/CommunityToolkit/Labs-Windows/discussions/536#discussioncomment-11309494
- 主要言語
- C#
- スター
- 485
- フォーク
- 89
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CommunityToolkit/Labs-Windows のほかの issue
-
bug :bug:
難易度 1/5 1〜3時間 初心者へのやさしさ 80/100
CommunityToolkit/Labs-Windows#815 ·
-
bug :bug:
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
CommunityToolkit/Labs-Windows#816 ·
-
bug :bug:
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
CommunityToolkit/Labs-Windows#814 ·
-
experiment :test_tube:
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
CommunityToolkit/Labs-Windows#812 ·
-
ux :paintbrush:
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
CommunityToolkit/Labs-Windows#808 · コメント 1 件 ·
CommunityToolkit/Labs-Windows の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug priority: P2
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
IridiumIO/CompactGUI#699 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信