Skip to content

Commit 774bd9d

Browse files
committed
Added a shell script to generate epubs and added a reference to the contribution description
1 parent b4cc32f commit 774bd9d

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ This page explains how to write new tests.
7878
1. Run the EPUB through [EPUBCheck](https://www.w3.org/publishing/epubcheck/) to ensure you didn't make any silly mistakes.
7979
Fix if you did. Your EPUBCheck version must be up to date; the program evolves with the specification…
8080

81-
2. Create a pull request for your test change, including the uncompressed folder. Please
81+
2. Create a pull request for your test change with the uncompressed folder. Please
8282
ensure the PR's description clearly indicates which statement is being tested.
83-
It is not strictly necessary to upload the generated epub files; they will be regenerated
84-
automatically on GitHub anyway. Await review.
83+
The generated epub file should not be uploaded to the repository; it will be regenerated
84+
automatically on GitHub. Await review.
8585

8686
3. Once the pull request has been merged, fork the repo for the spec you are testing —
8787
[EPUB 3.4](https://github.com/w3c/epub-specs/blob/main/epub34/authoring/index.html) or
@@ -97,7 +97,6 @@ This page explains how to write new tests.
9797
<a href="https://www.w3.org/TR/epub-34/#sec-xhtml">XHTML Content
9898
Documents</a> [[EPUB-34]].
9999
</p>
100-
101100
...
102101

103102
<p id="confreq-rs-epub3-images"
@@ -221,10 +220,13 @@ Note that the value of the `dcterms:isReferencedBy` has been changed as well; in
221220

222221
# Running tests
223222

224-
Running tests mean loading each test, as a separate EPUB Publication, and check whether the reading systems fulfills the requirement of that specific tests. The results are collected in an implementation report file and uploaded to the test repository.
223+
Running tests mean loading each test as a separate EPUB Publication, and check whether the reading systems fulfills the requirement of that specific tests. The results are collected in an implementation report file and uploaded to the test repository.
225224

226225
To make the running of the tests easier, a [test catalogue file](https://w3c.github.io/epub-tests/opds/opds.json) is generated using the [OPDS](https://drafts.opds.io/opds-2.0.html) format. Several reading systems understand this catalogue format, and can upload the full test suite easily.
227226

227+
Alternatively, the test repository can be cloned, and downloaded to the tester's machine. To make the testing step easier, there is a `generateEpubs.sh`
228+
script in the `tests` folder of repository that will generate an epub version of each test.
229+
228230
## Implementation report files
229231

230232
The `reports` directory contains implementation reports in form of JSON files, one per reading system. The structure of the

tests/generateEpubs.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
# Loop through all subdirectories
4+
for dir in `ls` ; do
5+
# Check if it's actually a directory (handles case where no subdirs exist)
6+
if [ -d "$dir" ]; then
7+
echo "====== Generating epub for $dir ======"
8+
(cd $dir; zip -X ../$dir.epub mimetype; zip -rDX9 ../$dir.epub * -x mimetype -x \*.DS_STORE)
9+
fi
10+
done
11+

0 commit comments

Comments
 (0)