Smdn.LibHighlightSharp 1.2.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Smdn.LibHighlightSharp --version 1.2.0
NuGet\Install-Package Smdn.LibHighlightSharp -Version 1.2.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="Smdn.LibHighlightSharp" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Smdn.LibHighlightSharp --version 1.2.0
#r "nuget: Smdn.LibHighlightSharp, 1.2.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.
// Install Smdn.LibHighlightSharp as a Cake Addin
#addin nuget:?package=Smdn.LibHighlightSharp&version=1.2.0

// Install Smdn.LibHighlightSharp as a Cake Tool
#tool nuget:?package=Smdn.LibHighlightSharp&version=1.2.0

Smdn.LibHighlightSharp-1.2.0

Provides wrapper classes for using various versions of André Simon's Highlight on .NET.

API List

List of APIs exposed by assembly Smdn.LibHighlightSharp-1.2.0 (net8.0)

// Smdn.LibHighlightSharp.dll (Smdn.LibHighlightSharp-1.2.0)
//   Name: Smdn.LibHighlightSharp
//   AssemblyVersion: 1.2.0.0
//   InformationalVersion: 1.2.0+a8211defa9884dc158cae8b9627dad69379698bb
//   TargetFramework: .NETCoreApp,Version=v8.0
//   Configuration: Release
//   Referenced assemblies:
//     Microsoft.CSharp, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     Smdn.LibHighlightSharp.Bindings, Version=3.36.0.0, Culture=neutral
//     System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Linq, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Linq.Expressions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Threading, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Xml.ReaderWriter, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Xml.XDocument, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//   Embedded resources:
//     null.lang (450 bytes, Embedded, ContainedInManifestFile)
//     null.theme (774 bytes, Embedded, ContainedInManifestFile)
#nullable enable annotations

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Xml.Linq;
using Smdn.LibHighlightSharp;
using Smdn.LibHighlightSharp.Bindings;

namespace Smdn.LibHighlightSharp {
  public enum GeneratorOutputType : int {
    BBCode = 8,
    EscapeSequencesAnsi = 5,
    EscapeSequencesTrueColor = 11,
    EscapeSequencesXterm256 = 6,
    Html = 0,
    LaTeX = 3,
    Odt = 10,
    Pango = 9,
    Rtf = 4,
    Svg = 7,
    TeX = 2,
    Xhtml = 1,
  }

  public enum HighlightElementType : int {
    Default = 1,
    ErrorMessage = 20,
    EscapedCharacter = 6,
    HoverText = 18,
    KeywordA = 12,
    KeywordB = 13,
    KeywordC = 14,
    KeywordD = 15,
    KeywordE = 16,
    KeywordF = 17,
    LineNumber = 9,
    MultiLineComment = 5,
    Number = 3,
    Operator = 10,
    Other = 0,
    Preprocessor = 7,
    PreprocessorString = 8,
    SingleLineComment = 4,
    StringInterpolation = 11,
    Strings = 2,
    SyntaxError = 19,
  }

  public class Highlight : IDisposable {
    public static readonly Version MinimumVersionSupportingBase16Themes; // = "3.44"
    public static readonly Version MinimumVersionSupportingGuessFileType; // = "3.51"
    public static readonly Version MinimumVersionSupportingLoadFileTypesConfig; // = "3.51"

    public static string? GeneratorInformationalVersion { get; }

    public static DataDir? CreateDefaultDataDir() {}

    public Highlight(DataDir dataDir, GeneratorOutputType outputType = GeneratorOutputType.Html, bool shouldDisposeDataDir = false) {}
    public Highlight(DataDir dataDirForSyntaxes, DataDir dataDirForThemes, GeneratorOutputType outputType = GeneratorOutputType.Html, bool shouldDisposeDataDir = false) {}
    public Highlight(GeneratorOutputType outputType = GeneratorOutputType.Html) {}
    public Highlight(string dataDir, GeneratorOutputType outputType = GeneratorOutputType.Html) {}
    public Highlight(string dataDirForSyntaxes, string dataDirForThemes, GeneratorOutputType outputType = GeneratorOutputType.Html) {}

    public char? AdditionalEndOfFileChar { get; set; }
    public string BaseFont { get; set; }
    public string BaseFontSize { get; set; }
    public bool Fragment { get; set; }
    [Obsolete("Use GeneratorInformationalVersion instead.")]
    public string? GeneratorVersionString { get; }
    public bool IncrementWrappedLineNumber { get; set; }
    public bool IsolateTags { get; set; }
    public bool KeepInjections { get; set; }
    public string? LastSyntaxError { get; }
    public int LineNumberWidth { get; set; }
    public bool LineNumberZeroPadding { get; set; }
    public bool OmitVersionComment { get; set; }
    public GeneratorOutputType OutputType { get; }
    public bool PrintLineNumbers { get; set; }
    public string StyleInputPath { get; set; }
    public string StyleName { get; }
    public string StyleOutputPath { get; set; }
    public string? SyntaxCategoryDescription { get; }
    public string? SyntaxDescription { get; }
    public string? SyntaxEncodingHint { get; }
    public string? ThemeCategoryDescription { get; }
    public string? ThemeDescription { get; }
    public string Title { get; set; }
    public bool ValidateInput { get; set; }

    protected virtual void Dispose(bool disposing) {}
    public void Dispose() {}
    public IEnumerable<string> EnumerateSyntaxFiles() {}
    public IEnumerable<(string Path, string? Description)> EnumerateSyntaxFilesWithDescription() {}
    public IEnumerable<string> EnumerateThemeFiles() {}
    public IEnumerable<(string Path, string? Description)> EnumerateThemeFilesWithDescription() {}
    public string Generate(string input) {}
    public void Generate(string inputPath, string outputPath) {}
    public string GenerateFromFile(string path) {}
    public string GuessFileType(string inputFilePath) {}
    public void LoadFileTypesConfig(string fileTypesConfPath) {}
    public void SetEncoding(string encodingName) {}
    public void SetIncludeStyle(bool trueForInclude) {}
    public void SetSyntax(string name) {}
    public void SetSyntaxFromFile(string pathToLangFile) {}
    public void SetTheme(string name) {}
    public void SetThemeBase16(string name) {}
    public void SetThemeFromFile(string pathToThemeFile) {}
    public bool TryFindSyntaxFile(string name, [NotNullWhen(true)] out string? syntaxFilePath) {}
    public bool TryFindThemeBase16File(string name, [NotNullWhen(true)] out string? themeFilePath) {}
    public bool TryFindThemeFile(string name, [NotNullWhen(true)] out string? themeFilePath) {}
    public bool TryLoadFileTypesConfig() {}
  }

  public sealed class HighlightHtmlClass :
    IEquatable<HighlightHtmlClass>,
    IEquatable<string>
  {
    public static HighlightHtmlClass Default { get; }
    public static HighlightHtmlClass DefaultV3 { get; }
    public static HighlightHtmlClass DefaultV4 { get; }
    public static HighlightHtmlClass ErrorMessage { get; }
    public static HighlightHtmlClass EscapedCharacter { get; }
    public static HighlightHtmlClass Highlight { get; }
    public static HighlightHtmlClass HoverText { get; }
    public static HighlightHtmlClass KeywordA { get; }
    public static HighlightHtmlClass KeywordB { get; }
    public static HighlightHtmlClass KeywordC { get; }
    public static HighlightHtmlClass KeywordD { get; }
    public static HighlightHtmlClass KeywordE { get; }
    public static HighlightHtmlClass KeywordF { get; }
    public static HighlightHtmlClass LineNumber { get; }
    public static HighlightHtmlClass MultiLineComment { get; }
    public static HighlightHtmlClass Number { get; }
    public static HighlightHtmlClass Operator { get; }
    public static HighlightHtmlClass Preprocessor { get; }
    public static HighlightHtmlClass PreprocessorString { get; }
    public static HighlightHtmlClass SingleLineComment { get; }
    public static HighlightHtmlClass StringInterpolation { get; }
    public static HighlightHtmlClass Strings { get; }
    public static HighlightHtmlClass StringsV3 { get; }
    public static HighlightHtmlClass StringsV4 { get; }
    public static HighlightHtmlClass SyntaxError { get; }

    public static bool TryParse(string className, [NotNullWhen(true)] out HighlightHtmlClass? @class) {}
    public static bool TryParsePrefixed(string prefixedClassName, [NotNullWhen(true)] out HighlightHtmlClass? @class) {}

    public string ClassName { get; }
    public HighlightElementType ElementType { get; }

    public bool Equals(HighlightHtmlClass? other) {}
    public bool Equals(string? other) {}
    public override bool Equals(object? obj) {}
    public override int GetHashCode() {}
    public override string ToString() {}
  }

  public class HighlightParserException : InvalidOperationException {
    public HighlightParserException(string message) {}
    public HighlightParserException(string message, ParseError reason) {}

    public ParseError Reason { get; }
  }

  public class HighlightSyntaxException : InvalidOperationException {
    public HighlightSyntaxException(string langFilePath, LoadResult reason) {}
    public HighlightSyntaxException(string message) {}

    public string? LangFilePath { get; }
    public LoadResult Reason { get; }
  }

  public class HighlightThemeException : InvalidOperationException {
    public HighlightThemeException(string message) {}
    public HighlightThemeException(string themeFilePath, string? reason) {}

    public string? Reason { get; }
    public string? ThemeFilePath { get; }
  }
}

namespace Smdn.LibHighlightSharp.Xhtml {
  public class XhtmlHighlight : Highlight {
    protected static IEnumerable<(XElement HighlightedElement, HighlightHtmlClass HighlightClass)> EnumerateHighlightedElements(XContainer container) {}

    public XhtmlHighlight() {}
    public XhtmlHighlight(DataDir dataDir, bool shouldDisposeDataDir = false) {}
    public XhtmlHighlight(DataDir dataDirForSyntaxes, DataDir dataDirForThemes, bool shouldDisposeDataDir = false) {}
    public XhtmlHighlight(string dataDir) {}
    public XhtmlHighlight(string dataDirForSyntaxes, string dataDirForThemes) {}

    public bool PreserveWhitespace { get; set; }

    public XDocument GenerateXhtmlDocument(string input) {}
    public XDocument GenerateXhtmlDocumentFromFile(string path) {}
    public IEnumerable<XNode> GenerateXhtmlFragment(string input) {}
    public IEnumerable<XNode> GenerateXhtmlFragmentFromFile(string path) {}
    protected virtual void PostProcessXhtml(XContainer container) {}
  }
}
// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.3.2.0.
// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.2.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)

NOTICE

This package uses the following components via the package Smdn.LibHighlightSharp.Bindings:

Highlight

The dependent package Smdn.LibHighlightSharp.Bindings uses Highlight, and is licensed under the GNU General Public License v3.0 (see COPYING.txt).

Lua (Windows only)

For Windows, the dependent package Smdn.LibHighlightSharp.Bindings bundles Lua Windows DLL which Highlight depends, and is licensed under the MIT License:

Copyright © 1994–2021 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 89 2/4/2024
1.1.4 230 6/6/2023
1.1.3 496 12/18/2022
1.1.2 309 12/14/2022
1.1.1 343 12/11/2022
1.1.0 384 12/6/2022
1.0.0 1,224 12/1/2022
1.0.0-preview3 123 11/30/2022