-
Notifications
You must be signed in to change notification settings - Fork 97
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
Conversation
There was a problem hiding this 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)
test/generators/html/odoc.css
Outdated
@@ -0,0 +1,782 @@ | |||
@charset "UTF-8"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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)
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