You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/README.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Developing the Web Almanac
2
2
3
-
The Web Almanac can be developed on macOS, Windows or Linux. It requires Node v16, Python v3.8 and pip to be installed. You can use Docker to avoid manually configuring the development environment.
3
+
The Web Almanac can be developed on macOS, Windows or Linux. It requires Node v20, Python v3.12 and pip to be installed. You can use Docker to avoid manually configuring the development environment.
4
4
It can be quickly deployed as a development container in GitHub Codespaces to develop in cloud:
5
5
[](https://codespaces.new/HTTPArchive/almanac.httparchive.org?quickstart=1)
6
6
@@ -14,7 +14,7 @@ An `.editorconfig` file exists for those using [EditorConfig](https://editorconf
14
14
15
15
Make sure you run the following commands from within the `src` directory by executing `cd src` first.
16
16
17
-
Make sure Python (3.8 or above), pip and NodeJS (v20 or above) are installed on your machine.
17
+
Make sure Python (3.12 or above), pip and NodeJS (v20 or above) are installed on your machine.
18
18
19
19
1. If you don't have virtualenv, install it using pip.
2. Create an isolated Python environment, and install dependencies:
32
32
33
33
```
34
-
virtualenv --python python3.8 .venv
34
+
virtualenv --python python3.12 .venv
35
35
source .venv/bin/activate
36
36
```
37
37
@@ -49,7 +49,7 @@ npm install
49
49
npm run start
50
50
```
51
51
52
-
4. In your web browser, enter the following address: http://127.0.0.1:8080
52
+
4. In your web browser, enter the following address: <http://127.0.0.1:8080>
53
53
54
54
To stop the server run the following:
55
55
@@ -164,9 +164,9 @@ Generating for chapter: pwa for year 2021
164
164
165
165
Authors can delete images and rerun if they want to, to regenerate images.
166
166
167
-
Images will automatically be compressed by our Calibre GitHub Action when uploaded to GitHub, but you can get a lot more compression (about 44% more!) by running them through https://tinypng.com instead (at which point the Calibre Action will usually not find any further compression gains). It's quite simple to drag them up, and download them, so would encourage analysts/authors to take this step.
167
+
Images will automatically be compressed by our Calibre GitHub Action when uploaded to GitHub, but you can get a lot more compression (about 44% more!) by running them through <https://tinypng.com> instead (at which point the Calibre Action will usually not find any further compression gains). It's quite simple to drag them up, and download them, so would encourage analysts/authors to take this step.
168
168
169
-
Running them through https://tinypng.com also has the added advantage of the compression being repeatable each time. So if you are not sure which images you have changed, you can delete them all, regenerate them all, run them through TinyPNG, and then a `git diff` will only show differences on the images that have changed. This will not be the case if you use the Calibre GitHub Action and it will look like all images have changed.
169
+
Running them through <https://tinypng.com> also has the added advantage of the compression being repeatable each time. So if you are not sure which images you have changed, you can delete them all, regenerate them all, run them through TinyPNG, and then a `git diff` will only show differences on the images that have changed. This will not be the case if you use the Calibre GitHub Action and it will look like all images have changed.
170
170
171
171
## Linting files
172
172
@@ -214,6 +214,7 @@ All Finished 📜 🎉!
214
214
```
215
215
216
216
This states that:
217
+
217
218
- On line 25, in position 26 you are using lowercase for keywords (e.g. `as` instead of `AS`) so failed rule L010.
218
219
- Similarly on line 26, position 37.
219
220
- And finally on line 34, position 63 you have an unnecessary comma (e.g. `SELECT a,b, FROM table`) and so failed rule L038. Remove the extra comma.
@@ -244,7 +245,6 @@ Are you sure you wish to attempt to fix these? [Y/n]
244
245
245
246
If you lint again you should see most of the errors are fixed. Note that not all errors can be autofixed and some will require manual intervention but autofixing is useful for the simple errors. So while it's generally OK to run the `fix` command, do run the `lint` command when all clean to make sure the `fix` command didn't miss any issues.
246
247
247
-
248
248
## Generating Ebooks
249
249
250
250
For generating PDFs of the ebook, you need to install Prince. Follow the instructions on [the Prince Website](https://www.princexml.com/) and pdftk.
@@ -318,7 +318,7 @@ prince "http://127.0.0.1:8080/en/2019/ebook?cover&spine=25&pageWidth=148&pageHei
318
318
319
319
Note, similar to above, this will create one extra page at the begining which will need to be removed with a PDF editor to start with a clean page for printing. Please remove this before checking in versions into git.
320
320
321
-
With the print-ready eBook and Cover you can send them to a printer. I used https://www.digitalprintingireland.ie/ before and they were excellent and charge about €35 for a full-colour A5 ebook. Most of the settings above are for them, so tweak them based on your own printer's requirements.
321
+
With the print-ready eBook and Cover you can send them to a printer. I used <https://www.digitalprintingireland.ie/> before and they were excellent and charge about €35 for a full-colour A5 ebook. Most of the settings above are for them, so tweak them based on your own printer's requirements.
322
322
323
323
## Deploying changes
324
324
@@ -360,13 +360,14 @@ npm run stage -- -s 20211111t105151
360
360
361
361
To deploy the site to production run the following:
362
362
363
-
_Make sure you have updated the timestamps and generated the ebooks PDFs first in the main branch, by running the "Predeploy script" GitHub Action_
363
+
*Make sure you have updated the timestamps and generated the ebooks PDFs first in the main branch, by running the "Predeploy script" GitHub Action*
364
364
365
365
```
366
366
npm run deploy
367
367
```
368
368
369
369
The deploy script will do the following:
370
+
370
371
- Ask you to confirm you've run the pre-deploy script via GitHub Actions
docker container run --rm -it -v "$PWD":/app -p 8080:8080 webalmanac
400
401
```
401
402
402
-
3. Open http://localhost:8080 in your web browser to access the site. You can kill the server when it is no longer needed using `Ctrl+C`.
403
+
3. Open <http://localhost:8080> in your web browser to access the site. You can kill the server when it is no longer needed using `Ctrl+C`.
403
404
404
405
4. Make changes in the code using any text editor and run tests (need to build the image again if any Python or Node dependencies are changed):
405
406
@@ -420,7 +421,7 @@ root@[CID]:/app# exit
420
421
6. To customize the image use `PYVER`, `NODEVER`, and `SKIPGC` build arguments to control which versions of Python and Node are used and whether Google Cloud SDK is installed.
0 commit comments