Metadata
Use metadata directives to instruct DocC how to build certain documentation files.
Declaration
@Metadata {
...
}Overview
Use the Metadata directive with other directives to configure how certain documentation files build. Place the directive after the documentation page’s title.
Use it with the DocumentationExtension directive to replace in-source documentation with the documentation extension file’s content.
# ``SlothCreator/Sloth``
@Metadata {
@DocumentationExtension(mergeBehavior: override)
}Use the Metadata directive with the TechnologyRoot directive to customize which article is the top-level page for a documentation catalog (’.docc’ directory) without any framework documentation or other top-level pages.
Use the Metadata directive with the DisplayName directive to configure a symbol’s documentation page to use a custom display name.
# ``SlothCreator``
@Metadata {
@DisplayName("Sloth Creator")
}Use the Metadata directive with the TitleHeading directive to configure the text of a page’s title heading.
# ``SlothCreator``
@Metadata {
@TitleHeading("Release Notes")
}Starting with version 6.0, use the Metadata directive with one or more Redirected directives to add additional URLs for a page.
# ``SlothCreator``
@Metadata {
@Redirected(from: "old/path/to/page")
@Redirected(from: "another/old/path/to/page")
}Usage in documentation comments
You can specify @Metadata configuration in documentation comments to specify Available directives. Other metadata directives are not supported in documentation comments.