Blaizio.Syntax
0.3.6
See the version list below for details.
dotnet add package Blaizio.Syntax --version 0.3.6
NuGet\Install-Package Blaizio.Syntax -Version 0.3.6
<PackageReference Include="Blaizio.Syntax" Version="0.3.6" />
<PackageVersion Include="Blaizio.Syntax" Version="0.3.6" />
<PackageReference Include="Blaizio.Syntax" />
paket add Blaizio.Syntax --version 0.3.6
#r "nuget: Blaizio.Syntax, 0.3.6"
#:package Blaizio.Syntax@0.3.6
#addin nuget:?package=Blaizio.Syntax&version=0.3.6
#tool nuget:?package=Blaizio.Syntax&version=0.3.6
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 | Versions 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. |
-
net10.0
- Blaizio.Base (>= 0.3.6)
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.