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
Copy file name to clipboardExpand all lines: Sources/SwiftDocC/SwiftDocC.docc/SwiftDocC/LinkResolution.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,18 +28,20 @@ Both types of links can be used in a relative or absolute way. Absolute symbol l
28
28
29
29
To make authored documentation links easier to write and easier to read in plain text format all authored documentation links can be written as relative links. The symbol links in documentation extension headers are written relative to the scope of modules. All other authored documentation links are written relative to the page where the link is written.
30
30
31
-
These relative documentation links can specify path components from higher up in the documentation hierarchy to reference container symbols or container pages. If a higher-up container page is shadowed by one of its descendants because they share the same name, the higher-up container page must be linked to using an absolute link.
31
+
These relative documentation links can specify path components from higher up in the documentation hierarchy to reference container symbols or container pages. If a higher-up container page is shadowed by one of its descendants because they share the same name, the higher-up container page must be linked to using an absolute link or a sufficiently unambigious relative link.
32
32
33
33
```swift
34
34
structContainer {
35
35
structContainer {
36
36
/// ``Container`` links to `Container.Container`
37
-
/// ``/MyModule/Container`` links to `Container`
37
+
/// ``MyModule/Container`` links to the outer `Container`
38
38
funcfoo() { }
39
39
}
40
40
}
41
41
```
42
42
43
+
> Note: If `MyModule` were to be named `Container` too, only the absolute link `/Container/Container` could be used to refer to the outer `Container`.
44
+
43
45
### Handling Ambiguous Links
44
46
45
47
It's possible for collisions to occur in documentation links (symbol links or otherwise) where more than one page are represented by the same path. A common cause for documentation link collisions are function overloads (functions with the same name but different arguments or different return values). It's also possible to have documentation link collisions in conceptual content if an article file name is the same as a tutorial file name (excluding the file extension in both cases).
0 commit comments