Skip to content

Any way to support static site (GitHub pages) hosting multiple framework documentations ? #328

Closed
@dreampiggy

Description

@dreampiggy

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 JS documentation-topic~topic~tutorials-overview.bd94ab17.js to replace the hard-coded index.json with the index/${framework_name}/index.json

(Another issue, what's the original un-minified source code for those JS/CSS files ?) Found swift-docc-render

mkdir site
// Just create an empty target to grab all the needed Images, JS, CSS, HTMLs
cp -R Template.doccarchive/* site/
rm -rf site/data/template.json site/data/template documentation/data/template.json 

// copy SDWebImage documentation
cp -R SDWebImage.doccarchive/documentation/sdwebimage site/documentation/sdwebimage
cp -R SDWebImage.doccarchive/data/sdwebimage site/data/sdwebimage
cp -R SDWebImage.doccarchive/data/sdwebimage.json site/data/sdwebimage.json
cp -R SDWebImage.doccarchive/index/index.json site/index/sdwebimage/index.json

// copy SDWebImageSwiftUI documentation
cp -R SDWebImageSwiftUI.doccarchive/documentation/sdwebimageswiftui site/documentation/sdwebimageswiftui
cp -R SDWebImageSwiftUI.doccarchive/data/sdwebimageswiftui site/data/sdwebimageswiftui
cp -R SDWebImageSwiftUI.doccarchive/data/sdwebimageswiftui.json site/data/sdwebimageswiftui.json
cp -R SDWebImageSwiftUI.doccarchive/index/index.json site/index/sdwebimageswiftui/index.json

Well, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions