LiveMarkdown.Avalonia.WaveDrom 0.1.1

dotnet add package LiveMarkdown.Avalonia.WaveDrom --version 0.1.1
                    
NuGet\Install-Package LiveMarkdown.Avalonia.WaveDrom -Version 0.1.1
                    
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="LiveMarkdown.Avalonia.WaveDrom" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiveMarkdown.Avalonia.WaveDrom" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="LiveMarkdown.Avalonia.WaveDrom" />
                    
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 LiveMarkdown.Avalonia.WaveDrom --version 0.1.1
                    
#r "nuget: LiveMarkdown.Avalonia.WaveDrom, 0.1.1"
                    
#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 LiveMarkdown.Avalonia.WaveDrom@0.1.1
                    
#: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=LiveMarkdown.Avalonia.WaveDrom&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=LiveMarkdown.Avalonia.WaveDrom&version=0.1.1
                    
Install as a Cake Tool

LiveMarkdown.Avalonia.WaveDrom

demo

An extension package for LiveMarkdown.Avalonia that natively renders WaveDrom timing diagrams (digital waveform diagrams), written in Markdown code fences, as Avalonia controls without a JavaScript runtime or WebView.

This package is an extension of LiveMarkdown.Avalonia (the Markdown renderer for Avalonia). It does not work on its own — it plugs into LiveMarkdown.Avalonia to add ```wavedrom support. For the core Markdown rendering features, please refer to the LiveMarkdown.Avalonia repository.

The official WaveDrom rendering logic (layout, brick skins, markers, arrows, etc.) has been ported to C# and is drawn directly via DrawingContext.

Features

  • 🔌 Markdown integration — Detects ```wavedrom fences and renders them as waveform diagrams.
  • 🧩 Native rendering — No JS / WebView required. Runs on pure C# + Avalonia only.
  • 🎨 Official skin compliant — Supports the official default skin's brick definitions (pclk/nclk/vvv-N/xm*, etc.) and text class colors (info/muted/error/warning/success, headings h1–h6).
  • 🔄 Streaming support — Shows the source text while the fence is open, and switches to the rendered waveform diagram once it is closed.
  • 🧮 Rich feature set — signal / data / node / edge (arrows) / group / gaps (vertical lines and brackets) / head / foot (tick/tock/every, tspan rich text) / config (hscale, marks, hbounds, arcFontSize).

Installation

dotnet add package LiveMarkdown.Avalonia.WaveDrom

The LiveMarkdown.Avalonia core package is required (this package depends on it).

Adding to LiveMarkdown

To enable WaveDrom, perform the following three steps.

1. Register the extension in the pipeline

Add UseWaveDrom() to MarkdownRenderer.ConfigurePipeline.

using LiveMarkdown.Avalonia;

MarkdownRenderer.ConfigurePipeline += pipeline => pipeline
    .UseWaveDrom();

It can be used together with other extensions such as UseMermaid() and UseExtendedMathematics().

2. Register the node factory

Register WaveDromBlockNode (the node that converts a fence into an actual control).

MarkdownNode.Edit(builder => builder
    .Register<WaveDromBlockNode>()
);

To register multiple nodes at once:

MarkdownNode.Edit(builder => builder
    .Register<MermaidBlockNode>()
    .Register<WaveDromBlockNode>()
);

3. Load the styles

Include the bundled Styles.axaml in your app's App.axaml (or the relevant Styles).

<Application.Styles>
    <StyleInclude Source="avares://LiveMarkdown.Avalonia/Styles.axaml"/>
    <StyleInclude Source="avares://LiveMarkdown.Avalonia.WaveDrom/Styles.axaml"/>
</Application.Styles>

Combined configuration example (App.axaml.cs)

public override void Initialize()
{
    MarkdownRenderer.ConfigurePipeline += pipeline => pipeline
        .UseMermaid()
        .UseWaveDrom();

    MarkdownNode.Edit(builder => builder
        .Register<MermaidBlockNode>()
        .Register<WaveDromBlockNode>());

    AvaloniaXamlLoader.Load(this);
}

Usage

Write WaveDrom JSON (JavaScript-style object literals) inside a ```wavedrom fence in your Markdown. The official WaveDrom "loose JSON" notation (unquoted property names, single quotes, trailing commas) is also supported.

```wavedrom
{ signal: [
  { name: "clk",  wave: "P......" },
  { name: "bus",  wave: "x.==.=x", data: ["head", "body", "tail", "data"] },
  { name: "wire", wave: "0.1..0." }
]}
```

Main supported notation

Feature Example
Signal waveform wave: "01.zx=ud.23.456789", "p", "n", "P", "N", "h", "l"
Bus data wave: "x.345x", data: ["A", "B", "C"]
Clock pclk / nclk / Pclk (with arrows) / Nclk
Groups ['Master', [...]] / { name, signal: [...] }
Spacers wave: "p.....|..." (| is a repeat / spacer)
head / foot text / tick / tock / every / tspan rich text
Arrows / edges node: '.a..j' + edge: ['a~b t1', 'c-~>d time 3', ...]
gaps shapes gaps: "....|...." (vertical lines, brackets [/]/(/), etc.)
config hscale, marks, hbounds, arcFontSize

Arrow (edge) example

```wavedrom
{ signal: [
  { name: 'A', wave: '01........0....', node: '.a........j' },
  { name: 'B', wave: '0.1.......0.1..', node: '..b.......i' }
  ],
  edge: [ 'a~b t1', 'a-~>b time 3' ]
}
```

Customization

WaveDromPresenter exposes styleable properties. You can override them to match your theme through the Styles.axaml selector md|WaveDromPresenter.

<Style Selector="md|WaveDromPresenter">
    <Setter Property="FontSize" Value="12"/>
    <Setter Property="Foreground" Value="{DynamicResource ForegroundColor}"/>
    <Setter Property="MarkerBrush" Value="{DynamicResource SecondaryCardBackgroundColor}"/>
</Style>
Property Description
Text The WaveDrom JSON string to render.
Foreground Base color for waveforms and text.
FontFamily / FontSize Font for text in the diagram.
BackgroundBrush Background of the whole diagram (transparent by default).
MarkerBrush Fill for data boxes (theme color by default).

Limitations

Some items are unsupported or approximate (see .agents/wavedrom-todo.md in the repository for details).

  • Slave signals (wave: "s...")
  • config.skin (other skins such as narrow / dark; brick dimensions differ from default)
  • Fill colors for skins other than default
  • Automated verification of on-screen rendering (pixels)

Release (GitHub Actions)

Pushing a tag like v0.1.0 triggers the Release workflow, which:

  1. restores, builds and packs the project in Release configuration,
  2. uploads the generated .nupkg as a workflow artifact,
  3. publishes the package to NuGet.org using NuGet Trusted Publishing (an OIDC-exchanged, short-lived API key — no long-lived secret is stored),
  4. creates a GitHub Release with the .nupkg attached and auto-generated notes.

Trusted Publishing setup

No long-lived NUGET_API_KEY is required. Instead, configure a trusted publishing policy on nuget.org and expose your nuget.org profile name as NUGET_USER:

  1. On nuget.org, go to Account settings → Trusted Publishing and add a policy for this repository (owner/repo) and the workflow file .github/workflows/release.yml.
  2. In GitHub, add NUGET_USER under Settings → Secrets and variables → Actions, set to your nuget.org profile name. It may be added on either the Variables tab (vars.NUGET_USER) or the Secrets tab (secrets.NUGET_USER) — the workflow reads whichever is present (variable takes precedence).

The publish step only runs for tag pushes (v*) or a manual dispatch with an explicit version; 0.0.0-dev.* builds are never pushed. If NUGET_USER is missing, the workflow fails early with a clear message.

git tag v0.1.0
git push origin v0.1.0

The workflow can also be started manually from the Actions tab (workflow_dispatch) by supplying a version number.

License

Apache-2.0

References

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
0.1.1 98 11/5/2026
0.1.0 93 11/5/2026