Jan*_*ano 2 ios swift swift-package-manager docc
我有一个托管在 的 SPM 包https://github.com/janodev/foobar。
如何使用 Docc 生成文档并将其托管在 GitHub 上?
let package = Package(\n platforms: [\n .iOS(.v15), .macOS(.v12)\n ],\n dependencies: [\n .package(url: "git@github.com:apple/swift-docc-plugin.git", branch: "main"),\n ],\n targets: [\n // ...\n ]\n)\nRun Code Online (Sandbox Code Playgroud)\n# note this is for GitHub hosting, with a specific target and base path \'Foobar\'\n\n# don\xe2\x80\x99t forget to build or you\xe2\x80\x99ll get blank pages\nswift build\n\n# parameter values are case-sensitive!\nswift package \\\n --allow-writing-to-directory ./docs \\\n generate-documentation \\\n --target Foobar \\\n --output-path ./docs \\\n --transform-for-static-hosting \\\n --hosting-base-path foobar\nRun Code Online (Sandbox Code Playgroud)\n或者,如果包包含 iOS 框架,请改为运行以下命令:
\nxcodebuild build -scheme Foobar -destination generic/platform=iOS\n\nxcodebuild docbuild -scheme Foobar \\\n-destination generic/platform=iOS \\\nOTHER_DOCC_FLAGS="--transform-for-static-hosting --output-path docs --hosting-base-path foobar"\nRun Code Online (Sandbox Code Playgroud)\n这意味着将docs目录推送到 GitHub 存储库。这可能需要一分钟或几分钟,您的浏览器缓存可能会欺骗您,但它应该显示在:
# username repository target\nhttps://janodev.github.io/foobar/documentation/foobar\nRun Code Online (Sandbox Code Playgroud)\n请注意,我的存储库名称是小写的,因此我使用了-hosting-base-path foobar. 然而,目标路径组件始终是小写的,我不知道为什么。
对于任何故障排除,请检查错误数据库:
\n| 归档时间: |
|
| 查看次数: |
746 次 |
| 最近记录: |