Skip to content
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

Warn when the documentation contains more than one root page #1170

Open
d-ronnqvist opened this issue Mar 14, 2025 · 0 comments
Open

Warn when the documentation contains more than one root page #1170

d-ronnqvist opened this issue Mar 14, 2025 · 0 comments
Labels
enhancement Improvements or enhancements to existing functionality good first issue Good for newcomers

Comments

@d-ronnqvist
Copy link
Contributor

Feature Name

Warn when the documentation contains more than one root page

Description

Today, DocC assumes that the inputs are well formed and only contain a single root page. This is true when using DocC through an integration like the Swift DocC Plugin but if developer call docc convert directly with custom inputs it's possible to pass unexpected inputs that may have unexpected behaviors.

DocC's internal logic checks that the inputs only contains a single root before performing some operations but it never surfaces this information to the developer.

Since this is unexpected input, it would be good if DocC warned when it detected such inputs.

Specifically, there are two possible situations that are worth warning about separately:

  • The documentation inputs contain symbol graphs for more than one main module.
  • The documentation inputs contain more than one root page. This could either happen if the developer defined a @TechnologyRoot for a catalog with symbol information (which would already have a root page for the module page), or if the developer defined more than one @TechnologyRoot.

For the first case there isn't really a source location to associate this warning with. For the second case, it would be nice if the warning was associated with the markup for the extra @TechnologyRoot directive.

Motivation

Having warnings about unexpected inputs would help developers notice issues and correct the inputs they are passing to DocC or other misconfigurations in their projects.

Importance

This is a rather low importance enhancement that's only really relevant to developers who call docc convert directly rather than through an existing integration. That said, developers who don't use DocC through a higher level integration have more reason to be notified about unexpected inputs because the inputs are in their control.

Alternatives Considered

No response

@d-ronnqvist d-ronnqvist added enhancement Improvements or enhancements to existing functionality good first issue Good for newcomers labels Mar 14, 2025
ayushshrivastv added a commit to ayushshrivastv/swift-docc that referenced this issue Mar 14, 2025
ayushshrivastv added a commit to ayushshrivastv/swift-docc that referenced this issue Mar 17, 2025
Issue "Warn when the documentation contains more than one root page swiftlang#1170"

Added diagnostic for multiple root pages warning, root page count validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements or enhancements to existing functionality good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant