package yocaml

  1. Overview
  2. Docs

An incredibly simple (and opinionated) implementation of Slug.

The implementation is rather dirigiste, and relatively unconfigurable, but it can easily be replaced by a different implementation and is only there to make it easier to bootstrap a blog.

Types

type t = string

A slug is just an alias on string.

Building slugs

val from : ?mapping:(char * string) list -> ?separator:char -> ?unknown_char:char -> string -> t

from str build a naive slug from a given string.

Validating slugs

val validate : ?separator:char -> ?unknown_char:char -> Data.t -> t Data.Validation.validated_value

Validate a slug.

val validate_string : ?separator:char -> ?unknown_char:char -> string -> t Data.Validation.validated_value

Validate a slug from a string.

OCaml

Innovation. Community. Security.