Skip to content

Commit

Permalink
Add README and documentation (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu authored Nov 5, 2021
1 parent f664ef2 commit b05597a
Show file tree
Hide file tree
Showing 31 changed files with 880 additions and 253 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
# Check that the Carthage project is up to date.
make carthage-project
git diff --exit-code --name-only PM/Carthage/Readium.xcodeproj
git diff --exit-code --name-only Support/Carthage/Readium.xcodeproj
- name: Build
run: |
xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device"
Expand Down
381 changes: 381 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

374 changes: 374 additions & 0 deletions Documentation/Migration Guide.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ help:

.PHONY: carthage-project
carthage-project:
xcodegen -s PM/Carthage/project.yml --use-cache --cache-path PM/Carthage/.xcodegen
xcodegen -s Support/Carthage/project.yml --use-cache --cache-path Support/Carthage/.xcodegen

.PHONY: scripts
scripts:
Expand Down
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Readium Swift Toolkit

[Readium Mobile](https://github.com/readium/mobile) is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.

This toolkit is a modular project, which follows the [Readium Architecture](https://github.com/readium/architecture).

* [`R2Shared`](Sources/Shared) – Shared `Publication` models and utilities
* [`R2Streamer`](Sources/Streamer) – Publication parsers and local HTTP server
* [`R2Navigator`](Sources/Navigator) – Plain `UIViewController` classes rendering publications
* [`ReadiumOPDS`](Sources/OPDS) – Parsers for OPDS catalog feeds
* [`ReadiumLCP`](Sources/LCP) – Service and models for [Readium LCP](https://www.edrlab.org/readium-lcp/)

A [Test App](TestApp) demonstrates how to integrate the Readium Swift toolkit in your own reading app

## Using Readium

<!--:question: **Find documentation and API reference at [readium.org/kotlin-toolkit](https://readium.org/swift-toolkit)**.-->

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).

The [Test App](TestApp) contains examples on how to use all these dependency managers.

### Swift Package Manager

From Xcode, open **File** > **Add Packages** and use Readium's GitHub repository for the package URL: `https://github.com/readium/swift-toolkit.git`.

You are then free to add one or more Readium libraries to your application. They are designed to work independently.

If you're stuck, find more information at [developer.apple.com](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app).

### Carthage

Add the following to your `Cartfile`:

```
github "readium/swift-toolkit" ~> 2.2.0
```

Then, [follow the usual Carthage steps](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add the Readium libraries to your project.

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.

Refer to the following table to know which dependencies are required for each Readium library.

| | `R2Shared` | `R2Streamer` | `R2Navigator` | `ReadiumOPDS` | `ReadiumLCP` |
|-----------------|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|
| **`R2Shared`** | | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `CryptoSwift` | | :heavy_check_mark: | | | :heavy_check_mark: |
| `DifferenceKit` | | | :heavy_check_mark: | | |
| `Fuzi` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `GCDWebServer` | | :heavy_check_mark: | | | |
| `Minizip` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `SQLite.swift` | | | | | :heavy_check_mark: |
| `SwiftSoup` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `ZIPFoundation` | | | | | :heavy_check_mark: |

### CocoaPods

Add the following `pod` statements to your `Podfile` for the Readium libraries you want to use:

```
pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumShared.podspec'
pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumStreamer.podspec'
pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumNavigator.podspec'
pod 'ReadiumOPDS', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumOPDS.podspec'
pod 'ReadiumLCP', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/2.2.0/Support/CocoaPods/ReadiumLCP.podspec'
```

Take a look at [CocoaPods's documentation](https://guides.cocoapods.org/using/using-cocoapods.html) for more information.

### Local Git Clone

You may prefer to use a local Git clone if you want to contribute to Readium, or if you are using your own fork.

First, add the repository as a Git submodule of your app repository, then checkout the desired branch or tag:

```sh
git submodule add https://github.com/readium/swift-toolkit.git
```

Next, drag and drop the whole `swift-toolkit` folder into your project to import Readium as a Swift Package.

Finally, add the Readium libraries you want to use to your app target from the **General** tab, section **Frameworks, Libraries, and Embedded Content**.

### Building with Readium LCP

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.
22 changes: 0 additions & 22 deletions Sources/LCP/readium-lcp-swift.h

This file was deleted.

22 changes: 0 additions & 22 deletions Sources/Navigator/r2-navigator-swift.h

This file was deleted.

22 changes: 0 additions & 22 deletions Sources/OPDS/readium_opds.h

This file was deleted.

22 changes: 0 additions & 22 deletions Sources/Shared/r2-shared-swift.h

This file was deleted.

18 changes: 0 additions & 18 deletions Sources/Streamer/r2-streamer-swift-Bridging-Header.h

This file was deleted.

22 changes: 0 additions & 22 deletions Sources/Streamer/r2-streamer-swift.h

This file was deleted.

6 changes: 0 additions & 6 deletions PM/Carthage/.xcodegen → Support/Carthage/.xcodegen
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@
../../Sources/LCP/Persistence/Database.swift
../../Sources/LCP/Persistence/Licenses.swift
../../Sources/LCP/Persistence/Transactions.swift
../../Sources/LCP/readium-lcp-swift.h
../../Sources/LCP/Resources
../../Sources/LCP/Resources/en.lproj
../../Sources/LCP/Resources/en.lproj/Localizable.strings
Expand Down Expand Up @@ -7390,7 +7389,6 @@
../../Sources/Navigator/PDF/PDFDocumentView.swift
../../Sources/Navigator/PDF/PDFNavigatorViewController.swift
../../Sources/Navigator/PDF/PDFTapGestureController.swift
../../Sources/Navigator/r2-navigator-swift.h
../../Sources/Navigator/Resources
../../Sources/Navigator/Resources/en.lproj
../../Sources/Navigator/Resources/en.lproj/Localizable.strings
Expand All @@ -7414,7 +7412,6 @@
../../Sources/OPDS/OPDS2Parser.swift
../../Sources/OPDS/OPDSParser.swift
../../Sources/OPDS/ParseData.swift
../../Sources/OPDS/readium_opds.h
../../Sources/OPDS/URLHelper.swift
../../Sources/Shared
../../Sources/Shared/DRM
Expand Down Expand Up @@ -7516,7 +7513,6 @@
../../Sources/Shared/Publication/User Settings
../../Sources/Shared/Publication/User Settings/UserProperties.swift
../../Sources/Shared/Publication/User Settings/UserSettings.swift
../../Sources/Shared/r2-shared-swift.h
../../Sources/Shared/Resources
../../Sources/Shared/Resources/en.lproj
../../Sources/Shared/Resources/en.lproj/Localizable.strings
Expand Down Expand Up @@ -7623,8 +7619,6 @@
../../Sources/Streamer/Parser/PublicationParser.swift
../../Sources/Streamer/Parser/Readium
../../Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift
../../Sources/Streamer/r2-streamer-swift-Bridging-Header.h
../../Sources/Streamer/r2-streamer-swift.h
../../Sources/Streamer/Server
../../Sources/Streamer/Server/PublicationServer.swift
../../Sources/Streamer/Server/WebServerResourceResponse.swift
Expand Down
File renamed without changes.
Loading

0 comments on commit b05597a

Please sign in to comment.