Blaizio.Syntax 0.3.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blaizio.Syntax --version 0.3.7
                    
NuGet\Install-Package Blaizio.Syntax -Version 0.3.7
                    
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="Blaizio.Syntax" Version="0.3.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blaizio.Syntax" Version="0.3.7" />
                    
Directory.Packages.props
<PackageReference Include="Blaizio.Syntax" />
                    
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 Blaizio.Syntax --version 0.3.7
                    
#r "nuget: Blaizio.Syntax, 0.3.7"
                    
#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 Blaizio.Syntax@0.3.7
                    
#: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=Blaizio.Syntax&version=0.3.7
                    
Install as a Cake Addin
#tool nuget:?package=Blaizio.Syntax&version=0.3.7
                    
Install as a Cake Tool

Blaizio.Syntax

Syntax highlighting for Blazor, in C#. SyntaxText splits code into runs of one kind (keyword, string, type, function, comment, ...) per line, and SyntaxDocument keeps each line's tokens so code that grows or changes re-tokenizes only the lines that did. There is no script: highlighting looks the same in static rendering, on Blazor Server, in WebAssembly and while prerendering.

19 languages are built in: C#, Razor, JSON, bash, console sessions, PowerShell, TypeScript, JavaScript, HTML, XML, CSS, SQL, YAML, diff, HTTP request files, Dockerfile, INI, TOML and Markdown.

More languages

Add them where the app configures Blaizio:

builder.Services.AddBlaizio(options => options.Syntax
    .Add(SyntaxLanguages.Python, SyntaxLanguages.Go)   // Blaizio.Syntax.Languages
    .Alias("py3", "python"));

or describe one with SyntaxGrammar:

options.Syntax.Add(new SyntaxGrammar("gleam", "gl")
    .LineComment("//")
    .String("\"")
    .Keywords("as assert case const fn if import let opaque panic pub todo type use")
    .Constants("True False Nil")
    .Declarations("fn", SyntaxKind.Function)
    .Numbers()
    .Functions()
    .PascalCaseTypes());

For anything a table cannot say, derive from SyntaxLanguage and write the scanner yourself.

The Blaizio Code Block (blaizio add code-block) renders the runs in your theme's colors. Docs: https://blaiz.io/docs/components/code-block.

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 (1)

Showing the top 1 NuGet packages that depend on Blaizio.Syntax:

Package Downloads
Blaizio.Syntax.Languages

More languages for Blaizio.Syntax and the Blaizio Code Block: Python, Java, Go, Rust, C, C++, Kotlin, Swift, PHP, Ruby, Dart, Lua, Scala, F#, VB.NET, Haskell, Elixir, Clojure, GraphQL, Protocol Buffers, HCL (Terraform), Bicep, Makefile, nginx, CMake, batch files, R, Perl, Julia, Objective-C and LaTeX. Each is a compact grammar table you add in AddBlaizio (options.Syntax.Add(SyntaxLanguages.Python) or AddAll()); trimming drops the ones an app does not add.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.9 50 12/3/2026
0.3.8 64 12/3/2026
0.3.7 100 12/1/2026
0.3.6 126 11/22/2026