Skip to content

Commit 5373d8f

Browse files
authored
Document using DOCC_EXEC in SwiftPM (#653)
Adds a paragraph in the README describing how to invoke a locally built docc when using SwiftPM, setting DOCC_EXEC env variable.
1 parent adc2200 commit 5373d8f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,21 @@ The next time you invoke a documentation build with the "Build Documentation"
144144
button in Xcode's Product menu, your custom `docc` will be used for the build.
145145
You can confirm that your custom `docc` is being used by opening the latest build
146146
log in Xcode's report navigator and expanding the "Compile documentation" step.
147-
147+
148+
### Invoking `docc` from Swift Package Manager
149+
150+
You can also test a locally built version of Swift-DocC using the Swift Package
151+
Manager from the command line. The Swift-DocC SwiftPM plugin will try to read
152+
`DOCC_EXEC` environment variable value, and use the path you provded if it's set.
153+
154+
1. In your project's `Package.swift`, add a dependency on the [`Swift-DocC Plugin`](https://github.com/apple/swift-docc-plugin).
155+
2. Set the `DOCC_EXEC` environment variable and run the documentation generation
156+
command:
157+
158+
```bash
159+
DOCC_EXEC=/path/to/docc swift package generate-documentation
160+
```
161+
148162
## Using `docc` to build and preview documentation
149163

150164
The preferred way of building documentation for your Swift package is by using

0 commit comments

Comments
 (0)