Skip to content

Commit f3aad9d

Browse files
committed
Add more documentation for DocumentationBundle
1 parent bc05658 commit f3aad9d

File tree

1 file changed

+52
-36
lines changed

1 file changed

+52
-36
lines changed

Sources/SwiftDocC/Infrastructure/DocumentationBundle.swift

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,30 @@
1010

1111
import Foundation
1212

13-
/**
14-
A documentation bundle.
15-
16-
A documentation bundle stores all of the authored content and metadata for a collection of topics and/or frameworks.
17-
18-
No content data is immediately loaded when creating a `DocumentationBundle` except for its `Info.plist`. Its purpose is to provide paths on disk for documentation resources.
19-
20-
## Topics
21-
### Bundle Metadata
22-
23-
- ``displayName``
24-
- ``identifier``
25-
- ``version``
26-
*/
13+
/// A collection of the build inputs for a unit of documentation.
14+
///
15+
/// A unit of documentation may for example cover a framework, library, or tool.
16+
/// Projects or packages may have multiple units of documentation to represent the different consumable products in that project or package.
17+
///
18+
/// ## Topics
19+
///
20+
/// ### Input files
21+
///
22+
/// - ``markupURLs``
23+
/// - ``symbolGraphURLs``
24+
/// - ``miscResourceURLs``
25+
///
26+
/// ### Render customization
27+
///
28+
/// - ``customHeader``
29+
/// - ``customFooter``
30+
/// - ``themeSettings``
31+
///
32+
/// ### Metadata
33+
///
34+
/// - ``info``
35+
/// - ``displayName``
36+
/// - ``identifier``
2737
public struct DocumentationBundle {
2838
public enum PropertyListError: DescribedError {
2939
case invalidVersionString(String)
@@ -39,21 +49,17 @@ public struct DocumentationBundle {
3949
}
4050
}
4151

42-
/// Information about this documentation bundle that's unrelated to its documentation content.
52+
/// Non-content information or metadata about this unit of documentation.
4353
public let info: Info
4454

45-
/**
46-
The bundle's human-readable display name.
47-
*/
55+
/// A human-readable display name for this unit of documentation.
4856
public var displayName: String {
4957
info.displayName
5058
}
5159

52-
/**
53-
The documentation bundle identifier.
54-
55-
An identifier string that specifies the app type of the bundle. The string should be in reverse DNS format using only the Roman alphabet in upper and lower case (A–Z, a–z), the dot (“.”), and the hyphen (“-”).
56-
*/
60+
/// A identifier for this unit of documentation
61+
///
62+
/// The string is typically in reverse DNS format using only the Roman alphabet in upper and lower case (A–Z, a–z), the dot (“.”), and the hyphen (“-”).
5763
public var identifier: String {
5864
info.identifier
5965
}
@@ -72,13 +78,25 @@ public struct DocumentationBundle {
7278
@available(*, deprecated, message: "This deprecated API will be removed after 6.1 is released")
7379
public var attributedCodeListings: [String: AttributedCodeListing] = [:]
7480

75-
/// Symbol Graph JSON files for the modules documented by this bundle.
81+
/// Symbol graph JSON input files for the module that's represented by this unit of documentation.
82+
///
83+
/// Tutorial or article-only documentation won't have any symbol graph JSON files.
84+
///
85+
/// ## See Also
86+
///
87+
/// - ``DocumentationBundleFileTypes/isSymbolGraphFile(_:)``
7688
public let symbolGraphURLs: [URL]
7789

78-
/// DocC Markup files of the bundle.
90+
/// Documentation markup input files for this unit of documentation.
91+
///
92+
/// Documentation markup files include both articles, documentation extension files, and tutorial files.
93+
///
94+
/// ## See Also
95+
///
96+
/// - ``DocumentationBundleFileTypes/isMarkupFile(_:)``
7997
public let markupURLs: [URL]
8098

81-
/// Miscellaneous resources of the bundle.
99+
/// Miscellaneous resources (for example images, videos, or downloadable assets) for this unit of documentation.
82100
public let miscResourceURLs: [URL]
83101

84102
/// A custom HTML file to use as the header for rendered output.
@@ -90,21 +108,19 @@ public struct DocumentationBundle {
90108
/// A custom JSON settings file used to theme renderer output.
91109
public let themeSettings: URL?
92110

93-
/**
94-
A URL prefix to be appended to the relative presentation URL.
95-
96-
This is used when a bundle's documentation is hosted in a known location.
97-
*/
111+
/// A URL prefix to be appended to the relative presentation URL.
112+
///
113+
/// This is used when a built documentation is hosted in a known location.
98114
public let baseURL: URL
99115

100-
/// Creates a documentation bundle.
116+
/// Creates a new collection of build inputs for a unit of documentation.
101117
///
102118
/// - Parameters:
103-
/// - info: Information about the bundle.
119+
/// - info: Non-content information or metadata about this unit of documentation.
104120
/// - baseURL: A URL prefix to be appended to the relative presentation URL.
105-
/// - symbolGraphURLs: Symbol Graph JSON files for the modules documented by the bundle.
106-
/// - markupURLs: DocC Markup files of the bundle.
107-
/// - miscResourceURLs: Miscellaneous resources of the bundle.
121+
/// - symbolGraphURLs: Symbol graph JSON input files for the module that's represented by this unit of documentation.
122+
/// - markupURLs: Documentation markup input files for this unit of documentation.
123+
/// - miscResourceURLs: Miscellaneous resources (for example images, videos, or downloadable assets) for this unit of documentation.
108124
/// - customHeader: A custom HTML file to use as the header for rendered output.
109125
/// - customFooter: A custom HTML file to use as the footer for rendered output.
110126
/// - themeSettings: A custom JSON settings file used to theme renderer output.

0 commit comments

Comments
 (0)