Fix @SupportedLanguage directive for articles
#1318
Merged
+156
−15
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://160284853
Summary
The
@SupportedLanguagedirective allows specifying a language that anarticle is available in. It can be used within the
@Metadatadirectivelike in the below example, where the article is made available in both
Swift and Objective-C:
This directive is processed when creating the topic graph node for the
article. The supported languages of an article need to be stored in the
resolved topic reference that eventually gets serialised into the render
node, which the navigator uses. When a catalog contains more than one
module, any articles present are not registered in the documentation
cache, since it is not possible to determine what module it is belongs
to. In such cases, to correctly include the set of supported languages,
they must be added to the reference in the topic graph node during
creation, rather than creating the reference and later updating this
information during registration. This patch adds the logic to store the
set of supported languages during topic node creation for all articles,
indepedent of the cache registration.
Dependencies
N/A
Testing
Unit tests have been added to test this functionality when creating the documentation node and reference for articles containing the directive.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/testscript and it succeeded