Links
Link one doc to another so the link keeps working when the doc moves.Link another doc
Write {@link [provider:]kind:name} in prose, list items, and table cells to link another doc. The CLI prints the command that opens it, so the link keeps working when the doc moves.
javascript{type: 'prose', text: 'Before you ship, read {@link generic:deploying}.'},{type: 'list', style: 'unordered', items: ['All guides: {@link namespace:acme}.']},{type: 'table', headers: ['Task', 'Guide'], rows: [['Ship', '{@link generic:deploying}']]},
Each link reads as a command. This link, astryx docs cli/integrations/building-blocks/docs/extend-or-replace, opens the next guide.
- The kind is
genericfor a topic or guide,namespacefor a docs section, andcommandorfunctionfor a CLI command or API function. - A link to a component or a template does not resolve. Write its name in backticks instead, such as
AcmeCarousel. - Inside backticks or a code block, link syntax prints as written.
Link another package's docs
A link without a provider resolves against your own package. To link the CLI's docs, or another package's, start the target with that package's name, such as @astryxdesign/cli:.
javascript// Resolves: the CLI's doctor command{type: 'prose', text: 'Check the app with {@link @astryxdesign/cli:command:doctor}.'},// Does not resolve: looks for a doctor command in your package{type: 'prose', text: 'Check the app with {@link command:doctor}.'},
- Name a CLI command the way you type it, spaces included, such as
@astryxdesign/cli:command:doctor integration docs. - In a topic that
extendsanother package's topic, your sections still resolve against your package, so a link to the base topic's docs needs its provider.
Fix a link that names no doc
A link that names no doc prints as written, and doctor integration docs warns. The warning names a search that finds the right target.
bashnpx astryx doctor integration docs
textseverity: [warn]code: invalid_doc_graphmessage: acme/deploying § check-before-you-ship: "command:doctor" names no doc. Find it with `astryx search doctor --type doc`, then name it as `[<provider>:]<kind>:<name>`.
- The warning keeps exit code 0, so read the report before you ship; see
astryx docs cli/integrations/building-blocks/docs/check-your-docs. - A stable CLI before 0.7.0 does not read links: it prints each one as written. See
astryx docs cli/integrations/ship/versioning.