@@ -44,12 +44,43 @@ $ make install
44
44
45
45
### Usage
46
46
47
- ` swift-doc ` takes one or more paths and enumerates them recursively,
47
+ OVERVIEW: A utility for generating documentation for Swift code.
48
+
49
+ USAGE: swift-doc <subcommand>
50
+
51
+ OPTIONS:
52
+ -h, --help Show help information.
53
+
54
+ SUBCOMMANDS:
55
+ generate Generates Swift documentation
56
+ coverage Generates documentation coverage statistics for Swift
57
+ files
58
+ diagram Generates diagram of Swift symbol relationships
59
+
60
+ #### swift-doc generate
61
+
62
+ OVERVIEW: Generates Swift documentation
63
+
64
+ USAGE: swift-doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>]
65
+
66
+ ARGUMENTS:
67
+ <inputs> One or more paths to Swift files
68
+
69
+ OPTIONS:
70
+ -n, --module-name <module-name>
71
+ The name of the module
72
+ -o, --output <output> The path for generated output (default:
73
+ .build/documentation)
74
+ -f, --format <format> The output format (default: commonmark)
75
+ -h, --help Show help information.
76
+
77
+ The ` generate ` subcommand
78
+ takes one or more paths and enumerates them recursively,
48
79
collecting all Swift files into a single "module"
49
80
and generating documentation accordingly.
50
81
51
82
``` terminal
52
- $ swift doc generate path/to/SwiftProject/Sources
83
+ $ swift doc generate path/to/SwiftProject/Sources --module-name SwiftProject
53
84
$ tree .build/documentation
54
85
$ documentation/
55
86
├── Home
@@ -64,21 +95,32 @@ in CommonMark / GitHub Uncyclo format,
64
95
but you can change that with the ` --output ` and ` --format ` option flags.
65
96
66
97
``` terminal
67
- $ swift doc generate path/to/SwiftProject/Sources --output Documentation --format html
98
+ $ swift doc generate path/to/SwiftProject/Sources --module-name SwiftProject -- output Documentation --format html
68
99
$ Documentation/
69
100
├── (...)
70
101
└── index.html
71
102
```
72
103
73
104
#### swift-doc coverage
74
105
106
+ OVERVIEW: Generates documentation coverage statistics for Swift files
107
+
108
+ USAGE: swift-doc coverage [<inputs> ...] [--output <output>]
109
+
110
+ ARGUMENTS:
111
+ <inputs> One or more paths to Swift files
112
+
113
+ OPTIONS:
114
+ -o, --output <output> The path for generated report
115
+ -h, --help Show help information.
116
+
75
117
The ` coverage ` subcommand
76
118
generates documentation coverage statistics for Swift files.
77
119
78
120
``` terminal
79
121
$ git clone https://github.com/SwiftDocOrg/SwiftSemantics.git
80
122
81
- $ swift run swift-doc coverage SwiftSemantics/Sources/ --output "dcov.json"
123
+ $ swift run swift-doc coverage SwiftSemantics/Sources --output "dcov.json"
82
124
$ cat dcov.json | jq ".data.totals"
83
125
{
84
126
"count": 207,
@@ -110,6 +152,16 @@ please reach out by [opening an Issue][open an issue]!
110
152
111
153
#### swift-doc diagram
112
154
155
+ OVERVIEW: Generates diagram of Swift symbol relationships
156
+
157
+ USAGE: swift-doc diagram [<inputs> ...]
158
+
159
+ ARGUMENTS:
160
+ <inputs> One or more paths to Swift files
161
+
162
+ OPTIONS:
163
+ -h, --help Show help information.
164
+
113
165
The ` diagram ` subcommand
114
166
generates a graph of APIs in [ DOT format] [ dot ]
115
167
that can be rendered by [ GraphViz] [ graphviz ] into a diagram.
0 commit comments