是否可以从CLI构建.DOCC`目录?
当我使用CTRL-CMD-SHIFT-D中XCode构建文档时,它包括我的.docc
目录。当我从命令行运行XcodeBuild Docbuild
时,它不是。
为什么这是?是否可以告诉XcodeBuild使用特定的.docc
目录,而不仅仅是文档注释?
我正在尝试为Swift软件包自动化文档构建过程,但是如果它需要在Xcode中按下按钮,则不能。因为它是一个软件包,所以我没有项目文件或工作空间可以指向或修改。
When I build documentation in Xcode with Ctrl-Cmd-Shift-D, it includes my .docc
catalog. When I run xcodebuild docbuild
from the command line, it doesn't.
Why is this? Is it possible to tell xcodebuild to use a specific .docc
catalog rather than just the doc comments?
I'm trying to automate the documentation build process for a Swift package, but I can't if it requires pressing a button in Xcode. Because it's a package, I have no project file or workspace to point to or modify.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,可以使用文档目录从命令行构建文档。
对于Swift软件包,如“记录应用程序,框架和软件包”文档。
请注意,要在Swift软件包中使用文档目录(如果是Xcode或
XcodeBuild
>中,则无需记录)软件包的Swift Tools版本需要为5.5或更高版本。Xcode中的“构建文档”菜单项与
Xcodebuild Docbuild
操作之间没有任何区别。您可以通过检查两种情况的构建日志,以查看将哪些参数传递给docc
可执行文件,从而确认文档目录是或未传递给DOCC的。Yes, it is possible to build documentation from the command line with a documentation catalog.
For Swift packages, the way that the documentation catalog is associated with the target is by placing the documentation catalog in the same folder as the target’s source files, as mentioned in the “Documenting apps, frameworks, and packages” documentation.
Note that to use a documentation catalog in a Swift package—regardless if it’s in Xcode or in
xcodebuild
—the Package manifest’s Swift tools version needs to be 5.5 or later.There shouldn't be any differences between “Build Documentation” menu item in Xcode and the
xcodebuild docbuild
action. You can confirm that the documentation catalog is or isn't passed to DocC by inspecting the build logs for both cases to see what arguments are passed to thedocc
executable.您还可以使用 swift package manager命令插件用于swift-docc 。下面的命令创建了DOCC存档:
You can also use the Swift Package Manager command plugin for Swift-DocC. The command below creates the DocC archive: