-
Notifications
You must be signed in to change notification settings - Fork 128
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
Refine logic for when curation removes a symbol from automatic curation #1075
Refine logic for when curation removes a symbol from automatic curation #1075
Conversation
ad776a2
to
399de98
Compare
…y curated outside their canonical container
…container doesn't remove them from the default topic group.
Also, remove member symbol from top-level symbol curation example
3e1458d
to
39bd4c7
Compare
# Conflicts: # Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver+Breadcrumbs.swift
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, left some small comments.
@@ -2409,7 +2409,7 @@ public class DocumentationContext { | |||
/// | |||
/// - Parameter automaticallyCurated: A list of automatic curation records. | |||
func removeUnneededAutomaticCuration(_ automaticallyCurated: [AutoCuratedSymbolRecord]) { | |||
// It might look like it would be correct to check `topicGraph.nodes[symbol]?.isManuallyCurated` here, | |||
// It might look like it would be correct to check `topicGraph.nodes[symbol]?.isManuallyCuratedInContainer` here, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be shouldAutoCurateInCanonicalLocation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you. I renamed that property more than once for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f4265d3
> Note: | ||
> If you organize a member symbol into a topic group outside of its canonical container symbol, | ||
> DocC will still include the member symbol in the default topic group. | ||
> This ensures that the reader can always find the member symbol somewhere in the sub-hierarchy of its canonical container symbol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example here might be helpful, as I'm not sure how recognisable the term "canonical container symbol" will be for those reading this documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rephrased this in f788950 to "the type that defines the member". That sentence gets a bit confusing with symbols that have different locations in different language representations but I think overall fewer people will be confused by it.
Co-authored-by: Andrea Fernandez Buitrago <15234535+anferbui@users.noreply.github.com>
- Update reference to topic graph node property in code comment
- Rephrase public documentation about curating a symbol outside its canonical container
@swift-ci please test |
Bug/issue #, if applicable: rdar://133338975
Summary
This refines the logic for when authored curation would remove a symbol from automatic curation.
Before this, any authored curation would remove a symbol or article from automatic curation.
With these changes, a symbol isn't removed from automatic curation if it's curated outside of its canonical container.
This new code comment explains the new logic well:
These added tests also verify when specific types curation do or don't remove a symbol from automatic curation.
Dependencies
None.
Testing
In a project with some symbols:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded