Skip to main content

sphinx_make_id

Function sphinx_make_id 

Source
pub fn sphinx_make_id(s: &str) -> String
Expand description

sphinx util.nodes._make_id (:537-561) — a fork of docutils’ 0.16 make_id with two documented changes: capital letters survive, and . and _ count as identifier characters (so envvar-HOME_A stays envvar-HOME_A, where docutils’ would yield envvar-home-a). The translate tables are the same ones make_id uses; the lowercasing step is what sphinx drops, so this runs them on the raw string.

Result grammar: [^-0-9._][a-zA-Z0-9._-]* with no trailing -, or empty.