-
Notifications
You must be signed in to change notification settings - Fork 452
@doc-markdown for odoc #12477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@doc-markdown for odoc #12477
Conversation
* 'main' of github.com:/ocaml/dune: (946 commits) refactor(boot): some helpers for command line flags (ocaml#12375) refactor(boot): move file exists check to one place (ocaml#12395) Check for parameterised libraries from the compiler config (ocaml#12393) Update test/blackbox-tests/test-cases/ocaml-config-ox.t Update test/blackbox-tests/test-cases/oxcaml/ocaml-config-ox-true.t Add changes Turn the %{ocaml-config:ox} test into one file, and add a +ve test case Clarify variable vars in ocaml_config.ml Expose the ocamlc -config parameter "ox" doc: changing heading levels for sub-sections (ocaml#12389) chore(deps): bump actions/checkout from 4 to 5 (ocaml#12380) refactor(boot): remove pointless [assert false] (ocaml#12378) refactor(boot): mangling simplification (ocaml#12377) refactor(boot): move ocaml-config bindings (ocaml#12376) refactor(boot): simplify blake3 flag handling (ocaml#12379) refactor(boot): use [Module_name.t] in ocamldep parsing (ocaml#12373) refactor(boot): replace concat + filter_map with concat_map (ocaml#12374) chore: move tests to dune-init move test to virtual-libraries chore: move test to directory-targets ...
|
I think a version check is a good idea. We have such things for |
* 'main' of github.com:/ocaml/dune: (147 commits) cram test: test only parameter flags in merlin generation fix(oxcaml): import eta-expansion changes from opam-repo (ocaml#12563) address review comments Mask the path to the stdlib fix(oxcaml): generate merlin config for library parameters fix(melange + include_qualified): track correct `.cmj` dependencies in emit (ocaml#12531) refactor: remove some unused code in [Path] (ocaml#12558) dep_rules: don't run (transitive) `ocamldep` on single module buildables (ocaml#12555) fix(pkg): ignore project settings for building packages test(pkg): reproduce ocaml#12131 melange: add a test for module cycle checks (ocaml#12554) chore: lint check for new changes entries (ocaml#12553) feature(cram): allow for conflict detection (ocaml#12538) ci: update for ocaml 5.4 release (ocaml#12552) chore(script): generate changelog from structure (ocaml#12516) Reuse dependencies between project and tools (ocaml#12526) Introduce Io.overwrite_file test: fix dune install requiring a mandir Enable package management for more tests Add a `dune tools env` command to add dev tools to PATH (ocaml#12521) ...
5e20f90 to
4c83d4e
Compare
f30b4c8 to
53a22e8
Compare
85dcde2 to
08114d5
Compare
08114d5 to
62fccc4
Compare
62fccc4 to
47fb0b5
Compare
| let setup_lib_markdown_rules sctx lib = | ||
| let* markdown_supported = supports_doc_markdown sctx in | ||
| if not markdown_supported | ||
| then Memo.return () | ||
| else ( | ||
| let target = Lib lib in | ||
| let* odocs = odoc_artefacts sctx target in | ||
| let* () = | ||
| (* because libraries with a package are handled in the package-level rule with the system shell script for all directory target, we skip packages *) | ||
| match Lib_info.package (Lib.Local.info lib) with | ||
| | Some _ -> Memo.return () | ||
| | None -> | ||
| (* when there's no package, we still need have rules for each odoc file *) | ||
| Memo.parallel_iter odocs ~f:(fun odoc -> setup_generate_markdown sctx odoc) | ||
| in | ||
| Memo.With_implicit_output.exec setup_lib_markdown_rules_def (sctx, lib)) | ||
| ;; | ||
|
|
||
| let markdown_shell_command odoc_path all_odocs ~markdown_root = | ||
| List.map all_odocs ~f:(fun odoc -> | ||
| let odocl_rel = | ||
| Path.reach (Path.build odoc.odocl_file) ~from:(Path.build markdown_root) | ||
| in | ||
| Printf.sprintf "%s markdown-generate -o . %s" odoc_path odocl_rel) | ||
| |> String.concat ~sep:" && " | ||
| ;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically working, but I don't think is a proper solution.
I pushed a new PR #12581 assuming that odoc supports multiple inputs as implemented here ocaml/odoc#1388
It's a bit unforunate since we will need to wait for this PR to merge (and increase the version check)
|
Has been subsumed by #12581 |
This PR extends odoc to support markdown-generate implemented here ocaml/odoc#1341 and supported since odoc.3.1.0
Added the odoc version check, similar to other tools.
The implementation itself tried to be very similar to the html generation, except the directory targets on a flat package (it needed to be a system action that groups all markdown-genetaration)