Created
July 12, 2017 07:58
-
-
Save ngzhian/02bfc668e52074a86ae451501ce9b95a to your computer and use it in GitHub Desktop.
ocamldoc ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ocamlc -I +ocamldoc -c tg.ml && ocamldoc -g tg.cmo test.ml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Generator (G : Odoc_gen.Base) = | |
struct | |
class generator = | |
object(self) | |
inherit G.generator as generator | |
method generate module_list = | |
(* let _ = Odoc_info.dump_modules "modump" in *) | |
(* let mtds = Odoc_info.Search.methods module_list in *) | |
let vals = Odoc_info.Search.values module_list in | |
(* Printf.printf "%s\n" (String.concat "\n" (List.map (fun (t : Odoc_value.t_value) -> t.val_name) vals)); *) | |
List.iter (fun (t : Odoc_value.t_value) -> | |
match t.val_code with | |
| None -> () | |
(* | Some c -> Printf.printf "%s\n" c; *) | |
| Some c -> Printf.printf "%s\n" "c"; | |
Printf.printf "\n\n"; | |
(* Printf.printf "%s\n" (Odoc_info.string_of_value t); *) | |
) vals; | |
() | |
end | |
end;; | |
let _ = Odoc_args.extend_base_generator (module Generator : Odoc_gen.Base_functor);; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment