initial
This commit is contained in:
26
src/Views/Renderers/IMarkdownBlockRenderer.cs
Normal file
26
src/Views/Renderers/IMarkdownBlockRenderer.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Avalonia.Controls;
|
||||
using Markdig.Syntax;
|
||||
|
||||
namespace MarkdownEditor.Views.Renderers;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for rendering markdown blocks into Avalonia controls.
|
||||
/// Allows for modular rendering of different markdown block types.
|
||||
/// </summary>
|
||||
public interface IMarkdownBlockRenderer
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines if this renderer can handle the given block type.
|
||||
/// </summary>
|
||||
/// <param name="block">The markdown block to check.</param>
|
||||
/// <returns>True if this renderer can handle the block, false otherwise.</returns>
|
||||
bool CanRender(Block block);
|
||||
|
||||
/// <summary>
|
||||
/// Renders the markdown block into an Avalonia control.
|
||||
/// </summary>
|
||||
/// <param name="block">The markdown block to render.</param>
|
||||
/// <returns>The rendered Avalonia control, or null if rendering fails.</returns>
|
||||
Control? Render(Block block);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user