From 3e332c97a28fc6268d7d2f338b8f3443e110192b Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Thu, 22 Aug 2024 17:06:29 +0200 Subject: [PATCH] Impl generation: review comments --- CHANGES.md | 3 +-- src/odoc/bin/main.ml | 6 +++--- src/odoc/rendering.ml | 15 --------------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a5e4d15ecc..e617528a5b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,7 @@ `count-occurrences` flag and command to count occurrences of every identifiers (@panglesd, #976) - Separate compilation of interface and implementation files, using a new - `compile-src` command (@panglesd, #1067). + `compile-src` command (@panglesd, #1067, #1188). - Add clock emoji before `@since` tag (@yawaramin, #1089) - Navigation for the search bar : use '/' to enter search, up and down arrows to select a result, and enter to follow the selected link. (@EmileTrotignon, #1088) @@ -26,7 +26,6 @@ (@panglesd, #1076). - Added a `compile-asset` command (@EmileTrotignon, @panglesd, #1170) - Allow referencing assets (@panglesd, #1171) -- Clean up CLI API for implementations (@panglesd, #1188) ### Changed diff --git a/src/odoc/bin/main.ml b/src/odoc/bin/main.ml index 68ec2c8328..ff3c741ee7 100644 --- a/src/odoc/bin/main.ml +++ b/src/odoc/bin/main.ml @@ -863,7 +863,7 @@ end = struct let generate ~docs = Generate.(cmd, info ~docs) module Generate_source = struct - let generate extra _hidden output_dir syntax extra_suffix input_file + let generate extra output_dir syntax extra_suffix input_file warnings_options source_file = Rendering.generate_source_odoc ~renderer:R.renderer ~warnings_options ~syntax ~output:output_dir ~extra_suffix ~source_file extra input_file @@ -873,7 +873,7 @@ end = struct Arg.( required & opt (some convert_fpath) None - & info [ "impl" ] ~doc ~docv:"impl-file.odocl") + & info [ "impl" ] ~doc ~docv:"impl-FILE.odocl") let source_file = let doc = "Source code for the implementation unit." in @@ -893,7 +893,7 @@ end = struct in Term.( const handle_error - $ (const generate $ R.extra_args $ hidden $ dst ~create:true () $ syntax + $ (const generate $ R.extra_args $ dst ~create:true () $ syntax $ extra_suffix $ input_odocl $ warnings_options $ source_file)) let info ~docs = diff --git a/src/odoc/rendering.ml b/src/odoc/rendering.ml index 5f6338679a..a1d7a8146e 100644 --- a/src/odoc/rendering.ml +++ b/src/odoc/rendering.ml @@ -165,18 +165,3 @@ let targets_source_odoc ~syntax ~warnings_options ~renderer ~output:root_dir Ok () | Page_content _ | Unit_content _ | Asset_content _ -> Error (`Msg "Expected an implementation unit") -(* let docs = *) -(* if Fpath.get_ext odoctree = ".odoc" then *) -(* documents_of_input ~renderer ~extra ~resolver ~warnings_options ~syntax *) -(* odoctree *) -(* else documents_of_odocl ~warnings_options ~renderer ~extra ~syntax odoctree *) -(* in *) -(* docs >>= fun docs -> *) -(* List.iter *) -(* (fun doc -> *) -(* let pages = renderer.Renderer.render extra None doc in *) -(* Renderer.traverse pages ~f:(fun filename _content -> *) -(* let filename = Fpath.normalize @@ Fs.File.append root_dir filename in *) -(* Format.printf "%a\n" Fpath.pp filename)) *) -(* docs; *) -(* Ok () *)