Browse Source

Fix all documentation warnings

onevcat 2 years ago
parent
commit
2e25977961

+ 1 - 1
Sources/Cache/ImageCache.swift

@@ -37,7 +37,7 @@ extension Notification.Name {
     ///
     /// The `object` of this notification is the ``ImageCache`` object that sends the notification. You can retrieve a
     /// list of removed hashes (files) by accessing the array under the ``KingfisherDiskCacheCleanedHashKey`` key in
-    /// the ``userInfo`` of the received notification object. By checking the array, you can determine the hash codes
+    /// the `userInfo` of the received notification object. By checking the array, you can determine the hash codes
     /// of the removed files.
     /// 
     /// > Invoking the `clearDiskCache` method manually will not trigger this notification.

+ 1 - 1
Sources/Documentation.docc/CommonTasks/CommonTasks_Cache.md

@@ -5,7 +5,7 @@ Common tasks related to the ``ImageCache`` in Kingfisher.
 ## Overview
 
 Kingfisher employs a hybrid ``ImageCache`` for managing cached images, comprising both memory and disk storage. It 
-offers high-level APIs for cache management. Unless otherwise specified, the ``ImageCache.default`` instance is 
+offers high-level APIs for cache management. Unless otherwise specified, the ``ImageCache/default`` instance is 
 used throughout Kingfisher.
 
 ### Using another cache key

+ 2 - 2
Sources/Documentation.docc/CommonTasks/CommonTasks_Downloader.md

@@ -108,7 +108,7 @@ let task = imageView.kf.set(with: url)
 task?.cancel()
 ```
 
-Alternatively, you can invoke ``KingfisherWrapper/cancelDownloadTask()`` on the image view to cancel the 
+Alternatively, you can invoke ``KingfisherWrapper/cancelDownloadTask()-2gg15`` on the image view to cancel the 
 **current downloading task**.
 
 ```swift
@@ -164,7 +164,7 @@ The default download timeout for a request is 15 seconds. To customize this for
 downloader.downloadTimeout = 60
 ```
 
-For setting a timeout specific to a request, utilize a ``KingfisherOptionsInfoItem/requestModifier(_:):``:
+For setting a timeout specific to a request, utilize a ``KingfisherOptionsInfoItem/requestModifier(_:)``:
 
 ```swift
 let modifier = AnyModifier { request in

+ 1 - 1
Sources/Documentation.docc/Topics/Topic_Retry.md

@@ -4,7 +4,7 @@ Managing the retry mechanism when an error happens during loading.
 
 ## Overview
 
-Use ``KingfisherOptionsInfoItem.retryStrategy(_:)`` along with a `RetryStrategy` implementation to easily set up a 
+Use ``KingfisherOptionsInfoItem/retryStrategy(_:)`` along with a `RetryStrategy` implementation to easily set up a 
 retry mechanism for image setting operations when an error occurs. 
 
 This combination allows you to define retry logic, including the number of retries and the conditions under which a 

+ 5 - 3
Sources/Documentation.docc/Tutorials/GettingStartedSwiftUI.tutorial

@@ -1,7 +1,7 @@
 @Tutorial(time: 10) {
     @Intro(title: "Getting Started with Kingfisher (SwiftUI)") {
-        Installs Kingfisher and basic usage of the framework with SwiftUI.
-        @Image(source: "getting-started-card", alt: "Title image of the tutorial. A kingfisher bird standing on a tree.")    
+        Install Kingfisher and learn basic usage of the framework with SwiftUI.
+        @Image(source: getting-started-card, alt: "Title image of the tutorial. A kingfisher bird standing on a tree.")    
     }
     
     @Section(title: "Overview") {
@@ -18,6 +18,7 @@
             
             @Image(source:preview-3-swiftui.png, alt:"The first image is loaded into the image view in cell.")
         }
+        @Steps { }
     }
     
     @Section(title: "Installing") {
@@ -171,11 +172,12 @@
             gradually grow to like it.
             
             Next, we recommend that you start using Kingfisher in your projects to help you accomplish tasks. You can 
-            also read the <doc:CommonTasks> or <doc:KingfisherInDepth> articles to get a better understanding. When 
+            also read the <doc:CommonTasks> and its related articles to get a better understanding. When 
             you encounter problems, come back to consult the documentation or ask the community. 
             
             Have a nice day!
         }
+        @Steps { }
     }
     
 }

+ 5 - 2
Sources/Documentation.docc/Tutorials/GettingStartedUIKit.tutorial

@@ -1,6 +1,6 @@
 @Tutorial(time: 15) {
     @Intro(title: "Getting Started with Kingfisher (UIKit)") {
-        Installs Kingfisher and basic usage of the framework with UIKit.
+        Install Kingfisher and learn basic usage of the framework with UIKit.
         @Image(source: "getting-started-card", alt: "Title image of the tutorial. A kingfisher bird standing on a tree.")
     }
     
@@ -19,6 +19,8 @@
             
             @Image(source:preview-4.png, alt:"The first image is loaded into the image view in cell.")
         }
+        
+        @Steps { }
     }
     
     @Section(title: "Installing") {
@@ -215,10 +217,11 @@
             gradually grow to like it. 
             
             Next, we recommend that you start using Kingfisher in your projects to help you accomplish tasks. You can 
-            also read the <doc:CommonTasks> or <doc:KingfisherInDepth> articles to get a better understanding. When 
+            also read the <doc:CommonTasks> and its related articles to get a better understanding. When 
             you encounter problems, come back to consult the documentation or ask the community. 
             
             Have a nice day!
         }
+        @Steps { }
     }
 }

+ 10 - 7
Sources/Documentation.docc/Tutorials/Tutorials.tutorial

@@ -1,14 +1,17 @@
 @Tutorials(name: "Kingfisher Tutorials") {
     @Intro(title: "Kingfisher Tutorials") {
-        
-        
-        @Image(source: "", alt: "")
+        Getting started with Kingfisher by following a sample app.
     }
     
-    @Chapter(name: "Getting Started with Kingfisher") {
-        
-        @Image(source: <#file#>, alt: "<#accessible description#>")
-        
+    @Chapter(name: "Getting Started with Kingfisher (UIKit)") {
+        @Image(source: logo)
+        Installs Kingfisher and basic usage of the framework with UIKit.
         @TutorialReference(tutorial: "doc:GettingStartedUIKit")
     }
+    
+    @Chapter(name: "Getting Started with Kingfisher (SwiftUI)") {
+        @Image(source: logo)
+        Installs Kingfisher and basic usage of the framework with SwiftUI.
+        @TutorialReference(tutorial: "doc:GettingStartedSwiftUI")
+    }
 }

+ 5 - 5
Sources/General/KF.swift

@@ -52,7 +52,7 @@ public enum KF {
     /// Creates a builder for a given ``Source``.
     /// - Parameter source: The ``Source`` object defines data information from network or a data provider.
     /// - Returns: A ``Builder`` for future configuration. After configuring the builder, call its 
-    /// ``Builder/set(to:)-2sm8j`` to start the image loading.
+    /// `Builder/set(to:)` to start the image loading.
     public static func source(_ source: Source?) -> KF.Builder {
         Builder(source: source)
     }
@@ -60,7 +60,7 @@ public enum KF {
     /// Creates a builder for a given ``Resource``.
     /// - Parameter resource: The ``Resource`` object defines data information like key or URL.
     /// - Returns: A ``Builder`` for future configuration. After configuring the builder, call its
-    /// ``Builder/set(to:)-2sm8j`` to start the image loading.
+    /// `Builder/set(to:)` to start the image loading.
     public static func resource(_ resource: Resource?) -> KF.Builder {
         source(resource?.convertToSource())
     }
@@ -71,7 +71,7 @@ public enum KF {
     ///   - cacheKey: The key used to store the downloaded image in cache.
     ///               If `nil`, the `absoluteString` of `url` is used as the cache key.
     /// - Returns: A ``Builder`` for future configuration. After configuring the builder, call its
-    /// ``Builder/set(to:)-2sm8j`` to start the image loading.
+    /// `Builder/set(to:)` to start the image loading.
     public static func url(_ url: URL?, cacheKey: String? = nil) -> KF.Builder {
         source(url?.convertToSource(overrideCacheKey: cacheKey))
     }
@@ -79,7 +79,7 @@ public enum KF {
     /// Creates a builder for a given ``ImageDataProvider``.
     /// - Parameter provider: The ``ImageDataProvider`` object contains information about the data.
     /// - Returns: A ``Builder`` for future configuration. After configuring the builder, call its
-    /// ``Builder/set(to:)-2sm8j`` to start the image loading.
+    /// `Builder/set(to:)` to start the image loading.
     public static func dataProvider(_ provider: ImageDataProvider?) -> KF.Builder {
         source(provider?.convertToSource())
     }
@@ -89,7 +89,7 @@ public enum KF {
     ///   - data: The data object from which the image should be created.
     ///   - cacheKey: The key used to store the downloaded image in cache.
     /// - Returns: A ``Builder`` for future configuration. After configuring the builder, call its
-    /// ``Builder/set(to:)-2sm8j`` to start the image loading.
+    /// `Builder/set(to:)` to start the image loading.
     public static func data(_ data: Data?, cacheKey: String) -> KF.Builder {
         if let data = data {
             return dataProvider(RawImageDataProvider(data: data, cacheKey: cacheKey))

+ 1 - 1
Sources/General/KFOptionsSetter.swift

@@ -787,7 +787,7 @@ extension KFOptionSetter {
     /// Sets the expiration extending setting for the disk cache. The item expiration time will be incremented by this 
     /// value after access.
     ///
-    /// By default, the underlying ``DiskStorage.Backend`` uses the initial cache expiration as the extending
+    /// By default, the underlying ``DiskStorage/Backend`` uses the initial cache expiration as the extending
     ///  value: ``ExpirationExtending/cacheTime``.
     ///
     /// To disable the extending option entirely, set `.none` to it.

+ 4 - 3
Sources/Networking/ImageDownloaderDelegate.swift

@@ -78,8 +78,8 @@ public protocol ImageDownloaderDelegate: AnyObject {
     /// ``KingfisherError/ResponseErrorReason/dataModifyingFailed(task:)`` error will be raised. You can use this fact
     /// to stop the image processing flow if you find that the data is corrupted or malformed.
     ///
-    /// > If this method is implemented, ``ImageDownloaderDelegate/imageDownloader(_:didDownload:for:)-5btcl`` will not
-    ///  be called anymore.
+    /// > If this method is implemented, the `URL` version of 
+    /// ``ImageDownloaderDelegate/imageDownloader(_:didDownload:for:)-5btcl`` will not be called anymore.
     func imageDownloader(_ downloader: ImageDownloader, didDownload data: Data, with dataTask: SessionDataTask) -> Data?
   
     /// Called when the ``ImageDownloader`` object successfully downloads image data from a specified URL.
@@ -101,7 +101,8 @@ public protocol ImageDownloaderDelegate: AnyObject {
     /// ``KingfisherError/ResponseErrorReason/dataModifyingFailed(task:)`` error will be raised. You can use this fact
     /// to stop the image processing flow if you find that the data is corrupted or malformed.
     ///
-    /// > If ``imageDownloader(_:didDownload:with:)-9w9fn`` is implemented, this method will not be called anymore.
+    /// > If the ``SessionDataTask`` version of `imageDownloader(_:didDownload:with:)` is implemented, this method will
+    /// > not be called anymore.
     func imageDownloader(_ downloader: ImageDownloader, didDownload data: Data, for url: URL) -> Data?
 
     /// Called when the ``ImageDownloader`` object successfully downloads and processes an image from a specified URL.

+ 2 - 2
Sources/Networking/RequestModifier.swift

@@ -29,7 +29,7 @@ import Foundation
 /// Represents and wraps a method for modifying a request before an image download request starts asynchronously.
 ///
 /// Usually, you pass an ``AsyncImageDownloadRequestModifier`` instance as the associated value of
-/// ``KingfisherOptionsInfoItem/requestModifier`` and use it as the `options` parameter in related methods.
+/// ``KingfisherOptionsInfoItem/requestModifier(_:)`` and use it as the `options` parameter in related methods.
 ///
 /// For example, the code below defines a modifier to add a header field and its value to the request.
 ///
@@ -78,7 +78,7 @@ public protocol AsyncImageDownloadRequestModifier {
 /// Represents and wraps a method for modifying a request before an image download request starts synchronously.
 ///
 /// Usually, you pass an ``ImageDownloadRequestModifier`` instance as the associated value of
-/// ``KingfisherOptionsInfoItem/requestModifier`` and use it as the `options` parameter in related methods.
+/// ``KingfisherOptionsInfoItem/requestModifier(_:)`` and use it as the `options` parameter in related methods.
 ///
 /// For example, the code below defines a modifier to add a header field and its value to the request.
 ///

+ 1 - 1
Sources/SwiftUI/KFImageOptions.swift

@@ -140,7 +140,7 @@ extension KFImageProtocol {
     /// Kingfisher will use the fade transition to animate the image if it is downloaded from the web. The transition 
     /// will not occur when the image is retrieved from either memory or disk cache by default. If you need the
     /// transition to occur even when the image is retrieved from the cache, also call
-    /// ``KFImageProtocol/forceRefresh(_:)`` on the returned view.
+    /// ``KFOptionSetter/forceRefresh(_:)`` on the returned view.
     public func fade(duration: TimeInterval) -> Self {
         context.options.transition = .fade(duration)
         return self