diff --git a/GEmojiSharp.AspNetCore.md b/GEmojiSharp.AspNetCore.md new file mode 100644 index 0000000..3df9a45 --- /dev/null +++ b/GEmojiSharp.AspNetCore.md @@ -0,0 +1,61 @@ +# GEmojiSharp.AspNetCore 📦 + +[![Build status](https://github.com/hlaueriksson/GEmojiSharp/workflows/build/badge.svg)](https://github.com/hlaueriksson/GEmojiSharp/actions?query=workflow%3Abuild) [![CodeFactor](https://www.codefactor.io/repository/github/hlaueriksson/gemojisharp/badge)](https://www.codefactor.io/repository/github/hlaueriksson/gemojisharp) + +> GitHub Emoji for ASP.NET Core + +The package includes: + +- TagHelpers +- HtmlHelpers + +## TagHelpers + +Update the `_ViewImports.cshtml` file, to enable tag helpers in all Razor views: + +```cshtml +@addTagHelper *, GEmojiSharp.AspNetCore +``` + +Use the `` tag or `emoji` attribute to render emojis: + +```html + +:tada: initial commit +``` + +Do you want to use emoji anywhere, on any tag, in the `body`? Then you can use the `BodyTagHelperComponent`. + +Registration via services container: + +```cs +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddRazorPages(); +builder.Services.AddTransient(); +``` + +Use any tag to render emojis: + +```html +

Hello, :earth_africa:

+``` + +## HtmlHelpers + +Update the `_ViewImports.cshtml` file, to enable HTML helpers in all Razor views: + +```cshtml +@using GEmojiSharp.AspNetCore +``` + +Use the `Emoji` extension methods to render emojis: + +```cshtml +@Html.Emoji(":tada: initial commit") +@Html.Emoji(x => x.Text) +``` + +## Would you like to know more? 🤔 + +Further documentation is available at [https://github.com/hlaueriksson/GEmojiSharp](https://github.com/hlaueriksson/GEmojiSharp) diff --git a/GEmojiSharp.Blazor.md b/GEmojiSharp.Blazor.md new file mode 100644 index 0000000..b368a67 --- /dev/null +++ b/GEmojiSharp.Blazor.md @@ -0,0 +1,23 @@ +# GEmojiSharp.Blazor 📦 + +[![Build status](https://github.com/hlaueriksson/GEmojiSharp/workflows/build/badge.svg)](https://github.com/hlaueriksson/GEmojiSharp/actions?query=workflow%3Abuild) [![CodeFactor](https://www.codefactor.io/repository/github/hlaueriksson/gemojisharp/badge)](https://www.codefactor.io/repository/github/hlaueriksson/gemojisharp) + +> GitHub Emoji for Blazor + +The package is a Razor class library (RCL) with a Razor component. + +Update the `_Imports.razor` file, to enable the component in all Razor views: + +```cshtml +@using GEmojiSharp.Blazor +``` + +Use the `` component to render emojis: + +```html +:tada: initial commit +``` + +## Would you like to know more? 🤔 + +Further documentation is available at [https://github.com/hlaueriksson/GEmojiSharp](https://github.com/hlaueriksson/GEmojiSharp) diff --git a/GEmojiSharp.md b/GEmojiSharp.md new file mode 100644 index 0000000..1ebd9ef --- /dev/null +++ b/GEmojiSharp.md @@ -0,0 +1,44 @@ +# GEmojiSharp 📦 + +[![Build status](https://github.com/hlaueriksson/GEmojiSharp/workflows/build/badge.svg)](https://github.com/hlaueriksson/GEmojiSharp/actions?query=workflow%3Abuild) [![CodeFactor](https://www.codefactor.io/repository/github/hlaueriksson/gemojisharp/badge)](https://www.codefactor.io/repository/github/hlaueriksson/gemojisharp) + +> GitHub Emoji for C# and .NET + +Static methods: + +```csharp +Emoji.Get(":tada:").Raw; // 🎉 +Emoji.Get("🎉").Alias(); // :tada: +Emoji.Raw(":tada:"); // 🎉 +Emoji.Alias("🎉"); // :tada: +Emoji.Emojify(":tada: initial commit"); // 🎉 initial commit +Emoji.Demojify("🎉 initial commit"); // :tada: initial commit +Emoji.Find("party popper").First().Raw; // 🎉 +``` + +Extension methods: + +```csharp +":tada:".GetEmoji().Raw; // 🎉 +"🎉".GetEmoji().Alias(); // :tada: +":tada:".RawEmoji(); // 🎉 +"🎉".EmojiAlias(); // :tada: +":tada: initial commit".Emojify(); // 🎉 initial commit +"🎉 initial commit".Demojify(); // :tada: initial commit +"party popper".FindEmojis().First().Raw; // 🎉 +``` + +Regular expression pattern to match all emojis: + +```csharp +var text = "Lorem 😂😂 ipsum"; + +var matches = Regex.Matches(text, Emoji.RegexPattern); +string.Join(string.Empty, matches.Select(x => x.Value)); // 😂😂 + +Regex.Replace(text, Emoji.RegexPattern, string.Empty); // Lorem ipsum +``` + +## Would you like to know more? 🤔 + +Further documentation is available at [https://github.com/hlaueriksson/GEmojiSharp](https://github.com/hlaueriksson/GEmojiSharp) diff --git a/src/GEmojiSharp.AspNetCore/GEmojiSharp.AspNetCore.csproj b/src/GEmojiSharp.AspNetCore/GEmojiSharp.AspNetCore.csproj index 460b103..37420c8 100644 --- a/src/GEmojiSharp.AspNetCore/GEmojiSharp.AspNetCore.csproj +++ b/src/GEmojiSharp.AspNetCore/GEmojiSharp.AspNetCore.csproj @@ -19,6 +19,7 @@ GEmojiSharp.AspNetCore https://github.com/hlaueriksson/GEmojiSharp icon.png + GEmojiSharp.AspNetCore.md emoji;gemoji;aspnetcore;aspnetcoremvc;taghelper;taghelpers;htmlhelper;htmlhelpers MIT true @@ -28,6 +29,7 @@ + diff --git a/src/GEmojiSharp.Blazor/GEmojiSharp.Blazor.csproj b/src/GEmojiSharp.Blazor/GEmojiSharp.Blazor.csproj index 55e89ba..e5f8d1d 100644 --- a/src/GEmojiSharp.Blazor/GEmojiSharp.Blazor.csproj +++ b/src/GEmojiSharp.Blazor/GEmojiSharp.Blazor.csproj @@ -19,6 +19,7 @@ GEmojiSharp.Blazor https://github.com/hlaueriksson/GEmojiSharp icon.png + GEmojiSharp.Blazor.md emoji;gemoji;blazor;component;rcl MIT true @@ -32,6 +33,7 @@ + diff --git a/src/GEmojiSharp/GEmojiSharp.csproj b/src/GEmojiSharp/GEmojiSharp.csproj index f8ff4a4..8609c9b 100644 --- a/src/GEmojiSharp/GEmojiSharp.csproj +++ b/src/GEmojiSharp/GEmojiSharp.csproj @@ -4,13 +4,13 @@ netstandard2.0 2.0.0 -- New: - - Emoji.Alias("😀") // :grinning: - - Emoji.Demojify("Hello, 🌍") // Hello, :earth_africa: - - Emoji.RegexPattern // Regular expression pattern to match all supported emojis -- Update: - - Emoji.Get("😀") // By raw emoji - - Emoji.Find(":grinning:") // Query for alias enclosed by colons +New: +- Emoji.Alias("😀") // :grinning: +- Emoji.Demojify("Hello, 🌍") // Hello, :earth_africa: +- Emoji.RegexPattern // Regular expression pattern to match all supported emojis +Updated: +- Emoji.Get("😀") // By raw emoji +- Emoji.Find(":grinning:") // Query for alias enclosed by colons Henrik Lau Eriksson GitHub Emoji for C# and .NET @@ -24,6 +24,7 @@ GEmojiSharp https://github.com/hlaueriksson/GEmojiSharp icon.png + GEmojiSharp.md emoji;gemoji MIT true @@ -33,6 +34,7 @@ +