SpecWorks.OfficeTalk
0.5.0
dotnet add package SpecWorks.OfficeTalk --version 0.5.0
NuGet\Install-Package SpecWorks.OfficeTalk -Version 0.5.0
<PackageReference Include="SpecWorks.OfficeTalk" Version="0.5.0" />
<PackageVersion Include="SpecWorks.OfficeTalk" Version="0.5.0" />
<PackageReference Include="SpecWorks.OfficeTalk" />
paket add SpecWorks.OfficeTalk --version 0.5.0
#r "nuget: SpecWorks.OfficeTalk, 0.5.0"
#:package SpecWorks.OfficeTalk@0.5.0
#addin nuget:?package=SpecWorks.OfficeTalk&version=0.5.0
#tool nuget:?package=SpecWorks.OfficeTalk&version=0.5.0
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 | Versions 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. |
-
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.