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
// We're dealing with a relative path, so search will be a bit more complicated.
533
-
// Starting from the parent, we ascend in the tree trying to find a node that matches
534
-
// our search path's first component. If we find one, we try to obtain the descendant
535
-
// matching the remainder of the search path using `findChild(of:remaining:)`. If that
536
-
// fails, we continue the search up the tree, after we've saved the error to be returned
537
-
// later.
538
-
539
-
// Errors collected during the process
540
-
varerrors:[Error]=[]
541
-
542
506
// If a parent ID was provided, start at that node and continue up the hierarchy until that node has a child that matches the first path components name.
Both types of links can be used in a relative or absolute way. Absolute symbol links have a leading slash (`/`) and must start with the module they are referring to, for example ` ``/MyModule/MyClass/myProperty`` `.
26
-
27
25
## Resolving a Documentation Link
28
26
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
-
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
-
33
-
```swift
34
-
structContainer {
35
-
structContainer {
36
-
/// ``Container`` links to `Container.Container`
37
-
/// ``MyModule/Container`` links to the outer `Container`
38
-
funcfoo() { }
39
-
}
40
-
}
41
-
```
27
+
To make authored documentation links easier to write and easier to read in plain text format all authored documentation links are 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.
42
28
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`.
29
+
These relative documentation links can specify path components from higher up in the documentation hierarchy to reference container symbols or container pages.
0 commit comments