SpecWorks.OfficeTalk 0.5.0

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

OfficeTalk .NET Library

A .NET 9 library for parsing and validating OfficeTalk documents — a grammar for deterministic modifications to Microsoft Office documents (Word, Excel, PowerPoint).

Features

  • Parse OfficeTalk documents into a typed AST
  • Validate against syntactic rules (grammar-level checks, conflict detection)

Installation

dotnet add package SpecWorks.OfficeTalk

Quick Start

Parse an OfficeTalk Document

using OfficeTalk.Parsing;

var source = @"
OFFICETALK/1.0
DOCTYPE word

AT body/heading[level=1]
SET ""Annual Report — FY2026""
FORMAT font-size=28pt, color=#1F3864

AT body/paragraph[text*=""teh company""]
REPLACE ""teh"" WITH ""the""
";

var lexer = new OfficeTalkLexer(source);
var tokens = lexer.Tokenize();
var parser = new OfficeTalkParser(tokens);
var document = parser.Parse();

Console.WriteLine($"Version: {document.Version}");
Console.WriteLine($"DocType: {document.DocType}");
Console.WriteLine($"Blocks: {document.OperationBlocks.Count}");

Validate an OfficeTalk Document

using OfficeTalk.Validation;

var syntacticValidator = new SyntacticValidator();
var result = syntacticValidator.Validate(document);

if (!result.IsValid)
{
    foreach (var error in result.Errors)
        Console.Error.WriteLine(error);
}

Architecture

OfficeTalk/
├── Parsing/           Lexer and parser for OfficeTalk grammar
│   ├── Token.cs       Token types for the grammar
│   ├── OfficeTalkLexer.cs   Line-oriented tokenizer
│   └── OfficeTalkParser.cs  Parser producing typed AST
├── Ast/               Abstract syntax tree types
│   ├── OfficeTalkDocument.cs  Root AST node
│   ├── OperationBlock.cs      AT address + operations
│   ├── Address.cs             Address with segments
│   ├── AddressSegment.cs      Segment + predicates
│   ├── Predicate.cs           Predicate types
│   ├── Operations.cs          All operation types
│   └── DataTypes.cs           Color, Length, etc.
└── Validation/        Syntactic validation
    ├── SyntacticValidator.cs
    └── ValidationResult.cs

Requirements

  • .NET 9.0 or later

Testing

cd dotnet
dotnet test

License

MIT License

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.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SpecWorks.OfficeTalk:

Package Downloads
SpecWorks.MarkMyWord

A .NET library for converting CommonMark markdown to Microsoft Word (.docx) documents with syntax highlighting and Mermaid diagrams. Supports headings, paragraphs, emphasis, code blocks with syntax highlighting (JSON, TypeSpec, Bash), Mermaid diagram rendering, links, images, lists, tables, and more.

SpecWorks.OfficeTalkEngine

Execution engine for OfficeTalk documents — resolves addresses and applies deterministic operations to Microsoft Office documents via OpenXML SDK.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 174 3/18/2026
0.4.0 108 3/18/2026
0.2.0 135 3/15/2026
0.1.0 169 3/14/2026