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

Span labels in function arguments (?id: and id:) #990

Merged

Conversation

panglesd
Copy link
Collaborator

Fix #879.

If someone has some taste in the css colors, please suggest something! Currently, here is what I chose:

image

image


let tag tag t = O.span ~attr:tag t
| Odoc_model.Lang.TypeExpr.Label s -> tag "opt-arg" (O.txt s)
| Optional s -> tag "named-arg" (O.txt "?" ++ O.txt s)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please avoid inventing new terminology, I'd suggest label and optlabel as per language specification.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Also you need to swap the names)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good points, thanks. I updated the PR!

@panglesd panglesd force-pushed the identifiers-labels-should-be-spanned branch from ca69da8 to 10ae266 Compare August 22, 2023 05:38
@gpetiot
Copy link
Contributor

gpetiot commented Aug 29, 2023

It looks like some tests are not updated, but everything else looks good to me!

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.

Looks good to me :)

@@ -89,11 +95,17 @@ <h1>Module <code><span>Type</span></code></h1>
<span><span class="keyword">type</span> labeled_higher_order</span>
<span> =
<span>
<span>(<span>l:int <span class="arrow">&#45;&gt;</span></span> int)
<span>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not related to this PR but this reminds me that the --indent option breaks the formatting: ocsigen/tyxml#288

@panglesd panglesd force-pushed the identifiers-labels-should-be-spanned branch from 411cc8a to 6a98054 Compare September 4, 2023 07:42
@panglesd panglesd merged commit 872a1e6 into ocaml:master Sep 4, 2023
2 of 3 checks passed
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.

Identifier labels (?id:, id:) should be <span>ned.
4 participants