SluggyUnidecode 1.1.3
See the version list below for details.
dotnet add package SluggyUnidecode --version 1.1.3
NuGet\Install-Package SluggyUnidecode -Version 1.1.3
<PackageReference Include="SluggyUnidecode" Version="1.1.3" />
paket add SluggyUnidecode --version 1.1.3
#r "nuget: SluggyUnidecode, 1.1.3"
// Install SluggyUnidecode as a Cake Addin
#addin nuget:?package=SluggyUnidecode&version=1.1.3
// Install SluggyUnidecode as a Cake Tool
#tool nuget:?package=SluggyUnidecode&version=1.1.3
Sluggy | SluggyUnidecode
Sluggy
dotnet add package Sluggy --version 2.0.1
Sluggy is a configuration based class library designed to create friendly URL's.
Sluggy Unidecode
dotnet add package SluggyUnidecode --version 1.1.3
SluggyUnidecode is simple and powerful. Extends the Sluggy package by using the Unidecode.NET library for normalization.
QuickStart with Sluggy
There are 4 ways to use ToSlug()
The default is new CompositeStrategy(new ToLowerInvariantStrategy(), new NormalizationStrategy())
Default separator is "-"
Easiest way:
using Sluggy;
"EU GOSTO DE TÁRTE".ToSlug();
// Output: "eu-gosto-de-tarte"
"Eu NãO GoStO de PãO Da Avó".ToSlug();
// Output: "eu-nao-gosto-de-pao-da-avo"
You can redefine the separator
using Sluggy;
// Defining the separator
var separator = "/";
"EU GOSTO DE TÁRTE".ToSlug(separator);
// Output: "eu/gosto/de/tarte"
"Eu NãO GoStO de PãO Da Avó".ToSlug(separator);
// Output: "eu/nao/gosto/de/pao/da/avo"
You can redefine the default composite strategy by passing as a param
using Sluggy;
// Defining the composite strategy
var defaultStrategy = new CompositeStrategy(
new ToLowerInvariantStrategy(),
new NormalizationStrategy());
"EU GOSTO DE TÁRTE".ToSlug(defaultStrategy);
// Output: "eu-gosto-de-tarte"
"Eu NãO GoStO de PãO Da Avó".ToSlug(defaultStrategy);
// Output: "eu-nao-gosto-de-pao-da-avo"
// Redefine the composite strategy
var anotherStrategy = new CompositeStrategy(
new ToLowerInvariantStrategy(),
new NormalizationStrategy(),
new RemoveEveryVowelStrategy());
"GOSTO DE TÁRTE".ToSlug(anotherStrategy);
// Output: "gst-d-trt"
And lastly you can redefine the default separator and the composite strategy
using Sluggy;
// Defining the separator
var separator = "/";
// Defining the composite strategy
var normalizationWithUpperCaseStrategy = new CompositeStrategy(
new ToUpperCaseStrategy(),
new NormalizationStrategy());
"EU GOSTO DE TÁRTE".ToSlug(separator, normalizationWithUpperCaseStrategy);
// Output: "EU/GOSTO/DE/TARTE"
// Redefine the composite strategy
var anotherStrategy = new CompositeStrategy(
new ToLowerInvariantStrategy(),
new NormalizationStrategy(),
new RemoveEveryVowelStrategy());
"GOSTO DE TÁRTE".ToSlug(separator, anotherStrategy);
// Output: "gst/d/trt"
QuickStart with SluggyUnidecode
SluggyUnidecode is simple and uses a powerful normalizer to ASCII characters.
using SluggyUnidecode;
"Мне нравится татарин".ToSlug();
// Output: "mne-nravitsya-tatarin"
"ア α a A".ToSlug();
// Output: "a-a-a-a";
// Even more powerful
"ch\u00e2teau Vi\u00f1edos".ToSlug();
// Output: "chateau-vinedos"
Contributing
Any contribution is allowed, submit a issue or pull request to start contributing your ideias or problems you encounter.
Authors
- Ruben Mateus - rubenmateus
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgments
- To Sérgio Freitas[sj-freitas] for the idea, challenge, guidance and the amazing logo designs.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. |
.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. |
-
.NETStandard 2.0
- Sluggy (>= 2.0.1)
- Unidecode.NET (>= 1.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# Upgraded sluggy version to 2.0.1
# Minor tweaks and clean -> stylecop
# Added tests for the unidecode normalization strategy
# Updated documentation
# Updated Icon.