Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
publications/*
*.old
dist/
*.old
49 changes: 0 additions & 49 deletions .goreleaser.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Removed

- The `cmd` folder has been removed, along with the `rwp` command and its command-line utilities including the web server. Please use [the new Readium CLI repo](https://github.com/readium/cli) as a replacement. The docker build and executable releases are also now migrated to that repository, and the `rwp` verbiage is now `readium`.

### Added

- Remote streaming of publications is now supported. Sources include HTTP servers (capable of byte range requests), Amazon S3 and S3-compatible object storage, Google Cloud Storage (GCS)
- Added a new helper to transform fetchers and resources into interfaces compatible with Go's `fs.FS` and `fs.File`
- Add support for `hash` property in links, with a list of recognized algorithms and utility functions
- A new `analyzer` package has been added that supports image analysis. We're not 100% sure this will remain in the toolkit, it could migrate to the cli repository.

### Changed

- In order to support remote streaming, a lot of APIs have been altered to accept a `context.Context` as the first parameter, to provide implementors with the ability to e.g. cancel a request to fetch a resource.
- `ReadAsString`, `ReadAsJSON`, and `ReadAsXML` functions have been removed from `Resource` and are instead available as helper functions.

## [0.8.1] - 2025-02-24

### Changed
Expand Down
63 changes: 0 additions & 63 deletions Dockerfile

This file was deleted.

File renamed without changes.
15 changes: 0 additions & 15 deletions Makefile

This file was deleted.

62 changes: 2 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,5 @@
# Readium Go Toolkit

More documentation coming soon! Things are changing too quickly right now.
**Looking for the `rwp` command-line tools? Checkout the new [Readium CLI](https://github.com/readium/cli) repo!**

For development, run `go run cmd/server/main.go` to start the server, which by default listens on `127.0.0.1:5080`. Check out the [example configuration file](https://github.com/readium/go-toolkit/blob/master/cmd/server/configs/config.local.toml.example) for configuration options.

## Command line utility

The `rwp` command provides utilities to parse and generate Web Publications.

To install `rwp` in `~/go/bin`, run `make install`. Use `make build` to build the binary in the current directory.

### Generating a Readium Web Publication Manifest

The `rwp manifest` command will parse a publication file (such as EPUB, PDF, audiobook, etc.) and build a Readium Web Publication Manifest for it. The JSON manifest is
printed to stdout.

Examples:

* Print out a compact JSON RWPM.
```sh
rwp manifest publication.epub
```
* Pretty-print a JSON RWPM using two-space indent.
```sh
rwp manifest --indent " " publication.epub
```
* Extract the publication title with `jq`.
```sh
rwp manifest publication.epub | jq -r .metadata.title
```

#### Accessibility inference

`rwp manifest` can infer additional accessibility metadata when they are missing, with the `--infer-a11y` flag. It takes one of the following arguments:

| Option | Description |
|------------------|--------------------------------------------------------------------------------------------------------|
| `no` (*default*) | No accessibility metadata will be inferred. |
| `merged` | Accessibility metadata will be inferred and merged with the authored ones in `metadata.accessibility`. |
| `split` | Accessibility metadata will be inferred but stored separately in `metadata.inferredAccessibility`. |

```sh
rwp manifest --infer-a11y=merged publication.epub | jq .metadata
```

##### Inferred metadata

| Key | Value | Inferred? |
|-----|-------|-----------|
| `accessMode` | `auditory` | If the publication contains a reference to an audio or video resource (inspect `resources` and `readingOrder` in RWPM) |
| `accessMode` | `visual` | If the publications contains a reference to an image or a video resource (inspect `resources` and `readingOrder` in RWPM) |
| `accessModeSufficient` | `textual` | If the publication is partially or fully accessible (WCAG A or above)<br>Or if the publication does not contain any image, audio or video resource (inspect "resources" and "readingOrder" in RWPM)<br>Or if the only image available can be identified as a cover |
| `feature` | `displayTransformability` | If the publication is fully accessible (WCAG AA or above)<br>:warning: This property should only be inferred for reflowable EPUB files as it doesn't apply to other formats (FXL, PDF, audiobooks, CBZ/CBR). |
| `feature` | `printPageNumbers` | If the publications contains a page list (check for the presence of a `pageList` collection in RWPM) |
| `feature` | `tableOfContents` | If the publications contains a table of contents (check for the presence of a `toc` collection in RWPM) |
| `feature` | `MathML` | If the publication contains any resource with MathML (check for the presence of the `contains` property where the value is `mathml` in `readingOrder` or `resources` in RWPM) |
| `feature` | `synchronizedAudioText` | If the publication contains any reference to Media Overlays (TBD in RWPM) |

### HTTP streaming of local publications

`rwp serve` starts an HTTP server that serves EPUB, CBZ and other compatible formats from a given directory.
A log is printed to stdout.
More documentation coming soon!
43 changes: 0 additions & 43 deletions cmd/rwp/cmd/helpers/inference.go

This file was deleted.

Loading