Skip to content

Commit 6238a24

Browse files
committed
Updated documentation to include symbol links
1 parent 4988c1c commit 6238a24

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

Sources/WordpressReader/Protocols/WordpressContent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
/// Wordpress Content
1111
///
12-
/// Used by WordpressPage and WordpressPost
12+
/// Used by ``WordpressPage`` and ``WordpressPost``
1313
public protocol WordpressContent: WordpressItem {
1414
/// The date the content was published.
1515
///

Sources/WordpressReader/Protocols/WordpressItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
/// A Wordpress item that is identifiable with a link and a slug.
1111
///
12-
/// Used by WordpressContent and WordpressCategory
12+
/// Used by ``WordpressContent`` and ``WordpressCategory``
1313
public protocol WordpressItem: Codable, Identifiable, Hashable, Comparable, Sendable, CustomDebugStringConvertible, ParameterLabels {
1414
/// Unique Wordpress identifier for the object.
1515
var id: Int { get }

Sources/WordpressReader/Protocols/WordpressTaxonomy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import Foundation
99

10-
/// A Wordpress Taxonomy used for WordpressCategory and WordpressTag
10+
/// A Wordpress Taxonomy used for ``WordpressCategory`` and ``WordpressTag``
1111
public protocol WordpressTaxonomy: WordpressItem {
1212
/// Number of published posts for the object.
1313
var count: Int { get }

Sources/WordpressReader/RenderedContent.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import Foundation
99

1010
/// Rendered HTML content from the Wordpress API
11+
///
12+
/// Used in ``WordpressContent``
1113
public struct RenderedContent: Codable, Hashable, Equatable, Sendable, ParameterLabels {
1214
public static let labelMaker = Self(rendered: "")
1315

Sources/WordpressReader/WordpressRequest.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public extension WordpressRequest {
6464
public extension WordpressRequest<WordpressPost> {
6565
/// Creates a Wordpress request for Posts.
6666
///
67-
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for WordpressPost.
67+
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for ``WordpressPost``.
6868
/// - Parameter queryItems: Query items used in this request. (default is an empty array)
6969
/// - Returns: A Wordpress request for Posts.
7070
static func posts(_ queryItems: Set<WordpressQueryItem> = []) -> Self {
@@ -75,7 +75,7 @@ public extension WordpressRequest<WordpressPost> {
7575
public extension WordpressRequest<WordpressPage> {
7676
/// Creates a Wordpress request for Pages.
7777
///
78-
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for WordpressPage.
78+
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for ``WordpressPage``.
7979
/// - Parameter queryItems: Query items used in this request. (default is an empty array)
8080
/// - Returns: A Wordpress request for Pages.
8181
static func pages(_ queryItems: Set<WordpressQueryItem> = []) -> Self {
@@ -86,7 +86,7 @@ public extension WordpressRequest<WordpressPage> {
8686
public extension WordpressRequest<WordpressCategory> {
8787
/// Creates a Wordpress request for Categories.
8888
///
89-
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for WordpressCategory.
89+
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for ``WordpressCategory``.
9090
/// - Parameter queryItems: Query items used in this request. (default is an empty array)
9191
/// - Returns: A Wordpress request for Categories.
9292
static func categories(_ queryItems: Set<WordpressQueryItem> = []) -> Self {
@@ -97,7 +97,7 @@ public extension WordpressRequest<WordpressCategory> {
9797
public extension WordpressRequest<WordpressTag> {
9898
/// Creates a Wordpress request for Tags.
9999
///
100-
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for WordpressTag.
100+
/// A custom URL session, start page and max pages can all be set after creation. A fields query item will be ignored and replaced with fields based on the parameter labels for ``WordpressTag``.
101101
/// - Parameter queryItems: Query items used in this request. (default is an empty array)
102102
/// - Returns: A Wordpress request for Tags.
103103
static func tags(_ queryItems: Set<WordpressQueryItem> = []) -> Self {

Sources/WordpressReader/WordpressSite+async-internal.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extension WordpressSite {
1111
/// Asynchronously returns an array of paginated URLs based on the supplied request.
1212
/// - Parameter request: Request used to retrieve paginated URLs
1313
/// - Returns: An array of paginated URLs based on the supplied request.
14-
/// - Throws: WordpressReaderError if there are URL errors, badly formatted query items, or if there is no totalPages value in the header.
14+
/// - Throws: ``WordpressReaderError`` if there are URL errors, badly formatted query items, or if there is no totalPages value in the header.
1515
nonisolated func fetchPaginatedUrls<T: WordpressItem>(_ request: WordpressRequest<T>) async throws -> [URL] {
1616
let baseUrl = restAPIv2Url.appendingPathComponent(T.self.urlComponent)
1717
guard var urlComponents = URLComponents(url: baseUrl, resolvingAgainstBaseURL: true) else {
@@ -57,7 +57,7 @@ extension WordpressSite {
5757
/// - urlSession: URL session to use. (default is .shared)
5858
/// - type: Type of Wordpress item to retrieve.
5959
/// - urls: Array of URLs to use when fetching item arrays.
60-
/// - Returns: An asynchronous throwing stream of arrays of Wordpress items.
60+
/// - Returns: An asynchronous throwing stream of arrays of ``WordpressItem``.
6161
func itemStream<T: WordpressItem>(
6262
urlSession: URLSession = .shared,
6363
_ type: T.Type,
@@ -97,8 +97,8 @@ extension WordpressSite {
9797
/// - urlSession: URL session to use. (default is .shared)
9898
/// - type: Type of Wordpress item to retrieve.
9999
/// - urls: An array of URLs used to retrieve Wordpress items.
100-
/// - Returns: An array of Wordpress items asynchronously.
101-
/// - Throws: WordpressReaderError if there are network errors or if the URLs to not return JSON results that match the provided type.
100+
/// - Returns: An array of ``WordpressItem`` asynchronously.
101+
/// - Throws: ``WordpressReaderError`` if there are network errors or if the URLs to not return JSON results that match the provided type.
102102
nonisolated func fetchItems<T: WordpressItem>(
103103
urlSession: URLSession = .shared,
104104
_ type: T.Type,

Sources/WordpressReader/WordpressSite+async-public.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
extension WordpressSite {
1111
/// Returns Wordpress settings for this site.
1212
/// - Parameter urlSession: URL session to use for this request.
13-
/// - Returns: Wordpress settings.
13+
/// - Returns: ``WordpressSettings``.
1414
/// - Throws: WordpressReaderError if there is a bad response or DecodingError if the type cannot be decoded.
1515
nonisolated public func fetchSettings(urlSession: URLSession = .shared) async throws -> WordpressSettings {
1616
try await urlSession.fetchJsonData(
@@ -24,9 +24,9 @@ extension WordpressSite {
2424
/// - Parameters:
2525
/// - urlSession: URL session to use for this request.
2626
/// - type: Type of Wordpress Item.
27-
/// - id: Unique identifier for Wordpress Item.
28-
/// - Returns: A Wordpress item matching a supplied unique identifier.
29-
/// - Throws: WordpressReaderError if there is a bad response or DecodingError if the type cannot be decoded.
27+
/// - id: Unique identifier for ``WordpressItem``.
28+
/// - Returns: A ``WordpressItem`` matching a supplied unique identifier.
29+
/// - Throws: ``WordpressReaderError`` if there is a bad response or DecodingError if the type cannot be decoded.
3030
nonisolated public func fetchById<T: WordpressItem>(
3131
urlSession: URLSession = .shared,
3232
_ type: T.Type,
@@ -43,8 +43,8 @@ extension WordpressSite {
4343
///
4444
/// The throwing asynchronous stream returns batches that correspond to pages from the Wordpress API and will finish when all batches have completed. They may throw a WordpressReaderError if there are URL errors, badly formatted query items, or a bad response or a DecodingError if the JSON doesn't match the Wordpress item.
4545
/// - Parameter request: Wordpress request used to retrieve Wordpress items.
46-
/// - Returns: An asynchronous throwing stream of arrays of Wordpress items.
47-
/// - Throws: WordpressReaderError, or DecodingError.
46+
/// - Returns: An asynchronous throwing stream of arrays of ``WordpressItem``.
47+
/// - Throws: ``WordpressReaderError``, or DecodingError.
4848
nonisolated public func stream<T: WordpressItem>(
4949
_ request: WordpressRequest<T>
5050
) async throws -> AsyncThrowingStream<[T], Error> {
@@ -56,8 +56,8 @@ extension WordpressSite {
5656
///
5757
/// Use itemStream() if you want to retrieve item batches in an asynchronous stream.
5858
/// - Parameter request: Wordpress request used to retrieve Wordpress items.
59-
/// - Returns: An array of Wordpress items asynchronously.
60-
/// - Throws: WordpressReaderError, or DecodingError.
59+
/// - Returns: An array of ``WordpressItem`` asynchronously.
60+
/// - Throws: ``WordpressReaderError``, or DecodingError.
6161
nonisolated public func fetch<T: WordpressItem>(
6262
_ request: WordpressRequest<T>
6363
) async throws -> [T] {
@@ -69,8 +69,8 @@ extension WordpressSite {
6969
///
7070
/// Use itemStream() if you want to retrieve item batches in an asynchronous stream.
7171
/// - Parameter type: The type of Wordpress item to retrieve using a default request.
72-
/// - Returns: An array of Wordpress items asynchronously.
73-
/// - Throws: WordpressReaderError, or DecodingError.
72+
/// - Returns: An array of ``WordpressItem`` asynchronously.
73+
/// - Throws: ``WordpressReaderError``, or DecodingError.
7474
nonisolated public func fetch<T: WordpressItem>(
7575
_ type: T.Type
7676
) async throws -> [T] {

0 commit comments

Comments
 (0)