-
Notifications
You must be signed in to change notification settings - Fork 161
@PageKind sets the kind for the documentation node
#626
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
Merged
QuietMisdreavus
merged 2 commits into
swiftlang:main
from
QuietMisdreavus:samplecode-kind
Jun 16, 2023
Merged
@PageKind sets the kind for the documentation node
#626
QuietMisdreavus
merged 2 commits into
swiftlang:main
from
QuietMisdreavus:samplecode-kind
Jun 16, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rdar://110182993
Contributor
Author
|
@swift-ci Please test |
d-ronnqvist
approved these changes
Jun 15, 2023
Contributor
Author
|
@swift-ci Please test |
QuietMisdreavus
added a commit
to QuietMisdreavus/swift-docc
that referenced
this pull request
Jun 16, 2023
Cherry-pick of swiftlang#626 rdar://110182993
ethan-kusters
added a commit
to ethan-kusters/swift-docc
that referenced
this pull request
Jul 31, 2023
… the kind for the documentation node (swiftlang#626)" This reverts the changes to 'DocumentationContext.swift' from commit 792b9e8. This change introduced a regression where sample code pages we're always automatically curated even if they'd been manually curated. This made it impossible to curate a sample code page without ending up with duplicate entries for that page. Only the changes to 'DocumentationContext.swift' are being reverted so that the tests added for the other bug this change fixed remain. rdar://112223641
3 tasks
ethan-kusters
added a commit
to ethan-kusters/swift-docc
that referenced
this pull request
Jul 31, 2023
… the kind for the documentation node (swiftlang#626)" This reverts the changes to 'DocumentationContext.swift' from commit 792b9e8. This change introduced a regression where sample code pages we're always automatically curated even if they'd been manually curated. This made it impossible to curate a sample code page without ending up with duplicate entries for that page. Only the changes to 'DocumentationContext.swift' are being reverted so that the tests added for the other bug this change fixed remain. rdar://112223641
ethan-kusters
added a commit
that referenced
this pull request
Jul 31, 2023
…tion (#674) * Revert changes to 'DocumentationContext.swift' from "`@PageKind` sets the kind for the documentation node (#626)" This reverts the changes to 'DocumentationContext.swift' from commit 792b9e8. This change introduced a regression where sample code pages we're always automatically curated even if they'd been manually curated. This made it impossible to curate a sample code page without ending up with duplicate entries for that page. Only the changes to 'DocumentationContext.swift' are being reverted so that the tests added for the other bug this change fixed remain. rdar://112223641 * Targeted fix for specifying sample code kind in link dest summary Adds a targeted fix for specifying the correct "sample code" kind when creating a link destination summary for an article with `@PageKind(sampleCode)` specified. This fixes the issue the previously reverted commit fixed but while maintaining correct autocuration behavior for sample code pages. This likely isn't the right long-term solution and a FIXME comment has been added to track investing a more robust way of tracking article-like pages that require some special-handling. * Add regression test for sample code autocuration
ethan-kusters
added a commit
to ethan-kusters/swift-docc
that referenced
this pull request
Jul 31, 2023
…tion (swiftlang#674) * Revert changes to 'DocumentationContext.swift' from "`@PageKind` sets the kind for the documentation node (swiftlang#626)" This reverts the changes to 'DocumentationContext.swift' from commit 792b9e8. This change introduced a regression where sample code pages we're always automatically curated even if they'd been manually curated. This made it impossible to curate a sample code page without ending up with duplicate entries for that page. Only the changes to 'DocumentationContext.swift' are being reverted so that the tests added for the other bug this change fixed remain. rdar://112223641 * Targeted fix for specifying sample code kind in link dest summary Adds a targeted fix for specifying the correct "sample code" kind when creating a link destination summary for an article with `@PageKind(sampleCode)` specified. This fixes the issue the previously reverted commit fixed but while maintaining correct autocuration behavior for sample code pages. This likely isn't the right long-term solution and a FIXME comment has been added to track investing a more robust way of tracking article-like pages that require some special-handling. * Add regression test for sample code autocuration
ethan-kusters
added a commit
that referenced
this pull request
Aug 1, 2023
…tion (#674) * Revert changes to 'DocumentationContext.swift' from "`@PageKind` sets the kind for the documentation node (#626)" This reverts the changes to 'DocumentationContext.swift' from commit 792b9e8. This change introduced a regression where sample code pages we're always automatically curated even if they'd been manually curated. This made it impossible to curate a sample code page without ending up with duplicate entries for that page. Only the changes to 'DocumentationContext.swift' are being reverted so that the tests added for the other bug this change fixed remain. rdar://112223641 * Targeted fix for specifying sample code kind in link dest summary Adds a targeted fix for specifying the correct "sample code" kind when creating a link destination summary for an article with `@PageKind(sampleCode)` specified. This fixes the issue the previously reverted commit fixed but while maintaining correct autocuration behavior for sample code pages. This likely isn't the right long-term solution and a FIXME comment has been added to track investing a more robust way of tracking article-like pages that require some special-handling. * Add regression test for sample code autocuration
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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://110182993
Summary
When
@PageKindis used to set an article's kind, it doesn't actually set the kind for theDocumentationNodecreated from that article, only theRenderNoderole. This PR sets the node kind for theDocumentationNodewhen the article is loaded, so that it can be used e.g. in thelinkable-entities.jsonfile emitted from the node.Dependencies
None
Testing
To test, use a documentation catalog that includes an article that uses
@PageKind(sampleCode). The bundle atTests/SwiftDocCTests/Test Bundles/SampleBundle.docchas two such articles,MyExternalSampleandMyLocalSample, and is used in the following instructions.Steps:
swift run docc convert --output-path .build/output.docarchive --emit-digest 'Tests/SwiftDocCTests/Test Bundles/SampleBundle.docc'.build/output.docarchive/linkable-entities.jsonand ensure that the pages forMyExternalSampleandMyLocalSamplehave theirkindset toorg.swift.docc.kind.sampleCode.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/testscript and it succeeded