AshleyShrok.ViewModelShell.Markdown
0.1.0
See the version list below for details.
dotnet add package AshleyShrok.ViewModelShell.Markdown --version 0.1.0
NuGet\Install-Package AshleyShrok.ViewModelShell.Markdown -Version 0.1.0
<PackageReference Include="AshleyShrok.ViewModelShell.Markdown" Version="0.1.0" />
<PackageVersion Include="AshleyShrok.ViewModelShell.Markdown" Version="0.1.0" />
<PackageReference Include="AshleyShrok.ViewModelShell.Markdown" />
paket add AshleyShrok.ViewModelShell.Markdown --version 0.1.0
#r "nuget: AshleyShrok.ViewModelShell.Markdown, 0.1.0"
#:package AshleyShrok.ViewModelShell.Markdown@0.1.0
#addin nuget:?package=AshleyShrok.ViewModelShell.Markdown&version=0.1.0
#tool nuget:?package=AshleyShrok.ViewModelShell.Markdown&version=0.1.0
AshleyShrok.ViewModelShell.Markdown
Markdown → ViewNode subtree converter for
AshleyShrok.ViewModelShell.
Byte-parallel to the TS twin
@ashley-shrok/viewmodel-shell/markdown —
feed the same markdown string into either and get an equivalent ViewNode
subtree.
Why a separate package
Core VMS has zero runtime dependencies. This package adds a
PackageReference to Markdig and ships
as a companion so a consumer that never renders markdown never pulls
Markdig into their build graph — the same "opt-in via subpath" seam the
npm side uses for marked.
Usage
using ViewModelShell;
using ViewModelShell.Markdown;
string md = "# Hello\n\nA paragraph with **bold** and a [link](https://ex.com).";
IReadOnlyList<ViewNode> nodes = MarkdownConverter.ToViewNodes(md);
// Compose into any children slot:
var page = new PageNode(Title: "Docs", Children: nodes);
Set MarkdownOptions.External = true to mark every link in the parsed
markdown as opening outside the current app context (new tab + noopener
in the browser).
Coverage
Everything the TS twin supports, on the same input, producing the same subtree shape:
- Headings 1–6 →
TextNodewithLevel(real<h1>–<h6>) - Paragraphs →
TextNode, with inlineRunsonly when formatting is present - Ordered / unordered / nested lists →
ListNode+ListItemNode - GFM task-list markers →
ListItemNode.Completed - Blockquotes →
BlockquoteNode - Fenced code blocks →
CodeBlockNodewithLanguage - Images →
ImageNode(image-only paragraphs unwrap to standalone images; the markdown-title third argument becomesCaption) - Horizontal rules →
DividerNode - Inline bold / italic / strikethrough / inline code / links →
InlineRunflags +Href
Deferred v1 (silently skipped): raw HTML blocks, tables (rich table cells are a separate design pass), footnotes, definition lists.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net8.0
- AshleyShrok.ViewModelShell (>= 6.10.0)
- Markdig (>= 0.37.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.