Skip to content

don't display declaration platforms if they're all the same #717

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
merged 7 commits into from
Jul 24, 2024

Conversation

QuietMisdreavus
Copy link
Contributor

@QuietMisdreavus QuietMisdreavus commented Jul 11, 2023

Bug/issue #, if applicable: rdar://130985928

Summary

This is an experiment to accompany swiftlang/swift-docc#654 - That PR and its SymbolKit dependency change the Declarations section to potentially include multiple declarations from the same platform. This PR updates the Declaration component to drop the platform caption if all the declaration groups have the same platform sets.

Before this change, this is what this situation would look like:

image

With this PR, the symbol looks like this: (this screenshot is using a local Swift-DocC-Render build on my machine, but the above screenshot is using the Swift-DocC-Render that shipped with Xcode 14.3.1, which hopefully explains the padding and heading differences)

image

Dependencies

This can land without it, but it's only useful with swiftlang/swift-docc#654.

Testing

Use the branch from swiftlang/swift-docc#654, then, in the Swift-DocC repo:

Steps:

  1. DOCC_HTML_DIR=/path/to/swift-docc-render/dist swift run docc preview 'Tests/SwiftDocCTests/Test Bundles/AlternateDeclarations.docc'
  2. Ensure that the MyClass/present(completion:) page doesn't print the "macOS" caption on its declarations.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@hqhhuang hqhhuang changed the base branch from main to release/6.0 July 3, 2024 22:54
@hqhhuang hqhhuang changed the base branch from release/6.0 to main July 3, 2024 22:54
add spacing between 2 declaration lists
@hqhhuang
Copy link
Contributor

hqhhuang commented Jul 8, 2024

@swift-ci test

@hqhhuang
Copy link
Contributor

hqhhuang commented Jul 8, 2024

I rebased this PR to latest main and updated it to work with the current Declaration rendering logic.
It's ready for review again.

Copy link
Member

@marinaaisa marinaaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleaned up a bit of the code here 969fa50 but everything else looks good to me!

Thank you!

@hqhhuang
Copy link
Contributor

@swift-ci test

@hqhhuang hqhhuang merged commit 6d2a842 into swiftlang:main Jul 24, 2024
1 check passed
hqhhuang added a commit to hqhhuang/swift-docc-render that referenced this pull request Jul 24, 2024
…g#717) rdar://130985928

don't display declaration platforms if they're all the same (swiftlang#717) rdar://130985928

---------

Co-authored-by: Hanqing Huang <[email protected]>
Co-authored-by: Marina Aísa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants