Skip to content

Conversation

@snprajwal
Copy link
Contributor

Bug/issue #, if applicable: rdar://158230351

Summary

When DocC processes the availability information for symbol graphs, it
identifies if fallback platforms are available, and if so, injects
platforms that inherit their availability from the fallback platforms.
E.g. the iPadOS and Mac Catalyst platforms inherit their availability
from iOS.

In the case of articles, the platform availability information is not
used in rendering the page. However, sample code pages are processed as
articles with a different page kind, and these pages do render the
platform availability information. Hence, it is necessary to also
process the fallback platforms when setting the availability for an
article's render node in order to correctly display the list of
supported platforms for sample code pages. This patch updates the logic
in the render node translator to process the availability information
for articles correctly and include fallback platforms.

The DefaultAvailability.fallbackPlatforms variable provides a mapping
from platforms to their respective fallbacks. This map was being
deconstructed with incorrect terminology in a few places, with the
platform itself being called "fallback", and the fallback platform being
called "inherited". This has been cleaned up to make the nomenclature
consistent across the codebase.

Dependencies

N/A

Testing

The unit tests for availability information have been updated to verify that fallback platforms are included, and that their beta status is correctly inherited.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
    - [ ] Updated documentation if necessary

The `DefaultAvailability.fallbackPlatforms` variable provides a mapping
from platforms to their respective fallbacks. This map was being
deconstructed with incorrect terminology in a few places, with the
platform itself being called "fallback", and the fallback platform being
called "inherited". This has been cleaned up to make the nomenclature
consistent across the codebase.
When DocC processes the availability information for symbol graphs, it
identifies if fallback platforms are available, and if so, injects
platforms that inherit their availability from the fallback platforms.
E.g. the iPadOS and Mac Catalyst platforms inherit their availability
from iOS.

In the case of articles, the platform availability information is not
used in rendering the page. However, sample code pages are processed as
articles with a different page kind, and these pages do render the
platform availability information. Hence, it is necessary to also
process the fallback platforms when setting the availability for an
article's render node in order to correctly display the list of
supported platforms for sample code pages. This patch updates the logic
in the render node translator to process the availability information
for articles correctly and include fallback platforms.

rdar://158230351
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.

1 participant