Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 3b57070

Browse files
authored
Merge branch 'master' into base-url-reimplementation
2 parents 839f314 + 034506a commit 3b57070

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
#65 by @kean and #93 by @mattt.
1414
- Added asset pipeline for CSS assets.
1515
#49 by @kaishin.
16+
- Add `swift-doc` version number to command and generated output.
17+
#94 by @mattt.
1618

1719
### Changed
1820

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
.package(url: "https://github.com/NSHipster/HypertextLiteral.git", .upToNextMinor(from: "0.0.2")),
1919
.package(url: "https://github.com/SwiftDocOrg/Markup.git", .upToNextMinor(from: "0.0.3")),
2020
.package(url: "https://github.com/NSHipster/SwiftSyntaxHighlighter.git", .revision("1.0.0")),
21-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.2")),
21+
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.5")),
2222
.package(url: "https://github.com/apple/swift-log.git", .upToNextMinor(from: "1.2.0")),
2323
.package(url: "https://github.com/NSHipster/swift-log-github-actions.git", .upToNextMinor(from: "0.0.1")),
2424
],

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ $ make install
4646

4747
OVERVIEW: A utility for generating documentation for Swift code.
4848

49-
USAGE: swift-doc <subcommand>
49+
USAGE: swift doc <subcommand>
5050

5151
OPTIONS:
52+
--version Show the version.
5253
-h, --help Show help information.
5354

5455
SUBCOMMANDS:
@@ -67,7 +68,7 @@ $ make install
6768

6869
OVERVIEW: Generates Swift documentation
6970

70-
USAGE: swift-doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>] [--base-url <base-url>]
71+
USAGE: swift doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>] [--base-url <base-url>]
7172

7273
ARGUMENTS:
7374
<inputs> One or more paths to Swift files
@@ -113,7 +114,7 @@ $ Documentation/
113114

114115
OVERVIEW: Generates documentation coverage statistics for Swift files
115116

116-
USAGE: swift-doc coverage [<inputs> ...] [--output <output>]
117+
USAGE: swift doc coverage [<inputs> ...] [--output <output>]
117118

118119
ARGUMENTS:
119120
<inputs> One or more paths to Swift files
@@ -162,7 +163,7 @@ please reach out by [opening an Issue][open an issue]!
162163

163164
OVERVIEW: Generates diagram of Swift symbol relationships
164165

165-
USAGE: swift-doc diagram [<inputs> ...]
166+
USAGE: swift doc diagram [<inputs> ...]
166167

167168
ARGUMENTS:
168169
<inputs> One or more paths to Swift files

Sources/swift-doc/Supporting Types/Pages/FooterPage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct FooterPage: Page {
3131

3232
return Document {
3333
Fragment {
34-
"Generated at \(timestamp) using [swift-doc](\(href))."
34+
"Generated at \(timestamp) using [swift-doc](\(href)) \(SwiftDoc.configuration.version)."
3535
}
3636
}
3737
}
@@ -42,7 +42,7 @@ struct FooterPage: Page {
4242

4343
return #"""
4444
<p>
45-
Generated on <time datetime=\#(timestamp)>\#(dateString)</time> using <a href=\#(href)>swift-doc</a>.
45+
Generated on <time datetime=\#(timestamp)>\#(dateString)</time> using <a href=\#(href)>swift-doc</a> <span class="version">\#(SwiftDoc.configuration.version)</span>.
4646
</p>
4747
"""#
4848
}

Sources/swift-doc/main.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ var standardError = FileHandle.standardError
2121

2222
struct SwiftDoc: ParsableCommand {
2323
static var configuration = CommandConfiguration(
24+
commandName: "swift doc",
2425
abstract: "A utility for generating documentation for Swift code.",
26+
version: "1.0.0-beta.2",
2527
subcommands: [Generate.self, Coverage.self, Diagram.self]
2628
)
2729
}

0 commit comments

Comments
 (0)