Skip to content

Commit

Permalink
final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Jan 25, 2024
1 parent 850343d commit c8ebeba
Show file tree
Hide file tree
Showing 46 changed files with 206 additions and 202 deletions.
1 change: 0 additions & 1 deletion Sources/SyndiKit/Common/Primitives/CData.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// #CDATA XML element.
public typealias StringLiteralType = String
public struct CData: Codable, ExpressibleByStringLiteral, Equatable {
public enum CodingKeys: String, CodingKey {
case value = "#CDATA"
Expand Down
4 changes: 2 additions & 2 deletions Sources/SyndiKit/Common/Primitives/XMLStringInt.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// XML Element which contains a `String` parsable into a `Integer`.
/// XML Element which contains a ``String`` parsable into a ``Integer``.
public struct XMLStringInt: Codable, ExpressibleByIntegerLiteral {
public typealias IntegerLiteralType = Int

/// The underlying `Int` value.
/// The underlying ``Int`` value.
public let value: Int

public init(integerLiteral value: Int) {
Expand Down
6 changes: 3 additions & 3 deletions Sources/SyndiKit/Decoding/SynDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class SynDecoder {
self.defaultXMLDecoderSetup = defaultXMLDecoderSetup ?? Self.setupXMLDecoder(_:)
}

/// Creates an instance of `RSSDecoder`
/// Creates an instance of ``RSSDecoder``
public convenience init() {
self.init(types: nil, defaultJSONDecoderSetup: nil, defaultXMLDecoderSetup: nil)
}
Expand All @@ -93,9 +93,9 @@ public class SynDecoder {
decoder.trimValueWhitespaces = false
}

/// Returns a `Feedable` object of the type you specify, decoded from a JSON object.
/// Returns a ``Feedable`` object of the type you specify, decoded from a JSON object.
/// - Parameter data: The JSON or XML object to decode.
/// - Returns: A `Feedable` object
/// - Returns: A ``Feedable`` object
///
/// If the data is not valid RSS, this method throws the
/// `DecodingError.dataCorrupted(_:)` error.
Expand Down
6 changes: 3 additions & 3 deletions Sources/SyndiKit/Formats/Blogs/CategoryDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
///
/// - Note: This struct is publicly accessible.
///
/// - Important: The `title` and `description` properties are read-only.
/// - Important: The ``title`` and ``description`` properties are read-only.
///
/// - SeeAlso: `Category`
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``Category``
/// - SeeAlso: ``EntryCategory``
public struct CategoryDescriptor {
/// The title of the category.
public let title: String
Expand Down
12 changes: 6 additions & 6 deletions Sources/SyndiKit/Formats/Blogs/CategoryLanguage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
///
/// - Note: This struct is used internally.
///
/// - SeeAlso: `SiteCategoryType`
/// - SeeAlso: `CategoryDescriptor`
/// - SeeAlso: `SiteLanguageType`
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``SiteCategoryType``
/// - SeeAlso: ``CategoryDescriptor``
/// - SeeAlso: ``SiteLanguageType``
/// - SeeAlso: ``EntryCategory``
public struct CategoryLanguage {
/// The type of the category.
public let type: SiteCategoryType
Expand All @@ -22,12 +22,12 @@ public struct CategoryLanguage {
public let language: SiteLanguageType

/// A struct representing an Atom category.
/// Initializes a `CategoryLanguage` instance.
/// Initializes a ``CategoryLanguage`` instance.
///
/// - Parameters:
/// - languageCategory: The category in a specific language.
/// - language: The language of the category.
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
internal init(languageCategory: SiteLanguageCategory, language: SiteLanguageType) {
type = languageCategory.slug
descriptor = CategoryDescriptor(
Expand Down
2 changes: 1 addition & 1 deletion Sources/SyndiKit/Formats/Blogs/Site.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct Site {
/// The language of the website.
public let language: SiteLanguageType

/// Initializes a new `Site` instance.
/// Initializes a new ``Site`` instance.
///
/// - Parameters:
/// - site: The `SiteLanguageCategory.Site` instance to use as a base.
Expand Down
22 changes: 11 additions & 11 deletions Sources/SyndiKit/Formats/Blogs/SiteCategory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
/// - descriptors: A dictionary mapping site language types to category descriptors.
///
/// - Important: This struct should not be used directly.
/// Instead, use the `SiteCategoryBuilder` to create instances of `SiteCategory`.
/// Instead, use the ``SiteCategoryBuilder`` to create instances of ``SiteCategory``.
///
/// - SeeAlso: `SiteCategoryType`
/// - SeeAlso: `CategoryDescriptor`
/// - SeeAlso: `CategoryLanguage`
/// - SeeAlso: `SiteCategoryBuilder`
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``SiteCategoryType``
/// - SeeAlso: ``CategoryDescriptor``
/// - SeeAlso: ``CategoryLanguage``
/// - SeeAlso: ``SiteCategoryBuilder``
/// - SeeAlso: ``EntryCategory``
public struct SiteCategory {
/// The type of the site category.
public let type: SiteCategoryType
Expand All @@ -23,13 +23,13 @@ public struct SiteCategory {
public let descriptors: [SiteLanguageType: CategoryDescriptor]

/// A struct representing an Atom category.
/// Initializes a `SiteCategory` instance with the given languages.
/// Initializes a ``SiteCategory`` instance with the given languages.
///
/// - Parameter languages: An array of `CategoryLanguage` instances.
/// - Parameter languages: An array of ``CategoryLanguage`` instances.
///
/// - Returns: A new `SiteCategory` instance
/// if at least one language is provided, `nil` otherwise.
/// - SeeAlso: `EntryCategory`
/// - Returns: A new ``SiteCategory`` instance
/// if at least one language is provided, ``nil`` otherwise.
/// - SeeAlso: ``EntryCategory``
internal init?(languages: [CategoryLanguage]) {
guard let type = languages.first?.type else {
return nil
Expand Down
2 changes: 1 addition & 1 deletion Sources/SyndiKit/Formats/Blogs/SiteDirectory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public struct SiteCollectionDirectory: SiteDirectory {
instance.categoryDictionary.values
}

/// Initializes a new instance of the `SiteCollectionDirectory` struct.
/// Initializes a new instance of the ``SiteCollectionDirectory`` struct.
///
/// - Parameter blogs: The site collection to use.
internal init(blogs: SiteCollection) {
Expand Down
10 changes: 5 additions & 5 deletions Sources/SyndiKit/Formats/Blogs/SiteDirectoryBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import Foundation

/// A builder for creating a site collection directory.
public struct SiteCollectionDirectoryBuilder: SiteDirectoryBuilder {
/// Initializes a new instance of `SiteCollectionDirectoryBuilder`.
/// Initializes a new instance of ``SiteCollectionDirectoryBuilder``.
public init() {}

/// A struct representing an Atom category.
/// Creates a site collection directory from a site collection.
///
/// - Parameter blogs: The site collection to build the directory from.
///
/// - Returns: A new instance of `SiteCollectionDirectory`.
/// - SeeAlso: `EntryCategory`
/// - Returns: A new instance of ``SiteCollectionDirectory``.
/// - SeeAlso: ``EntryCategory``
public func directory(fromCollection blogs: SiteCollection) -> SiteCollectionDirectory {
SiteCollectionDirectory(blogs: blogs)
}
Expand All @@ -27,7 +27,7 @@ public protocol SiteDirectoryBuilder {
///
/// - Parameter blogs: The site collection to build the directory from.
///
/// - Returns: A new instance of `SiteDirectoryType`.
/// - SeeAlso: `EntryCategory`
/// - Returns: A new instance of ``SiteDirectoryType``.
/// - SeeAlso: ``EntryCategory``
func directory(fromCollection blogs: SiteCollection) -> SiteDirectoryType
}
10 changes: 5 additions & 5 deletions Sources/SyndiKit/Formats/Blogs/SiteLanguage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
/// - Parameters:
/// - content: The content of the site language.
///
/// - SeeAlso: `SiteLanguageType`
/// - SeeAlso: ``SiteLanguageType``
///
/// - Author: Your Name
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public struct SiteLanguage {
/// The type of the site language.
public let type: SiteLanguageType
Expand All @@ -20,13 +20,13 @@ public struct SiteLanguage {
public let title: String

/// A struct representing an Atom category.
/// Initializes a new `SiteLanguage` instance.
/// Initializes a new ``SiteLanguage`` instance.
///
/// - Parameters:
/// - content: The content of the site language.
///
/// - Returns: A new `SiteLanguage` instance.
/// - SeeAlso: `EntryCategory`
/// - Returns: A new ``SiteLanguage`` instance.
/// - SeeAlso: ``EntryCategory``
internal init(content: SiteLanguageContent) {
type = content.language
title = content.title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

// swiftlint:disable nesting
extension SiteLanguageCategory {
/// A `struct` representing a site.
/// A ``struct`` representing a site.
public struct Site: Codable {
/// The title of the site.
public let title: String
Expand Down
6 changes: 3 additions & 3 deletions Sources/SyndiKit/Formats/Blogs/SiteLanguageCategory.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// A struct representing an Atom category.
/// A struct representing a category of site languages.
///
/// - Note: This struct conforms to the `Codable` protocol.
/// - Note: This struct conforms to the ``Codable`` protocol.
///
/// - Important: All properties of this struct are read-only.
///
/// - SeeAlso: `Site`
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``Site``
/// - SeeAlso: ``EntryCategory``
public struct SiteLanguageCategory: Codable {
/// The title of the category.
public let title: String
Expand Down
6 changes: 3 additions & 3 deletions Sources/SyndiKit/Formats/Blogs/SiteLanguageContent.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/// A struct representing an Atom category.
/// A struct representing the content of a site in a specific language.
///
/// - Note: This struct conforms to the `Codable` protocol.
/// - Note: This struct conforms to the ``Codable`` protocol.
///
/// - Important: All properties of this struct are read-only.
///
/// - SeeAlso: `SiteLanguageCategory`
/// - SeeAlso: ``SiteLanguageCategory``
///
/// - Author: Your Name
///
/// - Version: 1.0
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public struct SiteLanguageContent: Codable {
/// The language of the site content.
public let language: String
Expand Down
6 changes: 3 additions & 3 deletions Sources/SyndiKit/Formats/Feeds/Atom/AtomCategory.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// A struct representing an Atom category.
/// A struct representing an Atom category.
///
/// - Note: This struct conforms to the `Codable` and `EntryCategory` protocols.
/// - Note: This struct conforms to the ``Codable`` and ``EntryCategory`` protocols.
///
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
/// - SeeAlso: ``EntryCategory``
public struct AtomCategory: Codable, EntryCategory {
/// The term of the category.
public let term: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/SyndiKit/Formats/Feeds/Atom/AtomFeed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
///
/// Based on the
/// [specifications here](https://datatracker.ietf.org/doc/html/rfc4287#section-4.1.2).
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public struct AtomFeed {
public enum CodingKeys: String, CodingKey {
case id
Expand Down
4 changes: 2 additions & 2 deletions Sources/SyndiKit/Formats/Feeds/Atom/AtomMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
///
/// For more details, check out
/// [the Media RSS Specification](https://www.rssboard.org/media-rss).
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public struct AtomMedia: Codable {
/// A struct representing an Atom category.
/// The type of object.
Expand All @@ -15,7 +15,7 @@ public struct AtomMedia: Codable {
/// it is included because it simplifies decision making on the reader side,
/// as well as flushes out any ambiguities between MIME type and object type.
/// It is an optional attribute.
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public let url: URL

/// The direct URL to the media object.
Expand Down
6 changes: 3 additions & 3 deletions Sources/SyndiKit/Formats/Feeds/JSONFeed/JSONFeed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import Foundation
/// A struct representing an Atom category.
/// A struct representing a JSON feed.
///
/// - Note: This struct conforms to the `DecodableFeed` protocol.
/// - Note: This struct conforms to the ``DecodableFeed`` protocol.
///
/// - SeeAlso: `DecodableFeed`
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``DecodableFeed``
/// - SeeAlso: ``EntryCategory``
public struct JSONFeed {
/// The version of the JSON feed.
public let version: URL
Expand Down
8 changes: 4 additions & 4 deletions Sources/SyndiKit/Formats/Feeds/JSONFeed/JSONItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

/// A struct representing an Atom category.
/// A struct representing an item in JSON format.
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public struct JSONItem: Codable {
/// The unique identifier of the item.
public let guid: EntryID
Expand All @@ -29,7 +29,7 @@ public struct JSONItem: Codable {
extension JSONItem: Entryable {
/// A struct representing an Atom category.
/// Returns an array of authors for the item.
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public var authors: [Author] {
guard let author = author else {
return []
Expand All @@ -44,7 +44,7 @@ extension JSONItem: Entryable {

/// A struct representing an Atom category.
/// An array of creators associated with the item.
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public var creators: [String] {
[]
}
Expand All @@ -61,7 +61,7 @@ extension JSONItem: Entryable {

/// A struct representing an Atom category.
/// An array of categories associated with the item.
/// - SeeAlso: `EntryCategory`
/// - SeeAlso: ``EntryCategory``
public var categories: [EntryCategory] {
[]
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SyndiKit/Formats/Feeds/RSS/Enclosure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct Enclosure: Codable {
/// The length of the enclosure, if available.
public let length: Int?

/// Initializes a new `Enclosure` instance from a decoder.
/// Initializes a new ``Enclosure`` instance from a decoder.
///
/// - Parameter decoder: The decoder to read data from.
/// - Throws: An error if the decoding process fails.
Expand All @@ -31,7 +31,7 @@ public struct Enclosure: Codable {
/// Decodes the length of the enclosure from the given container.
///
/// - Parameter container: The container to decode from.
/// - Returns: The length of the enclosure, or `nil` if not available.
/// - Returns: The length of the enclosure, or ``nil`` if not available.
/// - Throws: An error if the decoding process fails.
private static func decodeLength(
from container: KeyedDecodingContainer<CodingKeys>
Expand Down
Loading

0 comments on commit c8ebeba

Please sign in to comment.