Skip to main content

node_id_from_rel_path

Function node_id_from_rel_path 

Source
pub fn node_id_from_rel_path(rel_path: &Path) -> String
Expand description

Build a stable node id from a workspace-relative file path.

Rules:

  • strip extension
  • lowercase
  • normalize path separators to /
  • collapse //, reject parent-dir escapes
  • replace whitespace runs with -