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

Allow referencing labels in the top comment #771

Merged
merged 4 commits into from
Nov 4, 2021

Conversation

jonludlam
Copy link
Member

This PR splits the first comment in a signature at the firstheading. This means everything before will be put into the preamble of the page, and the rest of the comment becomes part of the signature. Since the top comment has never been put into the environment, previously this meant that the labels couldn't be referenced. Now they are part of the signature this starts to work.

Fixes #740

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

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

This changes the behavior of the "second part of the first comment" (defined in #640) in the case of functors.

The page rendered like this before this PR:

{0 Module M.X}

Synopsis.

{TOC}

# The "content" starts here

{1 The second part of the first comment}

{1 Parameters}

module Arg : ...

{1 Signature}

now, it is rendered like if it was a separate floating comment:

{0 Module M.X}

Synopsis.

{TOC}

# The "content" starts here

{1 Parameters}

module Arg : ...

{1 Signature}

{1 The second part of the first comment}

I think this change is fine. If something needs to be improved here, it's the rendering of the functor parameters. (for example using stronger headings)

@@ -0,0 +1,782 @@
@charset "UTF-8";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should include these files as symlink, otherwise, they'd get out of date.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah good point yes! I'll fix that.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

This commit splits the first comment in a signature at the first
heading. This means everything before will be put into the preamble
of the page, and the rest of the comment becomes part of the
signature.

Fixes: ocaml#740
@jonludlam jonludlam changed the title Allow referencing lables in the top comment Allow referencing labels in the top comment Nov 4, 2021
@jonludlam jonludlam merged commit f3fce23 into ocaml:master Nov 4, 2021
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Nov 26, 2021
CHANGES:

Bugs fixed
- Man page renderer fails to output pages that have children (@jonludlam, @Julow, ocaml/odoc#766)
- Fix resolution of unprefixed references to pages (@Julow, ocaml/odoc#755)
- Fix reporting of ambiguous labels (@Julow, @jonludlam, ocaml/odoc#773, ocaml/odoc#781)
- Allow referencing of labels in the top comment (@jonludlam, ocaml/odoc#771)

Additions
- Strip unquoted spaces in identifiers for a more flexible reference syntax (@lubega-simon, @panglesd, ocaml/odoc#783)
- Add context to messages raised in expansions of includes (@Julow, ocaml/odoc#780)
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.

Can't reference labels in top-comments
2 participants