Skip to main content

normalize_topic

Function normalize_topic 

Source
pub fn normalize_topic(topic: &str) -> String
Expand description

Normalize a topic string to lowercase with underscores.

This is the canonical way to convert a user-provided topic into the format expected by CASS filenames:

  • Converts to lowercase
  • Replaces spaces with underscores
  • Removes invalid characters
  • Collapses multiple underscores

ยงExamples

use coding_agent_search::html_export::normalize_topic;
assert_eq!(normalize_topic("My Cool Topic"), "my_cool_topic");
assert_eq!(normalize_topic("HTML Export Feature"), "html_export_feature");