Skip to content

Commit b05597a

Browse files
authored
Add README and documentation (readium#6)
1 parent f664ef2 commit b05597a

31 files changed

+880
-253
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
# Check that the Carthage project is up to date.
3030
make carthage-project
31-
git diff --exit-code --name-only PM/Carthage/Readium.xcodeproj
31+
git diff --exit-code --name-only Support/Carthage/Readium.xcodeproj
3232
- name: Build
3333
run: |
3434
xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device"

CHANGELOG.md

Lines changed: 381 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/Migration Guide.md

Lines changed: 374 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ help:
88

99
.PHONY: carthage-project
1010
carthage-project:
11-
xcodegen -s PM/Carthage/project.yml --use-cache --cache-path PM/Carthage/.xcodegen
11+
xcodegen -s Support/Carthage/project.yml --use-cache --cache-path Support/Carthage/.xcodegen
1212

1313
.PHONY: scripts
1414
scripts:

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Readium Swift Toolkit
2+
3+
[Readium Mobile](https://github.com/readium/mobile) is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.
4+
5+
This toolkit is a modular project, which follows the [Readium Architecture](https://github.com/readium/architecture).
6+
7+
* [`R2Shared`](Sources/Shared) – Shared `Publication` models and utilities
8+
* [`R2Streamer`](Sources/Streamer) – Publication parsers and local HTTP server
9+
* [`R2Navigator`](Sources/Navigator) – Plain `UIViewController` classes rendering publications
10+
* [`ReadiumOPDS`](Sources/OPDS) – Parsers for OPDS catalog feeds
11+
* [`ReadiumLCP`](Sources/LCP) – Service and models for [Readium LCP](https://www.edrlab.org/readium-lcp/)
12+
13+
A [Test App](TestApp) demonstrates how to integrate the Readium Swift toolkit in your own reading app
14+
15+
## Using Readium
16+
17+
<!--:question: **Find documentation and API reference at [readium.org/kotlin-toolkit](https://readium.org/swift-toolkit)**.-->
18+
19+
Readium libraries are distributed with [Swift Package Manager](#swift-package-manager) (recommended), [Carthage](#carthage) and [CocoaPods](#cocoapods). It's also possible to clone the repository (or a fork) and [depend on the libraries locally](#local-git-clone).
20+
21+
The [Test App](TestApp) contains examples on how to use all these dependency managers.
22+
23+
### Swift Package Manager
24+
25+
From Xcode, open **File** > **Add Packages** and use Readium's GitHub repository for the package URL: `https://github.com/readium/swift-toolkit.git`.
26+
27+
You are then free to add one or more Readium libraries to your application. They are designed to work independently.
28+
29+
If you're stuck, find more information at [developer.apple.com](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app).
30+
31+
### Carthage
32+
33+
Add the following to your `Cartfile`:
34+
35+
```
36+
github "readium/swift-toolkit" ~> 2.2.0
37+
```
38+
39+
Then, [follow the usual Carthage steps](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add the Readium libraries to your project.
40+
41+
Note that Carthage will build all Readium modules and their dependencies, but you are free to add only the ones you are actually using. The Readium libraries are designed to work independently.
42+
43+
Refer to the following table to know which dependencies are required for each Readium library.
44+
45+
| | `R2Shared` | `R2Streamer` | `R2Navigator` | `ReadiumOPDS` | `ReadiumLCP` |
46+
|-----------------|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|
47+
| **`R2Shared`** | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
48+
| `CryptoSwift` | | :heavy_check_mark: | | | :heavy_check_mark: |
49+
| `DifferenceKit` | | | :heavy_check_mark: | | |
50+
| `Fuzi` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
51+
| `GCDWebServer` | | :heavy_check_mark: | | | |
52+
| `Minizip` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
53+
| `SQLite.swift` | | | | | :heavy_check_mark: |
54+
| `SwiftSoup` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
55+
| `ZIPFoundation` | | | | | :heavy_check_mark: |
56+
57+
### CocoaPods
58+
59+
Add the following `pod` statements to your `Podfile` for the Readium libraries you want to use:
60+
61+
```
62+
pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumShared.podspec'
63+
pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumStreamer.podspec'
64+
pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumNavigator.podspec'
65+
pod 'ReadiumOPDS', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumOPDS.podspec'
66+
pod 'ReadiumLCP', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumLCP.podspec'
67+
```
68+
69+
Take a look at [CocoaPods's documentation](https://guides.cocoapods.org/using/using-cocoapods.html) for more information.
70+
71+
### Local Git Clone
72+
73+
You may prefer to use a local Git clone if you want to contribute to Readium, or if you are using your own fork.
74+
75+
First, add the repository as a Git submodule of your app repository, then checkout the desired branch or tag:
76+
77+
```sh
78+
git submodule add https://github.com/readium/swift-toolkit.git
79+
```
80+
81+
Next, drag and drop the whole `swift-toolkit` folder into your project to import Readium as a Swift Package.
82+
83+
Finally, add the Readium libraries you want to use to your app target from the **General** tab, section **Frameworks, Libraries, and Embedded Content**.
84+
85+
### Building with Readium LCP
86+
87+
Using the toolkit with Readium LCP requires additional dependencies, including the framework `R2LCPClient.framework` provided by EDRLab. [Contact EDRLab](mailto:[email protected]) to request your private `R2LCPClient.framework` and the setup instructions.

Sources/LCP/readium-lcp-swift.h

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

Sources/Navigator/r2-navigator-swift.h

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

Sources/OPDS/readium_opds.h

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

Sources/Shared/r2-shared-swift.h

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

Sources/Streamer/r2-streamer-swift-Bridging-Header.h

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

Sources/Streamer/r2-streamer-swift.h

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

PM/Carthage/.xcodegen renamed to Support/Carthage/.xcodegen

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@
268268
../../Sources/LCP/Persistence/Database.swift
269269
../../Sources/LCP/Persistence/Licenses.swift
270270
../../Sources/LCP/Persistence/Transactions.swift
271-
../../Sources/LCP/readium-lcp-swift.h
272271
../../Sources/LCP/Resources
273272
../../Sources/LCP/Resources/en.lproj
274273
../../Sources/LCP/Resources/en.lproj/Localizable.strings
@@ -7390,7 +7389,6 @@
73907389
../../Sources/Navigator/PDF/PDFDocumentView.swift
73917390
../../Sources/Navigator/PDF/PDFNavigatorViewController.swift
73927391
../../Sources/Navigator/PDF/PDFTapGestureController.swift
7393-
../../Sources/Navigator/r2-navigator-swift.h
73947392
../../Sources/Navigator/Resources
73957393
../../Sources/Navigator/Resources/en.lproj
73967394
../../Sources/Navigator/Resources/en.lproj/Localizable.strings
@@ -7414,7 +7412,6 @@
74147412
../../Sources/OPDS/OPDS2Parser.swift
74157413
../../Sources/OPDS/OPDSParser.swift
74167414
../../Sources/OPDS/ParseData.swift
7417-
../../Sources/OPDS/readium_opds.h
74187415
../../Sources/OPDS/URLHelper.swift
74197416
../../Sources/Shared
74207417
../../Sources/Shared/DRM
@@ -7516,7 +7513,6 @@
75167513
../../Sources/Shared/Publication/User Settings
75177514
../../Sources/Shared/Publication/User Settings/UserProperties.swift
75187515
../../Sources/Shared/Publication/User Settings/UserSettings.swift
7519-
../../Sources/Shared/r2-shared-swift.h
75207516
../../Sources/Shared/Resources
75217517
../../Sources/Shared/Resources/en.lproj
75227518
../../Sources/Shared/Resources/en.lproj/Localizable.strings
@@ -7623,8 +7619,6 @@
76237619
../../Sources/Streamer/Parser/PublicationParser.swift
76247620
../../Sources/Streamer/Parser/Readium
76257621
../../Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift
7626-
../../Sources/Streamer/r2-streamer-swift-Bridging-Header.h
7627-
../../Sources/Streamer/r2-streamer-swift.h
76287622
../../Sources/Streamer/Server
76297623
../../Sources/Streamer/Server/PublicationServer.swift
76307624
../../Sources/Streamer/Server/WebServerResourceResponse.swift
File renamed without changes.

0 commit comments

Comments
 (0)