How do you refer to documents from another library?

I'm afraid today that's not something that's supported with the open source toolchain, outside of a limited structure that's currently experimental, detailed at A preview of DocC's support for combined documentation.

The experimental mode provides a way to link and reference content in a small hierarchy of modules - the idea being that there's a top-level module that references a number of other modules, but this solution doesn't generalize to any arbitrary, external module.

The topic area (for other discussions or filed issues) is often described as "cross-module linking" - for example ([SR-15431] Support DocC references to symbols defined in another module · Issue #208 · swiftlang/swift-docc · GitHub).

When DocC assembles the archive, it has quite limited knowledge of what's available - generally only what's being built. The work-around that I use is creating an HTML link using the standard link markdown synax [name](link) to reference the remote article where it lives. The workaround has the downside in that it hard-codes the links, which can become brittle with updates to documentation sets or where they're hosted.

1 Like