From 117f9fa6e662b5873390f253c7b3e426a67a953c Mon Sep 17 00:00:00 2001 From: Pat Garrity Date: Sat, 23 Mar 2024 22:52:46 -0500 Subject: [PATCH] (patch) Update the README --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 9cf89b9..89773f8 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,23 @@ externalResolvers += val GsSlug: ModuleID = "gs" %% "gs-slug-v0" % "0.1.0" ``` + +## Slug Type + +`Slug` is the type exposed by this library. It is an extremely small, +restricted, opaque type (`String`) that adheres to the following regular +expression: + +``` +^[a-z0-9]+(?:\-[a-z0-9]+)*$ +``` + +This type is intended for use in the following scenarios: + +- Restricted ASCII is acceptable. +- URL safety is desired. + +Additionally, `Slug` is usually intended to be unique within some _context_, +where the implementation defines the context. For example, if some organization +owns a number of repositories, each repository might have a `Slug` which is +unique within that organization.