Skip to content

Commit b05597a

Browse files
authored
Add README and documentation (#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:contact@edrlab.org) 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.

0 commit comments

Comments
 (0)