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

Document how to write documentation for modules #644

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

Julow
Copy link
Collaborator

@Julow Julow commented Mar 17, 2021

The preamble and synopsis parts describe the current state of #640 and #643

Julow and others added 2 commits March 17, 2021 18:26
This documentation is targeted at Odoc's users writing documentation for
their modules.
Add a summary and the "comments" section.

Co-authored-by: Jon Ludlam <jon@recoil.org>
Copy link
Contributor

@dbuenzli dbuenzli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice docs @Julow ! I have left a few comments.

{2 Preamble}

The preamble is composed of the comment attached to a declaration and the
top-comment of the expansion.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notion of expansion is not explained before this occurence. I'm personally unclear to what it refers to. Could you maybe expand on that ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've managed to remove that word, it isn't necessary in the documentation. I meant the sig ... end part when there is one.

{[
(** This is the comment attached to the declaration. *)
module M : sig
(** This is the top-comment of the expansion. *)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make things clear. What is the synopsis and preamble here ? My expectation is that the outer comment gets merged with the second with a blank line between them (i.e. there are two paragraphs here).

end
]}

The comment attached to the declaration shouldn't contain any heading.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you mean here, but I'm not sure it's very clear. Maybe this would be better said around an example that has a comment attached to the declaration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I can drop this sentence ? It's not related to the example, it's an aside saying the thing described above doesn't happen with decl comments.

The synopsis of a module (a module type, a class, etc..) is the first
paragraph of the {!preamble}, {e if} the preamble starts with a paragraph.

It is rendered near declarations and in [{!modules:...}] lists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

near declarations -> after module declarations


{[
module M : sig
(** This paragraph is the synopsis of the module [M]. *)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here again might be worth indicating what happens when you have:

(** Bli bla *)
module M : sig 
  (** Hey ho *)
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an other before that covering this case. This example comes in pair, maybe I should merge them in a single block and call my modules M and N ?

From dbuenzli.

The documentation can be formatted, Odoc accepts the same markup language as
{{:https://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html#s%3Aocamldoc-comments}
ocamldoc} with some exceptions, see {!page-interface.Changes}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the topic of this PR, but I think we should just include the markup language documentation in our documentation, and only just say "this is based on the ocamldoc one".

Copy link
Contributor

@Drup Drup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I don't really have comments, you were very thorough :)

@jonludlam jonludlam merged commit d929f7c into ocaml:master Mar 25, 2021
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

Successfully merging this pull request may close these issues.

4 participants