- Notifications
You must be signed in to change notification settings - Fork1
SDWebImage Documentation
SDWebImage/sdwebimage.github.io
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
SDWebImage Documentationhttps://sdwebimage.github.io
This repository hosts the in source documentation forSDWebImage and its related projects. You can view this atsdwebimage.github.io.
The documentation is auto-generated usingDocC.
See more:
The Swift-DocC merge tool need Swift 5.10+, which is bundled in Xcode 15.2.0+
To build Static Hosting Documentation, which is the new feature talked inSwiftForum
you need to pass--transform-for-static-hosting to docc command. However it's not available in Xcode's handy build settings, so you need to pass extra options duringxcodebuild
You can find aConfigs/Docc.xcconfig under this repo root path:
RUN_DOCUMENTATION_COMPILER = YESDOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YESDOCC_ENABLE_CXX_SUPPORT = YESDOCC_EXTRACT_EXTENSION_SYMBOLS = YESOTHER_DOCC_FLAGS= --transform-for-static-hostingrun with Xcodebuild:
xcodebuild build -sdk iphoneos -scheme SDWebImage -configuration Release -destination generic/platform=iOS -xcconfig Docc.xcconfigAfter building, you will found something likeSDWebImage.doccarchive in the build log (actually, theBUILD_DIR under Xcode DerivedData path)
Then, repeat until all of frameworks doccarchive built.
Merge them into single one
xcrun docc merge SDWebImage.doccarchive SDWebImageSwiftUI.doccarchive XXX.doccarchive -o Output.doccarchiveAfter theOutput.doccarchive generated, copy and override all the contents ofOutput.doccarchive to this repo's root path
cp -R Output.doccarchive/* $current_repo_path/Then, git reset theindex.html under repo's root path (this is our home page, see below)
git reset HEAD index.htmlWe has some markdown written home page, but it requires to sync the CSS/JS resources from the docc tools.
If you upgrade the toolchain, or change anything for thatHome.md markdown, you need to re-generate theindex.html following the steps:
xcrun docc convert --fallback-display-name Documentation --fallback-bundle-identifier com.dailymodtion.documentation --fallback-bundle-version 1 --output-dir Home.doccarchive Home.docc- Preview at
Home.doccarchiveand using Chrome to renderinglocalhost://8000/documentation/home - Copy all the rendered HTML and override this repo root patg
index.htmlfile - Remove all the
<script>label inside HTML (or addedtype="application/json"to script tag to disable its function) - Preview and check the home page render correctly, see blow
Launch the simple HTTP Server locally and see on Chrome/Safari browser.
python3 -m http.serverThen use browser to openlocalhost:8000
1. SwiftDocC does not support multiple documentations hosting on the same site.I modify the original generated js files, and let that `index.json` support the framework namespace structure. See `patches/`.See related feature request here: [Support DocC references to symbols defined in another module](https://github.com/apple/swift-docc/issues/208)2. SwiftDocC does not support cross-module reference symbol, unlike Apple's own documentation, like reference `Foundation.Data` symbol from `UIKit.UIImage`I check the generated js files, though we can merge the final `index.json` in to the large one. However, the `data/${module}.json` contains only the symbol USR for current module, when DocC generate for current module, it does not keep the outer symbol USR, so it can not reference from each other.The documentation is auto-generated usingJazzy.
[sudo] gem install jazzyThis documentation page now hosting both Core repo and other related framework's documentation. To modify the contents, just using the Markdown format and using jazzy to generate the HTML representation. Or directly modify theindex.html.
- Clone bothSDWebImage,jazzy-theme and this repo
- Place them in the same folder
- Go the SDWebImage folder
- Run the following command, remember to change the version string:
jazzy \ --objc \ --author SDWebImage \ --github_url https://github.com/SDWebImage/SDWebImage \ --github-file-prefix https://github.com/SDWebImage/SDWebImage/tree/5.9.0 \ --module-version 5.9.0 \ --umbrella-header WebImage/SDWebImage.h \ --documentation=Docs/\*.md \ --undocumented-text "" \ --module SDWebImage \ --framework-root . \ --sdk iphonesimulator \ --output ../sdwebimage.github.io/SDWebImage \ --theme ../jazzy-theme/themes/appleSDWebImage now contains many related project, like theCoder Plugins repo, the SwiftUI repoSDWebImageSwiftUI.
You should place the generated documentation output folder, inside the sub-directory of this repo.
For Swift project, take SDWebImageSwiftUI for example:
jazzy \ --author SDWebImageSwiftUI \ --github_url https://github.com/SDWebImage/SDWebImageSwiftUI \ --github-file-prefix https://github.com/SDWebImage/SDWebImageSwiftUI/tree/1.5.0 \ --module-version 1.5.0 \ --undocumented-text "" \ --module SDWebImageSwiftUI \ --framework-root . \ --sdk iphonesimulator \ --output ../sdwebimage.github.io/SDWebImageSwiftUI \ --theme ../jazzy-theme/themes/appleFor Objective-C project, it's a little trick that you have tofake an umbrella header, make the include header search path, the same as folder structure. Take SDWebImagePhotosPlugin for example:
Move theSDWebImagePhotosPlugin/Module/SDWebImagePhotosPlugin.h ->SDWebImagePhotosPlugin/SDWebImagePhotosPlugin.h. Then modify all the include form, from this:
#import<SDWebImagePhotosPlugin/NSURL+SDWebImagePhotosPlugin.h>
to this:
#import"Classes/NSURL+SDWebImagePhotosPlugin.h"// And, if there are no `#import <UIKit/UIKit.h>`, add this as well
Finally, use jazzy to generate the documentation:
jazzy \ --objc \ --author SDWebImagePhotosPlugin \ --github_url https://github.com/SDWebImage/SDWebImagePhotosPlugin \ --github-file-prefix https://github.com/SDWebImage/SDWebImagePhotosPlugin/tree/0.4.0 \ --module-version 0.4.0 \ --umbrella-header SDWebImagePhotosPlugin/SDWebImagePhotosPlugin.h \ --undocumented-text "" \ --module SDWebImagePhotosPlugin \ --framework-root . \ --sdk iphonesimulator \ --output ../sdwebimage.github.io/SDWebImagePhotosPlugin \ --theme ../jazzy-theme/themes/appleAbout
SDWebImage Documentation
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.