wikidot_normalize/lib.rs
1/*
2 * lib.rs
3 *
4 * wikidot-normalize - Library to provide Wikidot-compatible normalization.
5 * Copyright (c) 2019-2023 Emmie Maeda
6 *
7 * wikidot-normalize is available free of charge under the terms of the MIT
8 * License. You are free to redistribute and/or modify it under those
9 * terms. It is distributed in the hopes that it will be useful, but
10 * WITHOUT ANY WARRANTY. See the LICENSE file for more details.
11 *
12 */
13
14#![deny(missing_debug_implementations, missing_docs)]
15
16//! A library to provide Wikidot-compatible string normalization.
17//!
18//! Wikidot ensures all names of pages subscribe to a particular pattern.
19//! Essentially, only alphanumeric characters, and `:`, `-`, and `_` are permitted.
20//!
21//! * Any uppercase characters are case folded, and any characters outside
22//! the above set are collapsed into dashes. Multiple dashes or forward slashes are compressed
23//! into a single instance.
24//! * Any trailing forward slashes are stripped.
25//! * Finally, any leading, trailing, or multiple dashes are removed.
26
27#[cfg(test)]
28#[macro_use]
29extern crate str_macro;
30
31mod category;
32mod normal;
33mod underscore;
34mod unicode;
35
36pub use self::normal::normalize;