Ookii.FormatC
2.1.0
See the version list below for details.
dotnet add package Ookii.FormatC --version 2.1.0
NuGet\Install-Package Ookii.FormatC -Version 2.1.0
<PackageReference Include="Ookii.FormatC" Version="2.1.0" />
paket add Ookii.FormatC --version 2.1.0
#r "nuget: Ookii.FormatC, 2.1.0"
// Install Ookii.FormatC as a Cake Addin #addin nuget:?package=Ookii.FormatC&version=2.1.0 // Install Ookii.FormatC as a Cake Tool #tool nuget:?package=Ookii.FormatC&version=2.1.0
FormatC 2.0
Copyright © Sven Groot (Ookii.org)
FormatC is a class library for Microsoft .Net that provides syntax highlighting for several programming languages. FormatC includes support for C#, Visual Basic, C++, XML, Transact-SQL and PowerShell. FormatC can be extended to support other languages if necessary.
FormatC takes as input source code in any of the supported languages, and produces HTML as output containing the syntax highlighted source. You need to use the provided CSS file for the syntax highlighting to work. You can customize the the CSS file to suit your own syntax highlighting preferences.
The C# and Visual Basic languages contain several keywords that are contextual keywords. For example, 'from' is a keyword in a Linq expression, but not elsewhere, and you can still have variables named 'from' without prefixing them with @ (in C#) or enclosing them in [] (in Visual Basic).
Because of the limitations of regular expressions, FormatC cannot determine when a contextual keyword should be treated as a keyword and when it should be treated as a regular identifier. Because of this, it always treats them as keywords.
You can prefix an identifier that is also a contextual keyword with ` (e.g. `from) to prevent it from being highlighted as a keyword. The ` character will not appear in the formatted output, and the identifier will not be highlighted.
You can specify identifiers that should be colored as type names using the Types property of both the CSharpFormattingInfo and VisualBasicFormattingInfo classes. These identifiers will then always be formatted as type names (even in contexts where they are not). Like with contextual keywords, you can prefix an identifier with ` to prevent it from being highlighted as a type name.
Visual Basic XML literals are supported, however the XML literals must be marked explicitly with with [xml][/xml]. For example, this would look like this with a simple XML literal:
Dim xmlLiteral = [xml]<Foo />[/xml]
The [xml][/xml] tags will not be included in the output, and the contents of those tags will be formatted as XML literals. Embedded expressions in XML literals (which are delimited by <%= %> blocks) are also supported, and the contents of embedded expressions will be formatted as Visual Basic code.
For information on how to use FormatC in your application, and how to extend it, please refer to the included library documentation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.0
- Microsoft.CSharp (>= 4.6.0)
- System.Management.Automation (>= 6.2.3)
-
.NETFramework 4.5
- Microsoft.CSharp (>= 4.6.0)
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.