MobileDocKit 0.2.2

dotnet add package MobileDocKit --version 0.2.2
NuGet\Install-Package MobileDocKit -Version 0.2.2
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="MobileDocKit" Version="0.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MobileDocKit --version 0.2.2
#r "nuget: MobileDocKit, 0.2.2"
#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.
// Install MobileDocKit as a Cake Addin
#addin nuget:?package=MobileDocKit&version=0.2.2

// Install MobileDocKit as a Cake Tool
#tool nuget:?package=MobileDocKit&version=0.2.2

After adding the package reference to your project, you can use the following code to parse a piece of mobiledoc content:

var doc = MobileDocSerializer.Deserialize(someDocumentContent);

Similarly, you can serialize mobiledoc content using the following code:

MobileDocSerializer.Serialize(mobileDocContent);

If you're looking to create mobiledoc content programmatically, you can build a mobiledoc document using the builder interface:

var document = new MobileDocBuilder()
    .WithMarkupSection(section => section
        .WithTagName("p")
        .WithMarker(new int[] { }, 0, "Hello world"))
    .Build();

Finally, if you want to render mobiledoc to HTML, use the MobileDocRenderer:

var renderer = new MobileDocRenderer(new CardSectionRenderer[] { }, new AtomRenderer[] { });
var htmlContent = renderer.Render(mobileDocInstance);

Make sure to write your own card renderers and atom renderers for any custom cards and atoms that you're using in your documents. Add them to the parameters, specified in the constructor of the MobileDocRenderer.

Learning more about mobiledoc

You can learn more about the mobiledoc format in the official specification.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
0.2.2 15,713 7/11/2020

v0.2.2
* New: Added support for rendering HTML from mobiledoc.
* Fixed: Changed list parsing behavior, so it supports actual list items.
v0.1.0
* New: Added support for generating mobiledoc instances from code.
* New: Added support for parsing mobiledoc content.