@@ -24,17 +24,65 @@ Distributing your documentation involves the following steps:
24
24
25
25
### Generate a Publishable Archive of Your Documentation
26
26
27
- To create a documentation archive, use the ` docc ` command-line tool.
27
+ To create a documentation archive for a Swift package, use the [ SwiftPM DocC
28
+ Plugin] ( https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/ )
29
+ or use Xcode's _ Build Documentation_ command.
28
30
29
- To export the documentation archive from the command line, run ` docc ` in Terminal.
30
-
31
- For example, to build a documentation archive, use a command similar to the
32
- following:
31
+ Alternatively, use the ` docc ` command-line tool directly, for example:
33
32
34
33
``` shell
35
- docc convert MyNewPackage.docc --fallback-display-name MyNewPackage --fallback-bundle-identifier com.example.MyNewPackage --fallback-bundle-version 1 --additional-symbol-graph-dir .build --output-dir MyNewPackage.doccarchive
34
+ docc convert MyNewPackage.docc \
35
+ --fallback-display-name MyNewPackage \
36
+ --fallback-bundle-identifier com.example.MyNewPackage \
37
+ --fallback-bundle-version 1 \
38
+ --additional-symbol-graph-dir .build \
39
+ --output-dir MyNewPackage.doccarchive
40
+ ```
41
+
42
+ #### Include links to your project's sources
43
+
44
+ When publishing documentation to an audience that has access to your project's
45
+ sources, e.g., for an open-source project hosted on GitHub, consider configuring
46
+ DocC to automatically include links to the declarations of your project's symbols.
47
+
48
+ For example, in the following screenshot, the "ParsableCommand.swift" link
49
+ below the declaration navigates to the ` ParsableCommand ` declaration in the
50
+ project's GitHub repository.
51
+
52
+ ![ A DocC documentation page showing the title and declaration of a symbol
53
+ called ParsableCommand. Under the declaration, there is a link with a Swift
54
+ icon and the file name ParsableCommand.swift] ( link-to-source.png )
55
+
56
+ To configure DocC to generate links to your project's sources, use the source
57
+ service configuration flags like so:
58
+
59
+ ** GitHub**
60
+ ``` bash
61
+ docc convert […] \
62
+ --source-service github \
63
+ --source-service-base-url https://github.com/< org> /< repo> /blob/< branch> \
64
+ --checkout-path < path to local checkout>
65
+ ```
66
+
67
+ ** GitLab**
68
+ ``` bash
69
+ docc convert […] \
70
+ --source-service gitlab \
71
+ --source-service-base-url https://gitlab.com/< org> /< repo> /-/tree/< branch> \
72
+ --checkout-path < path to local checkout>
73
+ ```
74
+
75
+ ** BitBucket**
76
+ ``` bash
77
+ docc convert […] \
78
+ --source-service bitbucket \
79
+ --source-service-base-url https://bitbucket.org/< org> /< repo> /src/< branch> \
80
+ --checkout-path < path to local checkout>
36
81
```
37
82
83
+ These arguments can also be provided to ` swift package generate-documentation `
84
+ if you're using the SwiftPM DocC Plugin or via the ` OTHER_DOCC_FLAGS ` build
85
+ setting when building in Xcode.
38
86
39
87
### Send a Documentation Archive Directly to Developers
40
88
0 commit comments