Include availability for fallback platforms in articles #1408
+75
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.fallbackPlatformsvariable provides a mappingfrom 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.
./bin/testscript and it succeeded- [ ] Updated documentation if necessary