You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update link resolution to distinguish between failed and not-yet resolved references. (#22)
* Update link resolution to distinguish between failed and not-yet resolved references.
(rdar://81334652)
* Address review feedback
- Label `problemForUnresolvedReference` arguments
- Combine switch cases to remove duplicated code
- Single quote reference in error message for consistency
- Add missing word in documentation comment.
Copy file name to clipboardExpand all lines: Sources/SwiftDocC/Infrastructure/DocumentationContext.swift
+31-24Lines changed: 31 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -205,8 +205,8 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
205
205
/// This is tracked to exclude external symbols from the build output. Information about external references is still included for the local pages that makes the external reference.
Copy file name to clipboardExpand all lines: Sources/SwiftDocC/Infrastructure/External Data/ExternalReferenceResolver.swift
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,29 @@ import Foundation
24
24
/// for the node with the documentation content for that reference. Because this content isn't part of the compiled bundle, it won't be included in the build output. However, references to this node from the bundle's content
25
25
/// may incorporate, for example, the external node's title, kind, or abstract in their output.
26
26
///
27
+
/// If the reference doesn't exist in the external source of documentation or if an error occurs while attempting to resolve the reference, the external resolver returns information about the error.
28
+
///
27
29
/// In addition to the information in the documentation node, the external resolver may be asked to provide a web URL that can be used to navigate to this resource. When the render node translator converts a documentation node
28
30
/// that has an external reference in its content to a render node, this provided web URL is the link to the external content.
/// Attempts to resolve an unresolved reference for an external topic.
37
40
///
38
-
/// Your implementation returns a resolved reference if the topic exists in the external source of documentation, or the original unresolved reference if the topic doesn't exist in the external source.
41
+
/// Your implementation returns a resolved reference if the topic exists in the external source of documentation, or information about why the reference failed to resolve if the topic doesn't exist in the external source.
42
+
///
43
+
/// Your implementation will only be called once for a given unresolved reference. Failures are assumed to persist for the duration of the documentation build.
39
44
///
40
45
/// - Parameters:
41
46
/// - reference: The unresolved reference.
42
47
/// - sourceLanguage: The source language of the reference, in case the reference exists in multiple languages.
43
-
/// - Returns: The resolved reference for the topic, or the original unresolved reference if the topic doesn't exist in the external source.
Copy file name to clipboardExpand all lines: Sources/SwiftDocC/Infrastructure/External Data/FallbackReferenceResolver.swift
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,15 @@ import Foundation
21
21
publicprotocolFallbackReferenceResolver{
22
22
/// Attempts to resolve an unresolved reference for a topic that couldn't be resolved locally.
23
23
///
24
-
/// Your implementation returns a resolved reference if the topic exists in the external source of documentation, or the original
25
-
/// unresolved reference if the topic doesn't exist in the external source.
24
+
/// Your implementation returns a resolved reference if the topic exists in the external source of documentation, or information about why the reference failed to resolve if the topic doesn't exist in the external source.
25
+
///
26
+
/// Your implementation will only be called once for a given unresolved reference. Failures are assumed to persist for the duration of the documentation build.
26
27
///
27
28
/// - Parameters:
28
29
/// - reference: The unresolved reference.
29
30
/// - sourceLanguage: The source language of the reference, in case the reference exists in multiple languages.
30
-
/// - Returns: The resolved reference for the topic, or the original unresolved reference if the topic doesn't exist in the external
0 commit comments