Skip to content

Commit

Permalink
Updates documentation to include the new argument and what it does
Browse files Browse the repository at this point in the history
  • Loading branch information
mustiikhalil committed Mar 7, 2024
1 parent 4df1014 commit 8fff1c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public struct AvailabilityRenderItem: Codable, Hashable, Equatable {
}

init?(_ availability: Metadata.Availability, current: PlatformVersion?) {
// FIXME: Deprecated/Beta markings need platform versions to display properly in Swift-DocC-Render (rdar://56897597)

let platformName = PlatformName(metadataPlatform: availability.platform)
name = platformName?.displayName
introduced = availability.introduced
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftDocC/Semantics/Metadata/Availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ extension Metadata {
///
/// `@Available` is analogous to the `@available` attribute in Swift: It allows you to specify a
/// platform version that the page relates to. To specify a platform and version, list the platform
/// name and use the `introduced` argument:
/// name and use the `introduced` or `deprecated` arguments:
///
/// ```markdown
/// @Available(macOS, introduced: "12.0")
/// @Available(macOS, introduced: "12.0", deprecated: "14.0")
/// ```
///
/// Any text can be given to the first argument, and will be displayed in the page's
Expand Down Expand Up @@ -88,11 +88,11 @@ extension Metadata {
@DirectiveArgumentWrapped(name: .unnamed)
public var platform: Platform

/// The platform version that this page applies to.
/// The platform version that this page was introduced in..
@DirectiveArgumentWrapped
public var introduced: String? = nil

/// The platform version that this page applies to.
/// The platform version that this page was deprecated in.
@DirectiveArgumentWrapped
public var deprecated: String? = nil

Expand Down

0 comments on commit 8fff1c0

Please sign in to comment.