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

Commit b231c07

Browse files
committed
Add format and module name arguments to GitHub Action
1 parent 5c0e4e0 commit b231c07

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ $ Documentation/
7272

7373
#### swift-doc coverage
7474

75-
The `coverage` subcommand
75+
The `coverage` subcommand
7676
generates documentation coverage statistics for Swift files.
7777

7878
```terminal
7979
$ git clone https://github.com/SwiftDocOrg/SwiftSemantics.git
8080
81-
$ swift run swift-doc coverage SwiftSemantics/Sources/ --output "dcov.json"
81+
$ swift run swift-doc coverage SwiftSemantics/Sources/ --output "dcov.json"
8282
$ cat dcov.json | jq ".data.totals"
8383
{
8484
"count": 207,
@@ -145,14 +145,20 @@ are formatted for publication to your project's [GitHub Wiki][github wiki],
145145
which you can do with
146146
[github-wiki-publish-action][github-wiki-publish-action].
147147
Alternatively,
148-
you could publish `swift-doc`-generated documentation to GitHub Pages,
148+
you could specify HTML format publish documentation to
149+
[GitHub Pages](https://pages.github.com)
149150
or bundle them into a release artifact.
150151

151152
### Inputs
152153

153154
- `inputs`:
154155
One or more paths to Swift files in your workspace.
155156
(Default: `"./Sources"`)
157+
- `format`:
158+
The output format (`"commonmark"` or `"html"`)
159+
(Default: `"commonmark"`)
160+
- `module-name`:
161+
The name of the module.
156162
- `output`:
157163
The path for generated output.
158164
(Default: `"./.build/documentation"`)
@@ -175,6 +181,7 @@ jobs:
175181
uses: SwiftDocOrg/swift-doc@master
176182
with:
177183
inputs: "Source"
184+
module-name: MyLibrary
178185
output: "Documentation"
179186
- name: Upload Documentation to Wiki
180187
uses: SwiftDocOrg/github-wiki-publish-action@v1
@@ -193,7 +200,6 @@ MIT
193200
Mattt ([@mattt](https://twitter.com/mattt))
194201
195202
[ci badge]: https://github.com/SwiftDocOrg/swift-doc/workflows/CI/badge.svg
196-
197203
[alamofire wiki]: https://github.com/SwiftDocOrg/Alamofire/wiki
198204
[swiftsemantics html]: https://swift-doc-preview.netlify.app
199205
[github wiki]: https://help.github.com/en/github/building-a-strong-community/about-wikis

action.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ inputs:
66
description: "One or more paths to Swift files"
77
required: true
88
default: "./Sources"
9+
module-name:
10+
description: "The name of the module "
11+
required: true
12+
format:
13+
description: "The output format"
14+
default: "commonmark"
915
output:
1016
description: "The path for generated output"
1117
required: true
@@ -14,7 +20,17 @@ inputs:
1420
runs:
1521
using: "docker"
1622
image: "Dockerfile"
17-
args: ["generate", "${{ inputs.inputs }}", --output, "${{ inputs.output }}"]
23+
args:
24+
[
25+
generate,
26+
"${{ inputs.inputs }}",
27+
--format,
28+
"${{ inputs.format }}",
29+
--module-name,
30+
"${{ inputs.module-name }}",
31+
--output,
32+
"${{ inputs.output }}",
33+
]
1834

1935
branding:
2036
icon: "book"

0 commit comments

Comments
 (0)