From b7e2342c4303251953840d6bcb3855632237f73b Mon Sep 17 00:00:00 2001 From: Ruben Mateus Date: Tue, 26 May 2020 22:45:19 +0100 Subject: [PATCH] chore: Updated documentation and package metadata --- README.MD | 15 +++++++++++---- Sluggy.Tests/SluggyUnitTests.cs | 1 - Sluggy/Sluggy.csproj | 6 +++--- Sluggy/Strategies/NonAlphaNumericStrategy.cs | 4 ++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.MD b/README.MD index 2bec3a1..58a4080 100644 --- a/README.MD +++ b/README.MD @@ -17,10 +17,12 @@ [![NuGet](https://img.shields.io/nuget/v/Sluggy.svg)](https://www.nuget.org/packages/Sluggy/) -`dotnet add package Sluggy --version 2.0.1` +`dotnet add package Sluggy --version 3.0.1` Sluggy is a configuration based class library designed to create friendly URL's. +**Check release notes for more info on the latest changes.** + --- ## Sluggy Unidecode @@ -32,13 +34,20 @@ Sluggy is a configuration based class library designed to create friendly URL's. SluggyUnidecode is simple and powerful. Extends the Sluggy package by using the Unidecode.NET library for normalization. +**Check release notes for more info on the latest changes.** + --- ## QuickStart with Sluggy ### **There are 4 ways to use ToSlug()** -#### The default is *new CompositeStrategy(new ToLowerInvariantStrategy(), new NormalizationStrategy())* +#### The default strategies are: +``` csharp +NonAlphaNumericStrategy() +ToLowerInvariantStrategy() +NormalizationStrategy() +``` #### *Default separator is "-"* @@ -53,7 +62,6 @@ using Sluggy; "Eu NãO GoStO de PãO Da Avó".ToSlug(); // Output: "eu-nao-gosto-de-pao-da-avo" ``` - --- ### You can redefine the separator @@ -110,7 +118,6 @@ using Sluggy; var separator = "/"; // Defining the composite strategy - var normalizationWithUpperCaseStrategy = new CompositeStrategy( new ToUpperCaseStrategy(), new NormalizationStrategy()); diff --git a/Sluggy.Tests/SluggyUnitTests.cs b/Sluggy.Tests/SluggyUnitTests.cs index 7d3c810..ca2baa3 100644 --- a/Sluggy.Tests/SluggyUnitTests.cs +++ b/Sluggy.Tests/SluggyUnitTests.cs @@ -21,7 +21,6 @@ public void ShouldThrowNullArgumentException() [InlineData("EU GOSTO DE TÁRTE", "tarte-tarte-tarte-tarte")] [InlineData("EU GOSTO", "tarte-tarte")] [InlineData("EU não GOSTO", "tarte-tarte-tarte")] - [InlineData("", "")] public void ShouldReturnSlugifiedWithMocked(string value, string expectation) { const string translated = "tarte"; diff --git a/Sluggy/Sluggy.csproj b/Sluggy/Sluggy.csproj index 9090a42..47fb283 100644 --- a/Sluggy/Sluggy.csproj +++ b/Sluggy/Sluggy.csproj @@ -20,11 +20,11 @@ Breaking Changes: # Updated namespace for strategy classes to be more semantic when importing # Added NonAlphanumericStrategy for better support for urls and filenames Library - 3.0.0 + 3.0.1 MIT - 3.0.0.0 - 3.0.0.0 + 3.0.1.0 + 3.0.1.0 sluggy.png diff --git a/Sluggy/Strategies/NonAlphaNumericStrategy.cs b/Sluggy/Strategies/NonAlphaNumericStrategy.cs index 97793d2..97d2290 100644 --- a/Sluggy/Strategies/NonAlphaNumericStrategy.cs +++ b/Sluggy/Strategies/NonAlphaNumericStrategy.cs @@ -9,10 +9,10 @@ namespace Sluggy.Strategies public class NonAlphaNumericStrategy : ITranslationStrategy { /// - /// + /// This strategy is used for removing non alpha numeric characters from the provided text. /// /// The text to be translated. - /// + /// The transformed text. /// Thrown when text is null. public string Translate(string text) {