ap0llo-gh-badges-sharp - Grynwald.GhBadgesSharp 1.1.163-pre
A C#/.NET port of the gh-badges library.
PM> Install-Package Grynwald.GhBadgesSharp -Version 1.1.163-pre -Source https://www.myget.org/F/ap0llo-gh-badges-sharp/api/v3/index.json
> nuget.exe install Grynwald.GhBadgesSharp -Version 1.1.163-pre -Source https://www.myget.org/F/ap0llo-gh-badges-sharp/api/v3/index.json
> dotnet add package Grynwald.GhBadgesSharp --version 1.1.163-pre --source https://www.myget.org/F/ap0llo-gh-badges-sharp/api/v3/index.json
source https://www.myget.org/F/ap0llo-gh-badges-sharp/api/v3/index.json
nuget Grynwald.GhBadgesSharp ~> 1.1.163-pre
Copy to clipboard
> choco install Grynwald.GhBadgesSharp --version 1.1.163-pre --source https://www.myget.org/F/ap0llo-gh-badges-sharp/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "ap0llo-gh-badges-sharp" -SourceLocation "https://www.myget.org/F/ap0llo-gh-badges-sharp/api/v2"
Install-Module -Name "Grynwald.GhBadgesSharp" -RequiredVersion "1.1.163-pre" -Repository "ap0llo-gh-badges-sharp" -AllowPreRelease
Copy to clipboard
gh-badges-sharp
A C#/.NET port of the gh-badges library that powers shields.io
Overview
GhBadgesSharp is a C#/.NET port of the gh-badges library that powers shields.io.
See Acknowledgments for license info.
Installation
GhBadgesSharp is distributed as NuGet package.
Usage
After installation, a badge can be rendered by calling Badge.MakeBadge.
It will return the badge as an SVG image (as XElement).
The following code shows how to render this badge:
using System.IO;
using System.Xml.Linq;
using Grynwald.GhBadgesSharp;
public class Program
{
public static void Main(string[] args)
{
XElement badge = Badge.MakeBadge(
style: BadgeStyle.Flat,
leftText: "Hello",
rightText: "World",
color: NamedColor.Green
);
File.WriteAllText("badge.svg", badge.ToString());
}
}
Building from source
Note: This repository uses git submodules, clone using git clone --recursive
Building GhBadgesSharp from source requires the .NET 6 SDK (version 6.0.101 as specified in global.json) and uses Cake for the build.
To execute the default task, run
.\build.ps1
This will build the project, run all tests and pack the NuGet package.
Acknowledgments
This library is a C# port of the gh-badges library.
- gh-badges is licensed under Creative Commons Zero v1.0 Universal license.
- Portions of this library were ported from the is-css-color library, licensed under the MIT License
- Portions of this library were ported from the anafanafo library, licensed under the MIT License
Libraries used (aside from .NET Core and .NET Standard):
- Json.NET
- Fluid
- Nerdbank.GitVersioning
- SourceLink
- ReportGenerator
- Cake
- Cake.BuildSystems.Module
- xUnit
- ApprovalTests
- PublicApiGenerator
Versioning and Branching
The version of this project is automatically derived from git and the information
in version.json using Nerdbank.GitVersioning:
- The master branch always contains the latest version. Packages produced from
master are always marked as pre-release versions (using the
-presuffix). - Stable versions are built from release branches. Build from release branches
will have no
-presuffix - Builds from any other branch will have both the
-preprerelease tag and the git commit hash included in the version string
To create a new release branch use the nbgv tool:
dotnet tool restore
dotnet tool run nbgv -- prepare-release
-
.NETFramework 4.6.1
- Fluid.Core (>= 2.3.1)
- Newtonsoft.Json (>= 13.0.2)
-
.NETStandard 2.0
- Fluid.Core (>= 2.3.1)
- Newtonsoft.Json (>= 13.0.2)
- .NETFramework 4.6.1: 4.6.1.0
- .NETStandard 2.0: 2.0.0.0
Ownersap0llo |
AuthorsAndreas Gruenwald |
Project URLhttps://github.com/ap0llo/gh-badges-sharp |
LicenseUnknown |
Info35 total downloads |
| 4 downloads for version 1.1.163-pre |
| Download (178.75 KB) |
| Found on the current feed only |
Package history
| Version | Size | Last updated | Downloads | Mirrored? | |||
|---|---|---|---|---|---|---|---|
|
|
1.1.164-pre | 178.79 KB | Sun, 26 Feb 2023 09:48:43 GMT | 5 |
|
||
|
|
1.1.163-pre | 178.75 KB | Sun, 26 Feb 2023 09:49:29 GMT | 4 |
|
||
|
|
1.1.162-pre | 178.78 KB | Sat, 31 Dec 2022 17:15:45 GMT | 9 |
|
||
|
|
1.1.161-pre | 178.78 KB | Thu, 22 Dec 2022 13:57:52 GMT | 8 |
|
||
|
|
1.1.160-pre | 178.79 KB | Thu, 22 Dec 2022 13:52:04 GMT | 9 |
|