slugify-0.1.0.0: Convert text into slugs.
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Text.Slugify

Description

The module to convert text into slugs. A slug is a hyphen separated string of words. Slugs are often used to make visually pleasant URLs by transforming for example the title of an article into a slug, and use this in the URL, for more information see the Wikipedia section.

Synopsis

Slug modes

data SlugMode Source #

The given mode to slugify a Text object.

Constructors

SlugAscii

Slugify by removing diacritics and only retain ASCII characters.

SlugUnicode

Slugify by allowing unicode characters.

Character tests

isWordSeparator Source #

Arguments

:: Char

The given Character to check.

-> Bool

True if the given character is a separator; False otherwise.

Check if the given Character is a word separator, for the given slugify algorithm.

isWordChar Source #

Arguments

:: Char

The given Character to check.

-> Bool

True if it is a word character; False otherwise.

Check if the given Character is considered a word character for the slugify algorithm.

isRetainChar Source #

Arguments

:: Char

The given Character to check.

-> Bool

True if the given Character will be retained; False otherwise. Some of these characters will however be converted to a hyphen (-), and thus eventually will only produce a different character in the slug.

Check if the given character is retained by the slugify algorithm.

Slug algorithms

slugify Source #

Arguments

:: Text

The given text to convert to a slug.

-> Text

The corresponding slug.

Slugify the given Text object and remove diacritics and convert characters to the corresponding ASCII equivalent.

slugifyUnicode Source #

Arguments

:: Text

The given text to convert to a slug.

-> Text

The corresponding slug.

Slugify the given Text object and retain Unicode characters.

slugifyWith Source #

Arguments

:: SlugMode

The given mode to slugify.

-> Text

The given text to convert to a slug.

-> Text

The corresponding slug.

Slugify the given Text with the given SlugMode.