-
Notifications
You must be signed in to change notification settings - Fork 166
Support decoding link summaries with absolute paths to external pages #1334
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
Support decoding link summaries with absolute paths to external pages #1334
Conversation
|
@swift-ci please test |
anferbui
left a comment
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.
Verified it works as expected together with swift-docc-render locally 👍🏻
|
@swift-ci please test |
| /// The absolute presentation URL for this element, or `nil` if only the _relative_ presentation URL is known. | ||
| /// | ||
| /// - Note: The absolute presentation URL (if one exists) and the relative presentation URL will always have the same path and fragment components. | ||
| let absolutePresentationURL: URL? |
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.
@d-ronnqvist Could this property be made public to match the rest of this struct? It doesn't make sense to me that a client of DocC's API could access all the other properties in this structure except this one.
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.
It does make sense to have API that only DocC can use but that clients can't.
In this case I'm not sure yet if this property fits into the long-term design of linking between documentation and unless we have an explicit need for making it public (in which case I would probably say we should only make it SPI) I would really prefer to not commit to its long term existence.
This type (LinkDestinationSummary) is used for both documentation from other documentation sources (resolved via a separate process) and documentation from other DocC targets (resolved via --dependency arguments). DocC itself doesn't produce any summaries with absolute presentation URLs but we can't make any guarantees about what other documentation systems do.
At this point I would rather not have behaviors of other documentation systems impact the design for DocC's own external documentation information.
Bug/issue #, if applicable: rdar://149470919
Summary
Support decoding link summaries from external documentation sources that use absolute paths.
This for exa please allows interfacing with another documentation system that hosts its pages on a different domain.
Dependencies
None.
Testing
Modify the
bin/test-data-external-resolverscript on line 95 to return an absolute web URL for the page.Set the
DOCC_LINK_RESOLVER_EXECUTABLEenvironment to the path to thebin/test-data-external-resolverscriptBuild some documentation with a link to
<doc://com.test.bundle/something>in the content.Preview the documentation.
bin/test-data-external-resolverscript.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/testscript and it succeeded