Skip to content

Commit 9b40627

Browse files
lovrozitnikLovro Zitnikchocolatkey
authored
docs: fix manifest path and filesystem scheme in serve.md (#109)
Co-authored-by: Lovro Zitnik <lovro@neostudio.si> Co-authored-by: Henry <chocolatkey@gmail.com>
1 parent a6e026b commit 9b40627

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

docs/serve.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Many services provide an S3 compatible API. The `serve` command is fully compati
3535
```sh
3636
readium serve -s s3 --s3-endpoint https://example.com/endpoint --s3-access-key {access-key} --s3-secret-key {secret-key}
3737
```
38-
38+
3939
### Required flags
4040

4141
| Flag | Description |
@@ -112,29 +112,41 @@ These settings can be overriden using dedicated flags:
112112

113113
## Fetching a manifest for a publication
114114

115-
In its current version, the `serve` command relies on a single path from which all manifests can be fetched: `/{base64url-encoded-path-to-file}/manifest.json`.
115+
In its current version, the `serve` command relies on a single path from which all manifests can be fetched: `/webpub/{base64url-encoded-path-to-file}/manifest.json`.
116116

117117
Each scheme supports a dedicated URI scheme:
118118

119119
| Scheme | URI scheme | Path |
120120
| ------ | ---------- | ---- |
121-
| Filesystem | `file://` | Path to a given file relative to the path provided in `--file-directory`.
121+
| Filesystem | *(none)* | Path to a given file relative to the path provided in `--file-directory`. Used directly without a URI scheme prefix. |
122122
| HTTP | `http://` | URL |
123123
| HTTPS | `https://` | URL |
124124
| S3 | `s3://` | Path to a bucket, followed by a path to a file (key) in that bucket: `s3://{bucket}/{path-to-file}` |
125125
| Google Cloud Storage | `gs://` | Path to a bucket, followed by a path to a file (key) in that bucket: `gs://{bucket}/{path-to-file}` |
126126

127-
Once calculated, the URI scheme and path to the file have to be [base64url](https://datatracker.ietf.org/doc/html/rfc4648#section-5) encoded in order to generate a path to a manifest.
127+
Once calculated, the path (with its URI scheme, where applicable) has to be [base64url](https://datatracker.ietf.org/doc/html/rfc4648#section-5) encoded (without padding) in order to generate a path to a manifest.
128128

129-
### Example
129+
### Examples
130+
131+
#### Filesystem
132+
133+
```sh
134+
readium serve --file-directory /srv/epubs/
135+
```
136+
137+
* I'd like to stream `example_epub.epub` from a local directory `/srv/epubs/`
138+
* We base64url-encode (without padding) the path relative to `--file-directory`, which in this case is just the filename `example_epub.epub` → `ZXhhbXBsZV9lcHViLmVwdWI`
139+
* The manifest for that file can be accessed at <http://localhost:15080/webpub/ZXhhbXBsZV9lcHViLmVwdWI/manifest.json>
140+
141+
#### HTTPS
130142
131143
```sh
132144
readium serve -s gs,https
133145
```
134146
135147
* I'd like to stream <https://github.com/IDPF/epub3-samples/releases/download/20230704/accessible_epub_3.epub>
136-
* Which can be base64url encoded to `aHR0cHM6Ly9naXRodWIuY29tL0lEUEYvZXB1YjMtc2FtcGxlcy9yZWxlYXNlcy9kb3dubG9hZC8yMDIzMDcwNC9hY2Nlc3NpYmxlX2VwdWJfMy5lcHVi`
137-
* The manifest for that file can be accessed at <http://localhost:15080/aHR0cHM6Ly9naXRodWIuY29tL0lEUEYvZXB1YjMtc2FtcGxlcy9yZWxlYXNlcy9kb3dubG9hZC8yMDIzMDcwNC9hY2Nlc3NpYmxlX2VwdWJfMy5lcHVi/manifest.json>
148+
* Which can be base64url encoded (without padding) to `aHR0cHM6Ly9naXRodWIuY29tL0lEUEYvZXB1YjMtc2FtcGxlcy9yZWxlYXNlcy9kb3dubG9hZC8yMDIzMDcwNC9hY2Nlc3NpYmxlX2VwdWJfMy5lcHVi`
149+
* The manifest for that file can be accessed at <http://localhost:15080/webpub/aHR0cHM6Ly9naXRodWIuY29tL0lEUEYvZXB1YjMtc2FtcGxlcy9yZWxlYXNlcy9kb3dubG9hZC8yMDIzMDcwNC9hY2Nlc3NpYmxlX2VwdWJfMy5lcHVi/manifest.json>
138150

139151
## Additional services
140152

@@ -145,4 +157,4 @@ In its current version, the CLI provides the following services:
145157
* [Position List](https://github.com/readium/architecture/tree/master/models/locators/positions)
146158
* Content Iterator
147159

148-
We expect to deprecate the Content Iterator service in the near future.
160+
We expect to deprecate the Content Iterator service in the near future.

0 commit comments

Comments
 (0)