Yaml2Doc.Core 1.1.0

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

Yaml2Doc.Core

Yaml2Doc.Core is the core library behind Yaml2Doc. It provides:

  • A neutral in-memory model (PipelineDocument) for generic YAML.
  • YAML dialect implementations that interpret different kinds of pipeline YAML:
    • StandardYamlDialect – treats input as plain YAML (no CI/CD semantics).
    • GitHubActionsYamlDialect – understands GitHub Actions workflows.
    • AzurePipelinesYamlDialect – understands Azure DevOps pipeline YAML.
  • Loading and parsing helpers (YamlDocumentContext, YamlLoader).
  • A dialect registry (Yaml2DocRegistry) for selecting how YAML should be interpreted.

Use this package if you want to integrate Yaml2Doc’s core parsing and modeling into your own tools or renderers.


Installation

dotnet add package Yaml2Doc.Core

Basic usage (standard YAML)

The typical flow for plain �standard� YAML is:

  1. Load a YAML document into a YamlDocumentContext.
  2. Use the dialect registry to resolve the Standard YAML dialect.
  3. Parse into a PipelineDocument.
using System.IO;
using Yaml2Doc.Core.Dialects;
using Yaml2Doc.Core.Engine;
using Yaml2Doc.Core.Models;
using Yaml2Doc.Core.Parsing;

// Load YAML text
var yamlText = File.ReadAllText("pipeline.yml");

// Create a document context
var context = YamlDocumentContext.FromString(yamlText);

// Set up loader and dialects
var loader = new YamlLoader();
var standardDialect = new StandardYamlDialect(loader);

// For v1.1.0+, you can also register other dialects:
var ghaDialect = new GitHubActionsDialect(loader);
var adoDialect = new AzurePipelinesDialect(loader);

// Register dialect(s)
var registry = new Yaml2DocRegistry(new[] { standardDialect, ghaDialect, adoDialect });

// Resolve the dialect for this document (standard will win by default)
var dialect = registry.ResolveDialect(context);

// Parse into the neutral model
PipelineDocument document = dialect.Parse(context);

// You now have a PipelineDocument with Name + Root keys (and possibly dialect-specific metadata)

PipelineDocument is intentionally minimal at the core: it exposes a document Name (if present) and a Root dictionary representing the top-level YAML mapping, plus any extra fields the dialect populates (e.g., triggers/jobs metadata for CI/CD dialects).


Forcing a specific dialect

If you know in advance which dialect you want (e.g., this file is definitely a GitHub Actions workflow), you can use a forced ID when resolving:

var registry = new Yaml2DocRegistry(new[] { standardDialect, ghaDialect, adoDialect });

// Ask explicitly for the "gha" dialect
var dialect = registry.ResolveDialect(context, forcedId: "gha");

PipelineDocument document = dialect.Parse(context);

The semantic IDs typically match the CLI:

  • standard
  • gha
  • ado

If no forcedId is provided, the registry falls back to dialect detection, with the Standard dialect acting as the catch-all for generic YAML documents.


API documentation

For full type and member details, see:

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.  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 (2)

Showing the top 2 NuGet packages that depend on Yaml2Doc.Core:

Package Downloads
Yaml2Doc.Markdown

Renderer library that converts the neutral pipeline model into human-friendly Markdown documentation.

Yaml2Doc.Cli

Command-line tool that converts YAML pipeline definitions into Markdown documentation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 189 12/4/2025
1.1.0-preview.26-ga1ebf43 157 12/4/2025
1.1.0-preview.25-gc4d1d21 155 12/4/2025
1.0.0 168 12/3/2025
1.0.0-preview.24-gd822a58 160 12/3/2025
1.0.0-preview.23-g2fad194 171 12/3/2025
1.0.0-preview.22-gd7f78e2 156 12/3/2025
1.0.0-preview.21-g71d2f29 149 12/3/2025
1.0.0-preview.20-ga2d3c5e 160 12/3/2025