Skip to main content

Add a quick README

ID
48cabde
date
2025-01-26 00:42:51+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
5eb7e0d
message
Add a quick README
changed files
5 files, 43 additions, 2 deletions

Changed files

.gitignore (14 → 20)

diff --git a/.gitignore b/.gitignore
index 4263e06..3bf4a6a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 *.epub
 *.mobi
+
+dist

README.md (532 → 973)

diff --git a/README.md b/README.md
index da6bd77..52fdd0a 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,9 @@
-# README
+# add-cover-to-ao3-epubs
+
+This tool lets you upload an ePub file you’ve downloaded from AO3, and get a new ePub that has a colourful cover image.
+This makes it easy to find your favourite fic if you’re scrolling a grid view.
+
+<img src="screenshot.png">
 
 ## Development
 
@@ -10,3 +15,9 @@ To run tests:
 This will run unit tests in the browser using QUnit.
 This is because the app runs in the browser, and certain things (e.g. `<canvas>`) are much easier to test in a real browser environment than anywhere else.
 You need to use an HTTP server rather than opening the file because it needs to fetch some ZIP files, and that doesn't work over `file://`.
+
+## Deployment
+
+Run the `build.py` script to create the version of the site for deployment.
+
+This inlines the two JavaScript files, so we get a single HTML file which contains the entire tool.

build.py (0 → 603)

diff --git a/build.py b/build.py
new file mode 100755
index 0000000..009a748
--- /dev/null
+++ b/build.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+from pathlib import Path
+
+
+if __name__ == '__main__':
+    out_dir = Path("dist")
+    out_dir.mkdir(exist_ok=True)
+    
+    html = Path("index.html").read_text()
+    html = html.replace(
+        '<script src="static/app.js"></script>',
+        '<script id="app">' + Path("static/app.js").read_text() + '</script>'
+    )
+    html = html.replace(
+        '<script src="static/jszip.min.js"></script>',
+        '<script id="jsmin">' + Path("static/jszip.min.js").read_text() + '</script>'
+    )
+    assert '<script src' not in html
+    
+    (out_dir / "index.html").write_text(html)

index.html (12014 → 12128)

diff --git a/index.html b/index.html
index a97a94b..ad8a7f6 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,8 @@
   <script src="static/app.js"></script>
   <script src="static/jszip.min.js"></script>
 
+  <title>Add cover images to AO3 ePubs</title>
+
   <style>
     :root {
       --max-width: 42rem;
@@ -116,13 +118,18 @@
       opacity: 0.4;
       filter: grayscale(100%);
     }
+
+    noscript {
+      color: red;
+      font-weight: bold;
+    }
   </style>
 </head>
 
 <body>
   <main>
     <h1>
-      Add cover image to AO3 ePubs
+      Add cover images to AO3 ePubs
       <span class="version">v1.0</span>
     </h1>
 

screenshot.png (0 → 198732)

diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..4b2c0a7
Binary files /dev/null and b/screenshot.png differ