let identify_file filename =
begin match check_and_remove_extension filename ~ext:".md" with
| Some sub -> `Markdown sub
| None ->
begin match check_and_remove_extension filename ~ext:".ml" with
| Some sub -> `Ocaml_implementation sub
| None ->
begin match check_and_remove_extension filename ~ext:".mli" with
| Some sub -> `Ocaml_interface sub
| None -> `Other
end
end
end