slugs v0.1.1 Slug

generate creates a slug from a combination of id and string. extract_id grabs the id from a slug.

Link to this section Summary

Link to this section Functions

Link to this function

extract_id(slug)
extract_id(String.t()) :: integer()

Link to this function

generate(id, value)
generate(id :: integer(), value :: any()) :: String.t()

## Examples

iex> Slug.generate(1337,"Lord Of The Rings")
"lord-of-the-rings-1337"
iex> Slug.extract_id("lord-of-the-rings-1337")
1337
Link to this function

replace_unwanted_chars(string)