use std::env;
use std::fs;
use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
let handbook = Path::new(&out_dir).join("handbook.rs");
let handbook_sections = vec![
("ROUTE", "../handbook/src/Route.md"),
("ROUTE_PROMPT", "../handbook/src/RoutePrompt.md"),
];
let mut content = String::new();
for (name, file_path) in handbook_sections {
println!("cargo:rerun-if-changed={}", file_path);
let section = fs::read_to_string(file_path).unwrap_or_default();
content.push_str(&format!(
"pub const {}: &str = r#\"{}\"#;\n\n",
name, section
));
}
fs::write(handbook, content).unwrap();
}