Author and share great documentation for your Swift packages and frameworks.

Posts under DocC tag

25 Posts
Sort by:
Post marked as solved
1 Replies
241 Views
I encountered an issue that I could use the SPM DocC plugin to produce documentation. Will the new version of the Xcode 14 and SPM DocC plugin allow to build directly the documentation using the plugin for the frameworks that e.g. use the UIKit frameworks? When I try to run the plugin and in addition pass sdk and target parameters swift package -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios15.3-simulator" --allow-writing-to-directory ./docs generate-documentation --target UIEnvironment Building for debugging... Build complete! (0.09s) Generating documentation for 'UIEnvironment'... Building for debugging... Build complete! (0.07s) error: 'UIEnvironment' does not contain any documentable symbols or a DocC catalog and will not produce documentation More about it on the Swift Forums: https://forums.swift.org/t/swift-docc-plugin-for-swiftpm/54725/30 Currently, I resolve to directly use Swift DocC rm -rf .build; mkdir -p .build/symbol-graphs \ && swift build --target UIEnvironment \ -Xswiftc "-sdk" \ -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \ -Xswiftc "-target" \ -Xswiftc "arm64-apple-ios15.4-simulator" \-Xswiftc -emit-symbol-graph \ -Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs; mkdir -p .build/swift-docc-symbol-graphs \ && mv .build/symbol-graphs/UIEnvironment* .build/swift-docc-symbol-graphs; export DOCC_HTML_DIR="$(dirname $(xcrun --find docc))/../share/docc/render"; rm -rf docs-out; mkdir -p docs-out/main \ && ../swift-docc/.build/debug/docc convert Sources/UIEnvironment/Documentation.docc \ --fallback-display-name UIEnvironment \ --fallback-bundle-identifier com.plum.UIEnvironment \ --fallback-bundle-version 1.0.0 \ --additional-symbol-graph-dir .build/swift-docc-symbol-graphs \ --transform-for-static-hosting \ --hosting-base-path /UIEnvironment/main \ --output-path docs-out/main; cp -R docs-out/main main another solution is to use xcodebuild docbuild Is it an expected shortcoming that cannot be resolved because of the multiplatform nature of SPM or just a temporary limitation?
Posted
by
Post not yet marked as solved
1 Replies
108 Views
Docc is support multiple language comments? I need to use Docc to document my project. The document for the project I will be working on is in a situation where both Korean and English are required. If multiple language comments support is available, can I know the related materials?
Posted
by
Post not yet marked as solved
1 Replies
108 Views
I want to generate a DocC documentation for an internal Swift Package with the help of SwiftDocC plugin using the following command: The internal framework uses realm-core and realm-cocoa. $ swift package --disable-sandbox preview-documentation --product InternalFramework Actual Results If I build the DocC files via Xcode the build documentation is generated. But if I use the above command on the terminal to generate. There is an error shown on the terminal and the framework fails to build the documentation. The following is the error shown on the terminal Computing version for https://github.com/realm/realm-cocoa.git Computed https://github.com/realm/realm-cocoa.git at 10.28.1 (0.64s) Computing version for https://github.com/realm/realm-core Computed https://github.com/realm/realm-core at 12.1.0 (0.36s) error: Couldn’t update repository submodules: fatal: could not get a repository handle for submodule 'tools/vcpkg/ports' I do not understand whether it is a DocC based issue or a realm issue. Steps & Code to Reproduce Running the following command causes the error: $ swift package --disable-sandbox preview-documentation --product InternalFramework I am not able to understand the root cause of the error.
Posted
by
Post marked as solved
1 Replies
113 Views
I just set up my GitHub Actions pipeline to publish the static content generated by DocC to GitHub Pages. Unfortunately, the way DocC works means I must go to my GitHub Pages URL e.g. (<username>.github.io/<repo-name>) and then append a /documentation/<target-name> path to get where I want. It's frustrating that the buttons GitHub's UI provides all link to <username>.github.io/<repo-name> and I have to keep appending DocC's path to view the documentation. Is there a way to tell DocC there's just one target, and to show that at / instead of /documentation/<target-name>? Or could the DocC team perhaps add a default generated home page with links to the various targets' documentation? Then it's not a blank page when navigating to the base GitHub Pages URL. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
60 Views
Given is an app project with two SPM dependencies: one to a source code repro and one to a repro containing in XCFramework. Using "Build Documentation" in Xcode generates the documentation for the app and source framework but not for the XCFramework. Wonder, why the documentation is not generated from the symbol graph of the binary Tried to create a .doccarchive with the framework using "Build Documentation during 'Build'" build setting, but: .doccarchive is not copied when creating a XCFramework after adding .doccarchive to XCFramework, it will not be resolved and downloaded via SPM Is there any way to distribute the documentation of my binary framework over SPM to be displayed in the Documentsbrowser using the "Build Documentation" command?
Posted
by