Skip to content

Commit

Permalink
chore: Updated documentation and package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Mateus committed May 26, 2020
1 parent c772e48 commit b7e2342
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
15 changes: 11 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 "-"*

Expand All @@ -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
Expand Down Expand Up @@ -110,7 +118,6 @@ using Sluggy;
var separator = "/";

// Defining the composite strategy
var normalizationWithUpperCaseStrategy = new CompositeStrategy(
new ToUpperCaseStrategy(),
new NormalizationStrategy());
Expand Down
1 change: 0 additions & 1 deletion Sluggy.Tests/SluggyUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions Sluggy/Sluggy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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</PackageReleaseNotes>
<RepositoryType>Library</RepositoryType>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
<PackageIconUrl></PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<AssemblyVersion>3.0.1.0</AssemblyVersion>
<FileVersion>3.0.1.0</FileVersion>
<PackageIcon>sluggy.png</PackageIcon>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Sluggy/Strategies/NonAlphaNumericStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ namespace Sluggy.Strategies
public class NonAlphaNumericStrategy : ITranslationStrategy
{
/// <summary>
///
/// This strategy is used for removing non alpha numeric characters from the provided text.
/// </summary>
/// <param name="text">The text to be translated.</param>
/// <returns></returns>
/// <returns>The transformed text.</returns>
/// <exception cref="ArgumentNullException">Thrown when text is null.</exception>
public string Translate(string text)
{
Expand Down

0 comments on commit b7e2342

Please sign in to comment.