Download this file
| 1 | (* Prints an OCaml module with one string per file: static/base.css |
| 2 | becomes [let base_css = "..."]. *) |
| 3 | |
| 4 | let ident path = |
| 5 | String.map (function 'a' .. 'z' | '0' .. '9' as c -> c | _ -> '_') |
| 6 | (String.lowercase_ascii (Filename.basename path)) |
| 7 | |
| 8 | let () = |
| 9 | Array.iteri |
| 10 | (fun i path -> |
| 11 | if i > 0 then |
| 12 | Printf.printf "let %s = %S\n" (ident path) |
| 13 | (In_channel.with_open_bin path In_channel.input_all)) |
| 14 | Sys.argv |
| 15 | |