Skip to content

Use the single-letter icon for namespace symbols in navigator #777

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 4 commits into from
Feb 16, 2024

Conversation

mportiz08
Copy link
Contributor

@mportiz08 mportiz08 commented Feb 6, 2024

Bug/issue #, if applicable: 120780967

Summary

Updates configuration so that pages for C++ "namespace" symbols are rendered with a single-letter "N" icon in the navigator sidebar instead of a generic "article" icon.

Example

Screenshot 2024-02-15 at 12 46 37 PM

Dependencies

swiftlang/swift-docc#817

Testing

Steps:

  1. Checkout this branch of swift-docc-render and build it with npm run build
  2. Checkout my branch of swift-docc from Use a more detailed page type for C++ namespaces in navigator index swift-docc#817 and build it with swift build
  3. Preview the example C++ doc catalog with DOCC_HTML_DIR=/path/to/swift-docc-render/dist swift run docc preview Tests/SwiftDocCTests/Test\ Bundles/CxxSymbols.docc
  4. Open http://localhost:8080/documentation/cxxsymbols and verify that the Foo namespace in the navigator is using the "N" icon

Checklist

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

  • Added tests (unit test for icon mappings are dynamically generated)
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

\cc @daniel-grumberg

Copy link
Contributor

@hqhhuang hqhhuang left a comment

Choose a reason for hiding this comment

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

Looks good!
I find it a bit confusing that a page tagged with the TechnologyIcon has article style content instead of symbol style content though. Why don't we use a symbol icon with the letter N to represent namespace symbols?

@mportiz08
Copy link
Contributor Author

Looks good! I find it a bit confusing that a page tagged with the TechnologyIcon has article style content instead of symbol style content though. Why don't we use a symbol icon with the letter N to represent namespace symbols?

While a C++ namespace is technically categorized as a symbol by DocC, it conceptually represents a grouping of other symbols, most similar to a module in Swift, which we render with the generic "technology" icon.

@mportiz08 mportiz08 changed the title Use the technology icon for namespace symbols in navigator Use the single-letter icon for namespace symbols in navigator Feb 15, 2024
@mportiz08
Copy link
Contributor Author

@daniel-grumberg suggested using the "N" icon as well, so I've changed it to that

@mportiz08 mportiz08 requested a review from hqhhuang February 15, 2024 20:48
@mportiz08
Copy link
Contributor Author

@swift-ci test

@mportiz08 mportiz08 requested a review from eango February 16, 2024 18:19
Copy link

@eango eango left a comment

Choose a reason for hiding this comment

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

Tested and looking good; thanks @mportiz08

@mportiz08 mportiz08 merged commit 43d4f04 into swiftlang:main Feb 16, 2024
@mportiz08 mportiz08 deleted the map-namespace-icon branch February 16, 2024 19:31
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.

3 participants