Skip to content

Commit d458dae

Browse files
committed
Update the documentation with the Swift Docc new merge tool from Xcode 16
including SDWebImage 5.21.0
1 parent 3fa4164 commit d458dae

File tree

7,551 files changed

+5614
-27585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,551 files changed

+5614
-27585
lines changed

Configs/Docc.xcconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RUN_DOCUMENTATION_COMPILER = YES
2+
DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES
3+
DOCC_ENABLE_CXX_SUPPORT = YES
4+
DOCC_EXTRACT_EXTENSION_SYMBOLS = YES
5+
OTHER_DOCC_FLAGS= --transform-for-static-hosting

Home.docc/Home.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SDWebImage Home
2+
3+
This page contains SDWebImage and its related projects documentation.
4+
5+
## Overview
6+
7+
SDWebImage contains composable and extensible frameworks, which focused on easy-to-use and full-stack Image Loading solution (including downloading, cache, decoding/encoding, animation, etc), for Apple's UI Framework (AppKit/UIKit/SwiftUI) integration.
8+
9+
## Frameworks
10+
11+
+ [SDWebImage](./documentation/sdwebimage)
12+
+ [SDWebImageSwiftUI](./documentation/sdwebimageswiftui)
13+
14+
## Third-party plugin
15+
16+
+ [SDWebImagePhotosPlugin](./documentation/sdwebimagephotosplugin)
17+
+ [SDWebImageYYPlugin](./documentation/sdwebimageyyplugin)
18+
+ [SDWebImagePINPlugin](./documentation/sdwebimagepinplugin)
19+
20+
## Image codecs
21+
22+
+ [The coder plugin list](https://github.com/SDWebImage/SDWebImage/wiki/Coder-Plugin-List)
23+
24+
## Data Collection Practices
25+
26+
+ [The detailed list of our SDKs Data Collection Practices](./DataCollection)

README.md

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,68 @@ The Swift-DocC need Swift 5.5+, which is bundled in Xcode 13.0.
1919
However, if you need generate Objective-C API documentation, need Swift 5.7+, which is bundled in Xcode 14.0
2020

2121

22-
#### Modify build setting
22+
#### Modify build setting and build each framwework
2323

2424
To build Static Hosting Documentation, which is the new feature talked in [SwiftForum](https://forums.swift.org/t/support-hosting-docc-archives-in-static-hosting-environments/53572)
2525

2626
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:
2727

2828
Change the framework Xcode Project's build settings like this (use XCConfig syntax). For example, modify `Module-Shared.xcconfig` in SDWebImage.
2929

30+
You can find a `Configs/Docc.xcconfig` under this repo root path:
31+
3032
```
3133
RUN_DOCUMENTATION_COMPILER = YES
3234
DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES
33-
OTHER_DOCC_FLAGS = --transform-for-static-hosting
35+
DOCC_ENABLE_CXX_SUPPORT = YES
36+
DOCC_EXTRACT_EXTENSION_SYMBOLS = YES
37+
OTHER_DOCC_FLAGS= --transform-for-static-hosting
3438
```
3539

3640
run with Xcodebuild:
3741

3842
```
39-
xcodebuild build -sdk iphoneos -scheme SDWebImage -configuration Release -destination generic/platform=iOS
43+
xcodebuild build -sdk iphoneos -scheme SDWebImage -configuration Release -destination generic/platform=iOS -xcconfig Docc.xcconfig
4044
```
4145

42-
#### Build and found the doccarchive
46+
#### Merge the Docc Archive
4347

4448
After building, you will found something like `SDWebImage.doccarchive` in the build log (actually, the `BUILD_DIR` under Xcode DerivedData path)
4549

46-
Copy the following folder to this repo:
50+
Then, repeat until all of frameworks doccarchive built.
51+
52+
53+
Merge them into single one
54+
55+
```
56+
xcrun docc merge SDWebImage.doccarchive SDWebImageSwiftUI.doccarchive XXX.doccarchive -o Output.doccarchive
57+
```
58+
59+
#### Upgrade the documentation
60+
61+
After the `Output.doccarchive` generated, copy and override all the contents of `Output.doccarchive` to this repo's root path
4762

4863
```
49-
cp -R SDWebImage.doccarchive/documentation/sdwebimage GitHub/sdwebimage.github.io/documentation/sdwebimage
50-
cp -R SDWebImage.doccarchive/data/documentation/sdwebimage GitHub/sdwebimage.github.io/data/documentation/sdwebimage
51-
cp -R SDWebImage.doccarchive/data/documentation/sdwebimage.json GitHub/sdwebimage.github.io/data/documentation/sdwebimage.json
52-
cp -R SDWebImage.doccarchive/index/index.json GitHub/sdwebimage.github.io/index/sdwebimage/index.json
64+
cp -R Output.doccarchive/* $current_repo_path/
5365
```
5466

67+
Then, git reset the `index.html` under repo's root path (this is our home page, see below)
68+
69+
```
70+
git reset HEAD index.html
71+
```f
72+
73+
#### Upgrade/Hack the home page (rarely do)
74+
75+
We has some markdown written home page, but it requires to sync the CSS/JS resources from the docc tools.
76+
77+
If you upgrade the toolchain, be sure to update `index.html` following the steps:
78+
79+
1. `xcrun docc convert --fallback-display-name Documentation --fallback-bundle-identifier com.dailymodtion.documentation --fallback-bundle-version 1 --output-dir Home.doccarchive Home.docc`
80+
2. Preview at `Home.doccarchive` and using Chrome to rendering `localhost://8000/documentation/home`
81+
3. Copy all the rendered HTML into the new `index.html` file, remove all the `<script>` label (or added `type="application/json"` to disable its function)
82+
4. Override this repo's `index.html` file
83+
5584
#### Preview the documentation site
5685
5786
Launch the simple HTTP Server locally and see on Chrome/Safari browser.
@@ -62,8 +91,9 @@ python3 -m http.server
6291
6392
Then use browser to open `localhost:8000`
6493
65-
#### TODO
94+
#### Done
6695
96+
~~~
6797
1. SwiftDocC does not support multiple documentations hosting on the same site.
6898
6999
I modify the original generated js files, and let that `index.json` support the framework namespace structure. See `patches/`.
@@ -73,8 +103,7 @@ See related feature request here: [Support DocC references to symbols defined in
73103
2. SwiftDocC does not support cross-module reference symbol, unlike Apple's own documentation, like reference `Foundation.Data` symbol from `UIKit.UIImage`
74104
75105
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.
76-
77-
Anyway, jazzy does not support this feature as well. Hoping for future support.
106+
~~~
78107
79108
---
80109

css/866.60f074fd.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/989.4f123103.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/documentation-topic.3bca6578.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

css/documentation-topic.91c07ba9.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/documentation-topic~topic~tutorials-overview.82acfe22.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

css/index.12bb178a.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

css/index.3a335429.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)