-
Notifications
You must be signed in to change notification settings - Fork 158
Rename TitleStyle to PropertyListTitleStyle to clarify its purpose
#919
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
Conversation
|
@swift-ci please test |
| fragments: resolvedInformation.declarationFragments?.declarationFragments.map { DeclarationRenderSection.Token(fragment: $0, identifier: nil) }, | ||
| isBeta: (resolvedInformation.platforms ?? []).contains(where: { $0.isBeta == true }), | ||
| isDeprecated: (resolvedInformation.platforms ?? []).contains(where: { $0.deprecated != nil }), | ||
| titleStyle: resolvedInformation.kind.isSymbol ? .symbol : .title, |
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 would like to get this change on the 6.0 release branch but if you prefer I can open a separate PR that only does that (and the other similarly called out call site).
| titleStyle: self.kind.isSymbol ? .symbol : .title, | ||
| name: title, | ||
| ideTitle: nil, | ||
| propertyListKeyNames: nil, |
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 would like to get this change on the 6.0 release branch but if you prefer I can open a separate PR that only does that (and the other similarly called out call site).
| /// ## See Also | ||
| /// - ``TopicRenderReference/PropertyListKeyNames/rawKey`` | ||
| case useRawKey = "symbol" | ||
| /// Render links to the symbol using a special "IDE title" name, for example, "Enables Data Access". |
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.
nit maybe remove the reference to IDE because it was removed everywhere else?
| case titleStyle | ||
| case name | ||
| case ideTitle | ||
| case propertyListTitleStyle = "titleStyle" |
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 understand this was done to preserve RenderJSON compatibility but I wonder if there is a path forward to eventually encoding these in a more sensible way?
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 was thinking about that as well but AFAIK we've never done a breaking change to the RenderNode OpenAPI spec so I don't think we ever defined a process for how to stop encoding an old value.
For example, we still use the original "project" value for the tutorial page kind and that change predates the initial open source release.
case tutorial = "project"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.
Definitely beyond the scope of this change, but I wonder if we should encode a RenderJSON version field or something.
|
LGTM |
|
@swift-ci please test |
|
@swift-ci please test |
swiftlang#919) * Rename `TitleStyle` to `PropertyListTitleStyle` to clarify its purpose rdar://126292460 * Avoid referring to deprecated "IDE title" in updated documentation
Bug/issue #, if applicable: rdar://126292460
Summary
This renames the confusingly named
TitleStyle/titleandTitleStyle/symboltoPropertyListTitleStyle/useDisplayNameandPropertyListTitleStyle/useRawKeyto clarify what they are used for and fixes a fixes a call site that set thetitleStyleof topic references because it wasn't clear that the API was only for property list keys.For the
TopicRenderReferencechanges I started by renamingtitleStyletopropertyListTitleStyle,nametopropertyListRawKey, andideTitletopropertyListDisplayName. Next, the common prefix led me to group these into a struct to make it even more clear that they are related.Dependencies
None.
Testing
In any documentation project
/path/to/swift-docc-clone/bin/test-data-external-resolverso that "kind/isSymbol" is "false"<doc://com.test.bundle/something>somewhere in the contentDOCC_LINK_RESOLVER_EXECUTABLE=/path/to/swift-docc-clone/bin/test-data-external-resolverChecklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
AddedUpdated tests./bin/testscript and it succeeded