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
ocamldoc generates strange looking documentation for variants #7634
Comments
Comment author: @Octachron As far as I can see, there is nothing particular to inline records here: constructors comments are rendered in a separated column, and a type like type t = is essentially rendered in the same way. Or I am missing what you meant by strangeness? |
Comment author: kosik You are right. This strangeness is not specific to inline records. It happens also in other situations. In this case: type t type u = I get the output shown in "test1.png". I think that the second comment (for the "Beta" variant) is rendered in an odd way. It starts and ends on different lines and that way it looks as if part of the Ocaml code was commented out, which is not the case. Sure, copying and pasting that we get the correct thing, but it does not look correct in a browser. |
Comment author: @yawaramin IMO, variant and record docs are overly complex, they can be greatly simplified. The first thing to do is get rid of the 'type tables', and use the same style for comments we use everywhere else. Each component of the type should be flush along the left margin, and each comment should be indented by placing it in the 'info' div as usual. Attaching a pic to show what I mean. EDIT: actually I like Discourse's markup rendering even better: https://discuss.ocaml.org/t/proposal-ocamldoc-should-generate-a-table-of-contents-in-each-module-page/871?u=yawaramin I think that would be a nice design refresh for the docs. But I understand that is probably out of scope here. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Original bug ID: 7634
Reporter: kosik
Status: acknowledged (set by @xavierleroy on 2017-09-30T08:24:23Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.05.0
Category: ocamldoc
Tags: ocamldoc
Monitored by: @yawaramin @gasche
Bug description
(Original title was: ocamldoc generates strange looking documentation for variants with inline records)
If I define a variant type with inline records, e.g.:
type t = Foo of {field1 : int;
field2 : int;
field3 : int}
(** comment 1 *)
and I ask ocamldoc to generate the HTML documentation:
ocamldoc -html test.mli
then the documentation looks strange.
The comments starts on a line that contains "{" and end on a line that contains "}".
File attachments
The text was updated successfully, but these errors were encountered: