-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Standard generators override custom generators #7108
Comments
Comment author: @gasche More precisely, I think that when a custom generator is defined by extending the html generator, as in the documentation example Having a quick look at the codebase, it looks like this would be rather natural to do: in the code of the -html, -latex etc. command-line options Lines 266 to 281 in 031cffd
instead of calling set_generator with the base generators, use the get_foo_generator functions of Lines 19 to 51 in 031cffd
Of course this is only a suspicion, one would need someone motivated to implement and test the change and report on it. |
Comment author: @Armael I see. Would the attached patch implement what you describe? |
Comment author: @gasche I think that would be fine. Your gentler change (than raising an exception) also has the advantage that, if people insist on the previous behaviour, they can simply replace "-html" by "-man -html" as a workaround. Did you test it on previously failing cases, or in the context of ocamlbuild#10? If yes, and if it works, I'll merge it; but can you add a Changes entry? |
Comment author: @gasche Armal: Ping? If you can confirm that this patch fixes the previous ocamldoc+ocamlbuild issues, I would be happy to merge it in 4.03 -- but then we should not wait to long. |
Comment author: @Armael Sorry for the delay. I tested the patch in the context of ocamlbuild#10: more precisely, using this self-contained example: https://github.com/Armael/manual-ocamlbuild/tree/custom-generator/examples/07-ocamldoc-custom-generator . Attached is a new patch (generators2.patch) with a Changes entry, and small changes to the manual to update the documentation. |
Comment author: @Armael Oh, and the patch seems to work. |
Original bug ID: 7108
Reporter: @Armael
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2017-09-24T15:31:40Z)
Resolution: fixed
Priority: normal
Severity: tweak
Fixed in version: 4.03.0+dev / +beta1
Category: ocamldoc
Monitored by: @Armael
Bug description
This is a known (and documented) behavior: standard generators, loaded with e.g. the -html, -latex, ... options, override custom generators provided with option -g. This is a bit inconvenient, at least when using custom generators with ocamlbuild (see for example https://github.com/Armael/ocaml-libudev/blob/master/myocamlbuild.ml#L40 or https://github.com/ocsigen/tyxml/blob/master/myocamlbuild.ml#L57 for a workaround). gasche suggested (ocaml/ocamlbuild#10 (comment)) that the cleanest solution could be to change ocamldoc's behavior regarding this.
I could submit a PR where custom generators would always be loaded after standard ones, if this sounds like a satisfying solution.
File attachments
The text was updated successfully, but these errors were encountered: