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

Add attribute support (via 'annotation' directive) #97

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

DanilaFe
Copy link
Contributor

@DanilaFe DanilaFe commented Sep 5, 2024

This PR adds an 'annotation' directive to our Sphinx integration which enables documenting attributes. In Sphinx, attributes are an existing concepts, which refer to what Chapel would call fields. As a result, the attr directive was taken, and attribute on top of that seemed confusing. @lydia-duncan suggested 'annotation' (perhaps in jest), but I think it's a pretty decent fallback.

Another PR to chpldoc will be necessary to actually emit 'annotation' directives; it will not be part of this.

Reviewed by @lydia-duncan -- thanks!

@DanilaFe DanilaFe merged commit 2671023 into chapel-lang:main Sep 5, 2024
1 check passed
DanilaFe added a commit to chapel-lang/chapel that referenced this pull request Sep 5, 2024
Closes #23149.

This PR implements my initial vision for documenting attributes based on
procedures that implement them. In PR
#25826, I made GPU attributes
be backed by Chapel functions. One of my goals with this approach was to
be able to document these attributes using the existing Chapel mechanism
(doc comments attached to procedures). This PR does so, by adding a new
chpldoc attribute (`@chpldoc.attributeSignature`) that marks a function
as defining the signature (formals etc.) of an attribute.

Since the functions in the GPU module that back attributes are internal
(not intended to be called directly), they would normally be skipped by
chpldoc's output. This PR adjusts the behavior of chpldoc to not skip
the functions in this case.

It also adds documentation to the various attributes using this new
mechanism.

This PR depends on
chapel-lang/sphinxcontrib-chapeldomain#97, which
implements the RST-to-HTML conversion of the new 'annotation' directive
chpldoc will emit.

<img width="725" alt="Screen Shot 2024-09-05 at 10 16 43 AM"
src="https://github.com/user-attachments/assets/bcc3fbe8-301f-4727-ae92-be2968d4e0f4">

Reviewed by @e-kayrakli, @mppf, and @lydia-duncan -- thanks!

## Testing

- [x] paratest (just in case)
DanilaFe added a commit to chapel-lang/chapel that referenced this pull request Sep 18, 2024
This documents and makes use of the various changes I made in
#25826,
chapel-lang/sphinxcontrib-chapeldomain#97, and
#25884.

Reviewed by @e-kayrakli -- thanks!
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.

2 participants