Skip to main content

slug

Function slug 

Source
pub fn slug(title: &str) -> String
Expand description

Turn a human title into a filesystem-friendly filename stem — the readable slug prov derives when a document is created by title (prov new "My Great Note"my-great-note). The rough inverse of path_to_title: lowercase, runs of whitespace and separators (space / - / _ / /) collapsed to a single -, and any other punctuation dropped. Unicode letters and digits are kept, so a non-ASCII title still yields a legible name. A title with no slug-able characters (pure punctuation) falls back to "untitled" so the result is always a valid stem.

The point is prov’s legibility contract (DESIGN §1): a title-first authoring flow that still leaves readable paths in the tree and in path-addressed links — unlike an opaque note-3.md.