Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[MarkdownTextBlock] Support Extensions

オープン
#609 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
frontend

調査の方向性

まず、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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommunityToolkit/Labs-Windows のほかの issue

CommunityToolkit/Labs-Windows の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。