[][src]Function gen_epub_book::util::xhtml_path_id

pub fn xhtml_path_id<P: AsRef<Path>>(p: P) -> String

Get the (X)HTML ID from a path.

Replaces slashes with -s, .s with _ and removes all ../s, ./s and the extension.

Examples

assert_eq!(&xhtml_path_id("./abolish/the/../burgeoisie.html"), "abolish-the-burgeoisie_html");