MeshWeaver.Markdown 2.0.3

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

// Install MeshWeaver.Markdown as a Cake Tool
#tool nuget:?package=MeshWeaver.Markdown&version=2.0.3                

MeshWeaver.Markdown

Overview

MeshWeaver.Markdown is a powerful component of the MeshWeaver ecosystem that provides advanced markdown processing with interactive capabilities. This library enables rendering of standard markdown along with executable code blocks, diagrams, and integration with the MeshWeaver layout system for dynamic content visualization.

Features

  • Interactive markdown with executable code blocks
  • Code execution via kernel integration
  • Metadata and frontmatter support
  • Mermaid diagram rendering
  • Custom code block rendering options
  • Layout area integration for displaying results
  • Markdown to HTML conversion
  • Code syntax highlighting
  • Extensible markdown processing pipeline
  • Customizable rendering options

Interactive Markdown Capabilities

Metadata (Frontmatter)

Interactive markdown supports YAML frontmatter at the beginning of the file:

---
Title: "Interactive Markdown: The Next Generation Reporting"
Abstract: "A brief description of the article content"
Thumbnail: "images/InteractiveMarkdown.png"
VideoUrl: "https://www.youtube.com/embed/6J16W9qcZFY"
Published: "2025-01-26"
Authors:
  - "Roland Bürgi"
Tags:
  - "Documentation"
  - "Conceptual"
  - "Markdown"
---

Executable Code Blocks

Code blocks can be executed and their results displayed:

```csharp --render HelloWorld --show-header
"Hello World " + DateTime.Now.ToString()
```

Options for code blocks:

  • --render <area>: Renders the output to the specified layout area
  • --show-header: Shows the complete code block including the header
  • --show-code: Shows only the code without the header

Mermaid Diagrams

Create diagrams using Mermaid syntax:

```mermaid
sequenceDiagram
    participant View
    participant Article
    participant Kernel
    View->>Article: Requests Content
    Article->>Kernel: Submits Code Execution
    Article->>View: Issues HTML
    View->>Kernel: Requests Layout Area
    Kernel->>View: Returns Layout Area
```

Usage

This component is primarily used in conjunction with the MeshWeaver.Articles library, which provides a complete solution for managing and displaying markdown-based content. Please refer to the Articles documentation for configuration and implementation details.

Interactive Markdown Process Flow

The execution flow for interactive markdown:

  1. Markdown with code blocks is parsed
  2. Code blocks with execution flags are extracted
  3. Code is sent to appropriate language kernel for execution
  4. Results are captured and rendered in specified layout areas
  5. Final HTML with interactive elements is returned
sequenceDiagram
    participant View
    participant Article
    participant Kernel
    View->>Article: Requests Content
    Article->>Kernel: Submits Code Execution
    Article->>View: Issues HTML
    View->>Kernel: Requests Layout Area
    Kernel->>View: Returns Layout Area

Key Concepts

  • Interactive Markdown: Markdown with executable code blocks
  • Code Execution: Running code within markdown documents
  • Kernel Integration: Connection to language execution engines
  • Layout Areas: Named regions for displaying execution results
  • Markdown Metadata: YAML frontmatter for document properties
  • Rendering Pipeline: Extensible process for transforming markdown to HTML

Integration with MeshWeaver

  • Works with MeshWeaver.Kernel for code execution
  • Integrates with MeshWeaver.Layout for displaying results
  • Supports MeshWeaver.Articles for documentation
  • Used by MeshWeaver notebooks and reporting features

See Also

Refer to the main MeshWeaver documentation for more information about the overall project.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MeshWeaver.Markdown:

Package Downloads
MeshWeaver.Blazor

Package Description

MeshWeaver.Articles

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.3 492 3/24/2025
2.0.2 466 3/24/2025
2.0.1 119 3/21/2025
2.0.0 159 3/20/2025
2.0.0-preview3 104 2/28/2025
2.0.0-Preview2 107 2/10/2025
2.0.0-preview1 108 1/6/2025