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

Lift deprecated and alerts attributes into odoc tags #828

Merged
merged 4 commits into from
Feb 24, 2022

Conversation

panglesd
Copy link
Collaborator

This PR lifts deprecated and alerts into odoc tags.

[@@deprecated] and [@@alert deprecated] are handled internally the same way. and rendered similarly to the existing @deprecated odoc tag. Alerts are rendered as alert alert_name followed by the possible payload.

image
image

When an item contains both a deprecated attribute and an attached comment with a deprecated odoc tag, only the odoc tag is kept. This allows to use references in @deprecated message, as payloads from alerts or attribute are not parsed by odoc.

This PR closes #406

@panglesd panglesd changed the title Deprecated attr Lift deprecated and alerts attributes into odoc tags Feb 15, 2022
Julow and others added 4 commits February 23, 2022 19:43
The attribute is recognized by the loader and appended to the
corresponding comment. It is rendered similarly to tags.

If both the [@@deprecated] compiler attribute and the @deprecated odoc
tag are specified, the compiler attribute is ignored.

[@@@deprecated] at the beginning of the file, before or after the first
comment, is also handled.

Co-authored-by: Paul-Elliot <[email protected]>
Remove some code duplication and write the pattern-match on attribute
names only once.
@jonludlam jonludlam merged commit e201e61 into ocaml:master Feb 24, 2022
mseri pushed a commit to ocaml/opam-repository that referenced this pull request Dec 13, 2022
CHANGES:

Additions
- New unstable option `--as-json` for the HTML renderer that emits HTML
  fragments (preamble, content) together with metadata (table of contents,
  breadcrumbs, whether katex is used) in JSON format. (@sabine, ocaml/odoc#908)
- New maths support via `{m ... }` and `{math ... }` tags. (@giltho, @gpetiot, ocaml/odoc#886)
- Various optimisations (@jonludlam, ocaml/odoc#870, ocaml/odoc#883)
- Better handling of alerts and deprecation notices. (@panglesd, ocaml/odoc#828)
- Handle language tags on code blocks (@Julow, ocaml/odoc#848)

Bugfixes
- Shadowing issues (@jonludlam, ocaml/odoc#853)
- Layout fixes and improvements (@panglesd, ocaml/odoc#832, ocaml/odoc#839, ocaml/odoc#847)
- Handle comments on class constraints and inherit (@Julow, ocaml/odoc#844)
- Disable the missing root warning (@jonludlam, ocaml/odoc#881)
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.

Display deprecated attributes
3 participants