Plugin.Maui.MarkdownView 0.0.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package Plugin.Maui.MarkdownView --version 0.0.6
                    
NuGet\Install-Package Plugin.Maui.MarkdownView -Version 0.0.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Plugin.Maui.MarkdownView" Version="0.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.MarkdownView" Version="0.0.6" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.MarkdownView" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Plugin.Maui.MarkdownView --version 0.0.6
                    
#r "nuget: Plugin.Maui.MarkdownView, 0.0.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Plugin.Maui.MarkdownView@0.0.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Plugin.Maui.MarkdownView&version=0.0.6
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.MarkdownView&version=0.0.6
                    
Install as a Cake Tool

nuget.png

Plugin.Maui.MarkdownView

Plugin.Maui.MarkdownView provides the ability to create your UI based on Markdown files.

  • Easy to use
  • Highly customizable
  • For local and remote use cases
  • Hot Reload support πŸ”₯
  • Massively scalable
  • Fully works with the default MAUI UI rendering
  • No hacking or other fragile mechanisms

Install Plugin

NuGet

Available on NuGet.

Install with the dotnet CLI: dotnet add package Plugin.Maui.MarkdownView, or through some NuGet Package Manager in your editor.

Supported Platforms

This plugin works completely with the default MAUI UI rendering, so Platform supported versions should be the same as the MAUI supported versions.

Available on microsoft.com > supported-platforms.

Proven system

This system has been part of my private project for a long time and has proven to be a great way to easily scale-up apps with lots of different languages. As an example, the app in question has approx 2 million downloads and is available in 11 languages ​​using different alphabets and writing directions.

With the rise of MAUI I thought this was a great time to make it public, because it's just too good to keep it to myself 😁. And with the help of the community, we can make it even better.

Usage

Plugin.Maui.MarkdownView provides the MarkdownView class as a MAUI View.

The MarkdownView has one single required property for the Markdown text, this can be set using it's Content field in XAML or the MarkdownText property in the code behind. When using the Content field in XAML it automaticly supports πŸ”₯ UI Hot-Reload πŸ”₯.

XAML

<ScrollView>
    <mdv:MarkdownView xml:space="preserve">
# My first MarkdownView

Some new Paragraph, that is separated by a blank line.
    </mdv:MarkdownView>
</ScrollView>

or C#

await using var stream = await FileSystem.OpenAppPackageFileAsync("MyMarkdown.md");
using var reader = new StreamReader(stream);
MyMarkdownView.MarkdownText = await reader.ReadToEndAsync();

Check out the Pages in the Plugin.Maui.MarkdownView.Sample project for some detailed examples.

  • MarkdownInXamlPage : Shows how to use the Content field in XAML.
  • MarkdownFromRemotePage : Shows how to load a markdown file from a remote server.

Quick start

Two small steps to quickly start using MarkdownView and get the most of its power:

  1. copy-paste the MarkdownStyles.xaml into your project
  2. copy-paste the complete <mdv:MarkdownView> from the MarkdownInXamlPage where ever you want to use it

Now you can change the Markdown content in the <mdv:MarkdownView> and start styling it with the MarkdownStyles.xaml file.

Permissions

No permissions required πŸŽ‰

Dependency Injection

No dependency injection required 🎊

Feature

Once you have created a MarkdownView you can interact with it in the following ways:

Properties
MarkdownText

Sets a value for markdown text that needs to be parsed to views.

This property is can be set in XAML using the Content field. When using XAML use xml:space="preserve" to keep line-breaks and spacing working during Hot-Reload.

IsLoadingMarkdown

Gets a value indicating whether control is parsing markdown text to views.

ViewSupplier

Sets a value for IViewSupplier that creates the views.

MauiViewSupplier.Styles

When using MauiViewSupplier as IViewSupplier (this is default), the supplier uses this property to look for optional styles.

MauiViewSupplier.BasePathForRelativeUrlConversion

When using MauiViewSupplier as IViewSupplier (this is default), the supplier tries to convert links to the correct path using this a property as base path.

MauiViewSupplier.PrefixesToIgnoreForRelativeUrlConversion

When using MauiViewSupplier as IViewSupplier (this is default), The provider tries to convert links to the correct path, except for values ​​with a prefix from this property.

Customizability

This plugin has been created with only structured object-oriented code, without any hidden reflection or injection mechanisms.

For customizability, against the principles of some developers, almost all methods are virtual and ready to be overridden. Use this power wisely, you may break this system but the freedom it gives to make it your own is endless 😏.

Use UI Hot-Reload on multiple platforms simultaneously

  • TODO:

Roadmap

  • Support original Markdown syntax
  • Support some extended markdown syntax (like tables)

Acknowledgements

This project could not have came to be without these projects and people, thank you! ❀️ πŸ‘

  • You πŸ˜‰
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios18.0 is compatible.  net8.0-maccatalyst was computed.  net8.0-maccatalyst18.0 is compatible.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows10.0.19041 is compatible.  net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-maccatalyst18.0 is compatible.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 235 3/28/2025
1.0.4 156 3/27/2025
1.0.3 152 3/18/2025
1.0.2 130 2/13/2025
1.0.1 121 2/8/2025
1.0.0 128 2/7/2025
0.1.0 107 2/6/2025
0.0.7 119 1/30/2025
0.0.6 111 1/29/2025
0.0.5 99 1/15/2025
0.0.4 184 11/14/2024
0.0.2 121 9/27/2024