-
Notifications
You must be signed in to change notification settings - Fork 94
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 hidden attribute #950
base: master
Are you sure you want to change the base?
Add hidden attribute #950
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.
The implementation looks good and the tests seem sufficient.
The [@@@hidden]
seems unnecessary as we already have (**/**)
, which can always be used instead.
If we keep this feature, I suggest making "on" and "off" markers more explicit as there's room on the syntax:
[@@@hidden]
type a (* this is hidden *)
[@@@hidden]
type b (* this is visible *)
[@@@hidden on]
type a
[@@@hidden off]
type b
As @lpw25 said in #578 (comment), why use an attribute ([@@hidden]
) instead of a tag ((** @hidden *)
) ?
Odoc has other similar tags (the current bad name is "internal") like @canonical
, @inline
, etc...
Pinging @jonludlam as you decided on the syntax.
Thanks a lot for contributing to Odoc :) |
@Julow , if we want to use |
I don't know why we want the attribute but we also want the tag! There's work to do on odoc-parser indeed. On Odoc's side, this kind of attributes are handled specifically here: https://github.com/ocaml/odoc/blob/master/src/model/semantics.mli#L14 the type |
I have created a PR for a new tag: ocaml-doc/odoc-parser#16 |
@@ -96,6 +97,7 @@ let parse_attribute : Parsetree.attribute -> parsed_attribute option = | |||
match load_payload attr_payload with | |||
| Some p -> Some (`Doc p) | |||
| None -> None) | |||
| "hidden" | "ocaml.hidden" -> Some (`Hidden attr_loc) |
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.
We discussed with @jonludlam and found that we don't need the attribute but prefer the tag instead. Do you mind opening a PR for that ?
Implemented as specified in #578
I should probably add some documentation (and maybe more tests), but it would be better if someone could confirm that this implementation is correct beforehand.