Skip to content

Commit ebdf7e7

Browse files
authored
Document that TechnologyRoot is optional (#852)
rdar://124270255
1 parent 70a2fe3 commit ebdf7e7

File tree

3 files changed

+24
-48
lines changed

3 files changed

+24
-48
lines changed

Sources/SwiftDocC/Semantics/Metadata/TechnologyRoot.swift

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This source file is part of the Swift.org open source project
33

4-
Copyright (c) 2021-2023 Apple Inc. and the Swift project authors
4+
Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
55
Licensed under Apache License v2.0 with Runtime Library Exception
66

77
See https://swift.org/LICENSE.txt for license information
@@ -11,14 +11,33 @@
1111
import Foundation
1212
import Markdown
1313

14-
/// A directive to set this page as a documentation root-level node.
14+
/// Configures an article to become a top-level page.
15+
///
16+
/// If your documentation only consists of articles, without any framework documentation or other top-level pages, DocC will use the only article or the article with the same base name as the documentation catalog ('.docc' directory) as the top-level page.
17+
/// If the documentation doesn't contain an article with the same base name as the documentation catalog, DocC will synthesize a minimal top-level page.
18+
///
19+
/// To customize which article is the top-level page of your documentation, add a `TechnologyRoot` directive within a `Metadata` directive in that article:
20+
///
21+
/// ```md
22+
/// # Page Title
1523
///
16-
/// This directive is only valid within a top-level ``Metadata`` directive:
17-
/// ```
1824
/// @Metadata {
1925
/// @TechnologyRoot
2026
/// }
2127
/// ```
28+
///
29+
/// > Earlier Versions:
30+
/// > Before Swift-DocC 6.0, article-only documentation catalogs require one of the articles to be marked as a `TechnologyRoot`.
31+
///
32+
/// ### Containing Elements
33+
///
34+
/// The following items can include a technology root element:
35+
///
36+
/// - ``Metadata``
37+
///
38+
/// ## See Also
39+
///
40+
/// - <doc:formatting-your-documentation-content>
2241
public final class TechnologyRoot: Semantic, AutomaticDirectiveConvertible {
2342
public static let introducedVersion = "5.5"
2443
public let originalMarkup: BlockDirective

Sources/docc/DocCDocumentation.docc/Reference Syntax/API Reference Syntax/Metadata.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Use it with the ``DocumentationExtension`` directive to replace in-source docume
2020
}
2121
```
2222

23-
Use the `Metadata` directive with the ``TechnologyRoot`` directive to configure a documentation page that's not associated with a particular framework, so that page appears as a top-level page.
23+
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.
2424

2525
Use the `Metadata` directive with the ``DisplayName`` directive to configure a symbol's documentation page to use a custom display name.
2626

Sources/docc/DocCDocumentation.docc/Reference Syntax/API Reference Syntax/TechnologyRoot.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)