Skip to content

Commit f4e3423

Browse files
committed
Document using DOCC_EXEC in SwiftPM
1 parent 2026dcc commit f4e3423

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,22 @@ 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 Swift Package Manager
151+
CLI. SwiftPM will try to read `DOCC_EXEC` environment variable value, and use
152+
the path you provded if it's set.
153+
154+
1. In your test `Package.swift`, add a dependency on `swift-docc-plugin`.
155+
[`swift-docc-plugin`](https://github.com/apple-swift-docc-plugin) is a
156+
Swift Package Manager plugin that invokes `docc` for you, see details in
157+
`swift-docc-plugin`.
158+
2. Set `DOCC_EXEC` environment variable and run documentation generation
159+
command like this:
160+
161+
`DOCC_EXEC=/path/to/docc swift package generate-documentation`
162+
148163
## Using `docc` to build and preview documentation
149164
150165
The preferred way of building documentation for your Swift package is by using

0 commit comments

Comments
 (0)