Skip to content
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 comments with * at the beginning of each lines. #1224

Open
panglesd opened this issue Oct 29, 2024 · 2 comments
Open

Doc comments with * at the beginning of each lines. #1224

panglesd opened this issue Oct 29, 2024 · 2 comments

Comments

@panglesd
Copy link
Collaborator

I've seen several libraries use this style of comments:

    (** [decode_float dec buff ofs len] decodes [len] samples in each channel and puts
      * the result in [buff] starting at position [ofs].
      * @raise Hole_in_data if there was an interruption of the data.
      * @raise Invalid_parameters if all the data cannot fit in the buffer starting at the given position.
      *)

However, the * at the beginning of lines confuse odoc. Should this be dealt in the odoc parser, or upstream in OCaml?

Here are some examples, taken from @jonludlam's list in #1138:

@panglesd panglesd changed the title Doc comments with * at the beginning of the line. Doc comments with * at the beginning of each lines. Oct 29, 2024
@gpetiot
Copy link
Collaborator

gpetiot commented Oct 30, 2024

I'm in favor of doing this in the ocaml parser directly. This would also make ocamlformat's job easier (assuming there is a flag to tell us whether there is a column of * to be printed or not).

@panglesd
Copy link
Collaborator Author

I think that's a good argument to do it in the ocaml parser. That might complicate upstream though, we should ask what the maintainers think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants