-
Notifications
You must be signed in to change notification settings - Fork 119
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
No pages warning #664
No pages warning #664
Conversation
* Emit warning when converting/previewing article-only catalogs with no technology root * [rdar://112462434] fix: Emit diagnostics originated in the Convert Action `perform` process
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.
Since this error message is user-facing I feel that it'd be good to iterate on it to make it more actionable (depending on context, the developer may not be presented the explanation).
Sources/SwiftDocCUtilities/Action/Actions/Convert/ConvertAction.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocCUtilities/Action/Actions/Convert/ConvertAction.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocCUtilities/Action/Actions/Convert/ConvertAction.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocCUtilities/Action/Actions/Convert/ConvertAction.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticConsumer.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Infrastructure/Diagnostics/DiagnosticEngine.swift
Outdated
Show resolved
Hide resolved
@swift-ci please test |
Sources/SwiftDocCUtilities/Action/Actions/Convert/ConvertAction.swift
Outdated
Show resolved
Hide resolved
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.
This looks good to me. Thank you
@swift-ci please test |
Thanks @d-ronnqvist |
Bug/issue #, if applicable: #553
Summary
This pr is intended to provide a solution (or at least a better UX) for the cases when a user tries to convert documentation via CLI that results in no pages.
Documentation with no pages occurs when a user creates article-only documentation and doesn't set a technology root inside the catalog. When this happens, the resulting documentation will show a blank page with an
An unknown error occurred.
message. This behavior could be frustrating to the users that are just starting with DocC and are not aware of theTechnologyRoot
directive.To improve the user experience, we are emitting a warning both for
docc convert
anddocc preview
letting the user know that the resulting documentation doesn't contain any pages and pointing them to the technologyroot doc.This is the implementation of one of the solutions proposed by @d-ronnqvist in #553, and a topic in the Swift forums will be created to discuss with the rest of the community if this is the most convenient approach or if we should implement a more disruptive solution.
This pr also includes small changes to fix rdar://112462434.
Dependencies
N/A
Testing
Preview and/or a .docc catalog with no technology root. Check the CLI warnings and assert that the following message is printed on screen:
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded