Closed dreampiggy closed 2 years ago
Maybe I can ask @Kyle-Ye for help 😂, however he may in holiday...
Hi @dreampiggy, thanks for filing this! We're tracking support for this in https://github.com/apple/swift-docc/issues/255.
Maybe I can ask @Kyle-Ye for help 😂, however he may in holiday...
@dreampiggy If it was multiple targets in a single Package. You can refer to the following PRs
Result:
Result:
TL;DR: Use swift-docc-plugin and copy the another target's result into the original documentation foloder.
swift package <target1> // Build doc for target 1
swift package <target2> // Build doc for target 2
cp -R <target 2 doc result> <target 1 doc result> // Merge the 2 targets' documentation
Looks like this is still a feature waiting for implementation and tracked via #255.
It's not Multiple Target inside single Swift Package (Monorepo like)
It's Multiple Swift Package which contains each of Target (Multirepo like)
Just as if I'm in Apple, and want to merge different Team's CoreFoundation.doccarchive
, UIKit.doccarchive
, ARKit.doccarchive
into single https://developer.apple.com/documentation/ site
And also...Though not really relavant.
The current release swift-docc-plugin support only Swift target, but not Objective-C target. Which will show like this 🙃 So I have to use Xcode 14 or self built docc binary to generate the folder.
And also...Though not really relavant.
The current release swift-docc-plugin support only Swift target, but not Objective-C target. Which will show like this 🙃 So I have to use Xcode 14 or self built docc binary to generate the folder.
For the issue of swift-docc-plugin not supporting ObjectiveC, maybe you can open a issue or feature request here https://github.com/apple/swift-docc-plugin/issues/new/choose
@dreampiggy Did you do this and if so how? Here is what I've done currently. I found the index.json files can not been queried for different framework, without modifing the original JS documentation-topic~topic~tutorials-overview.bd94ab17.js to replace the hard-coded index.json with the index/${framework_name}/index.json
And also...Though not really relavant.
The current release swift-docc-plugin support only Swift target, but not Objective-C target. Which will show like this 🙃 So I have to use Xcode 14 or self built docc binary to generate the folder.
I've finished a prototype PR for ObjC support @dreampiggy You can check and try it here https://github.com/apple/swift-docc-plugin/pull/56
Yes. I use it indeed till today , in https://sdwebimage.github.io/
Open that page to show the result which combine 5 individual github repo (Multirepo) and their DocC html into one page.
The script I used just in this PR, by replacing the code in Xcode's vendored Minified JS. Which is Xcode 14.1. Just be stupid and use text editor to replace:
"index.json"
to "index/"+window.location.pathname.split('/')[2]+"/index.json"
Then you need to copy all things, html pages, index.json, and with the sub folder structure.
See how I've done for SDWebImage (ugly hack): https://github.com/SDWebImage/sdwebimage.github.io#build-and-found-the-doccarchive
But anyway, I will migrate to Monorepo in the future and put all code into one Swift Package with 12 different targets. Maybe at that time I will use different solution.
Feature Request:
Description:
Hi. Swift DocC team. Sorry to bother, but I seems hard to find the correct way to do this, I wonder if this is a feature request or just Swift 5.7 beta bug ?
After watching the WWDC 22 video and following the steps, I can deploy the documentation on GitHub site using the new
--transform-for-static-hosting
args.However, I found it hard to deploy multiple framework documentations into single one static site.
For example, my side project SDWebImage contains more than 10 individual framework. Including another framework SDWebImageSwiftUI for example.
My trick way
Here is what I've done currently. I found the
index.json
files can not been queried for different framework, without modifing the original JSdocumentation-topic~topic~tutorials-overview.bd94ab17.js
to replace the hard-codedindex.json
with theindex/${framework_name}/index.json
(Another issue, what's the original un-minified source code for those JS/CSS files ?)Found swift-docc-renderWell, this is the final result:
https://sdwebimage.github.io/documentation/sdwebimage/ https://sdwebimage.github.io/documentation/sdwebimageswiftui
Motivation:
Replace this paragraph with a description of the use-case this proposal is trying to serve.
Importance:
Not so important beacuse I can use the tricks above to solve the problem. But need an official way is better.
Alternatives Considered
Seems this is related to #204