Skip to main content

slugify_filenames/
lib.rs

1//!
2//! # Usage Example
3//!
4//!
5//! ```
6//! use slugify_filenames::slugify_string;
7//!
8//! // passing `false` in the second argument to prevent downcasing the string
9//! let result = slugify_string("Imagine Thís STRING, àscii Safê and Filename-sáfè", false)?;
10//! assert_eq!(result, "Imagine-This-STRING-ascii-Safe-and-Filename-safe");
11//!
12//! // passing `true` in the second argument to downcase the string
13//! let result = slugify_string("Generated_FILE_ymf1a3ymf1a3ymf1.png.0.gz", true)?;
14//! assert_eq!(result, "generated_file_ymf1a3ymf1a3ymf1.png.gz");
15//!
16//! # Ok::<(), slugify_filenames::errors::Error>(())
17//! ```
18//!
19
20#[doc(hidden)]
21pub mod cli;
22pub(crate) use cli::heck_aliases;
23#[doc(hidden)]
24pub use cli::{SlugifyFilenames, SlugifyParameters, SlugifyString};
25
26#[doc(hidden)]
27pub mod errors;
28pub use errors::{Error, Result};
29
30#[doc(hidden)]
31pub(crate) mod string;
32#[doc(hidden)]
33#[allow(unused_imports)]
34pub(crate) use string::{
35    list_of_trimmed_strings, DEFAULT_SEPARATOR, SPECIAL_PATTERN_CHARS,
36    STRING_REGEX, UNNEEDED_UNIQUEFY_REGEX,
37};
38pub use string::{
39    slugify_string
40};