Skip to content

Commit

Permalink
Adds documentation for new @Available behavior
Browse files Browse the repository at this point in the history
Documents the format which is expected for the "introduced" field of the `@Available` directive.
  • Loading branch information
anferbui committed Jun 19, 2024
1 parent 98d4c8a commit ad00cf3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/SwiftDocC/Semantics/Metadata/Availability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ extension Metadata {
/// @Available("My Package", introduced: "1.0")
/// ```
///
/// Only strings which are valid semantic version numbers may be passed to the second argument. Specifying an incomplete version number is allowed, as long as all components of the version are valid numbers:
///
/// ```markdown
/// @Available("My Package", introduced: "1.0.0")
/// @Available("My Package", introduced: "1.0")
/// @Available("My Package", introduced: "1")
/// ```
///
/// If an invalid semantic version number is provided, a compiler warning will be issued and the directive will be ignored.
///
/// This directive is available on both articles and documentation extension files. In extension
/// files, the information overrides any information from the symbol itself.
///
Expand Down

0 comments on commit ad00cf3

Please sign in to comment.