Skip to content

Commit ec93276

Browse files
committed
refactored everything & fixed links
1 parent 61ed326 commit ec93276

File tree

6 files changed

+371
-143
lines changed

6 files changed

+371
-143
lines changed

.github/workflows/pages.yml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Upload to GitHub Pages
32
on:
43
push:
@@ -10,40 +9,38 @@ jobs:
109
upload-to-pages:
1110
runs-on: ubuntu-latest
1211
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v2
1314

14-
- name: Check out repository
15-
uses: actions/checkout@v2
15+
- name: Download service manual
16+
run: |
17+
curl http://norcalmotorsports.org/users/bryan/mods/EVO/tech/ServiceManuals/Evo_X_Service_Manual.zip -o manual.zip
1618
17-
- name: Download service manual
18-
run: |
19-
curl http://norcalmotorsports.org/users/bryan/mods/EVO/tech/ServiceManuals/Evo_X_Service_Manual.zip -o manual.zip
19+
- name: Unzip service manual
20+
uses: montudor/action-zip@v1.0.0
21+
with:
22+
args: unzip -qq manual.zip -d extracted
2023

21-
- name: Unzip service manual
22-
uses: montudor/action-zip@v1.0.0
23-
with:
24-
args: unzip -qq manual.zip -d extracted
24+
- name: Copy into input
25+
run: |
26+
mkdir input
27+
cp -r extracted/Evo\ X\ Service\ Manual/* input
28+
sudo chown -R $USER input
29+
sudo chown -R $USER output
30+
sudo chmod -R 777 input
31+
sudo chmod -R 777 output
2532
26-
- name: Copy into input
27-
run: |
28-
mkdir input
29-
cp -r extracted/Evo\ X\ Service\ Manual/* input
30-
sudo chown -R $USER input
31-
sudo chown -R $USER output
32-
sudo chmod -R 777 input
33-
sudo chmod -R 777 output
33+
- name: Install Node
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: "20.x"
3437

35-
- name: Install Node
36-
uses: actions/setup-node@v3
37-
with:
38-
node-version: '19.x'
39-
40-
- name: Build
41-
run: |
42-
npm install
43-
npm run start
44-
npm run google
38+
- name: Build
39+
run: |
40+
npm install
41+
npm run start
4542
46-
- name: Deploy
47-
uses: JamesIves/github-pages-deploy-action@v4
48-
with:
49-
folder: output
43+
- name: Deploy
44+
uses: JamesIves/github-pages-deploy-action@v4
45+
with:
46+
folder: output

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ package-lock.json
22
node_modules
33
input/*
44
output/*
5-
!output/index.html
6-
!output/google/index.html
5+
!output/index.html

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
Fully featured, web-safe edition of the entire manual. Made here, for your viewing pleasure. No downloads, no broken links.
44

5-
### [View the manual here](https://colecrouter.github.io/evo-manual-fix/)
5+
## [View the manual here](https://colecrouter.github.io/evo-manual-fix/)
66

7-
#### [Mobile link](https://colecrouter.github.io/evo-manual-fix/google/)
7+
## [Offline download](https://github.com/colecrouter/evo-manual-fix/releases/download/offline/PDFs.zip)
88

9-
<br />
9+
I got tired of downloading all 61 PDFs on every single device I own, so I wrote a script to fix the links in `INDEX.pdf`, and wrote an action to upload the files to GitHub Pages.
1010

11-
### [Offline download](https://github.com/colecrouter/evo-manual-fix/releases/download/offline/PDFs.zip)
11+
## Link base URL
1212

13-
<br />
13+
The build script can generate absolute links (better mobile compatibility) by setting `EVO_MANUAL_BASE_URL`.
1414

15-
I got tired of downloading all 61 PDFs on every single device I own, so I wrote a script to fix the links in `INDEX.pdf`, and wrote an action to upload the files to GitHub Pages.
15+
- Example: `EVO_MANUAL_BASE_URL=https://colecrouter.github.io/evo-manual-fix/`
16+
- If not set, the script will infer a GitHub Pages URL when running in GitHub Actions, otherwise it falls back to relative `./` links.
1617

1718
## Credits
1819

19-
Manual taken from here: http://norcalmotorsports.org/users/bryan/mods/EVO/tech/ServiceManuals/Evo_X_Service_Manual.zip
20+
Manual taken from here: <http://norcalmotorsports.org/users/bryan/mods/EVO/tech/ServiceManuals/Evo_X_Service_Manual.zip>

output/google/index.html

Lines changed: 0 additions & 2 deletions
This file was deleted.

package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
2-
"name": "evo-manual-fix",
3-
"version": "1.0.0",
4-
"description": "Fix PDF links in Mitsubishi Evo X manual INDEX page",
5-
"main": "src/index.js",
6-
"type": "module",
7-
"scripts": {
8-
"start": "node src/index.js -build legacy",
9-
"google": "node src/index.js -build legacy google"
10-
},
11-
"author": "Cole Crouter",
12-
"license": "ISC",
13-
"dependencies": {
14-
"pdf-lib": "^1.17.1",
15-
"pdfjs-dist": "^3.5.141"
16-
}
17-
}
2+
"name": "evo-manual-fix",
3+
"version": "1.0.0",
4+
"description": "Fix PDF links in Mitsubishi Evo X manual INDEX page",
5+
"main": "src/index.js",
6+
"type": "module",
7+
"scripts": {
8+
"start": "node src/index.js -build legacy"
9+
},
10+
"author": "Cole Crouter",
11+
"license": "ISC",
12+
"dependencies": {
13+
"pdf-lib": "^1.17.1",
14+
"pdfjs-dist": "^3.5.141"
15+
}
16+
}

0 commit comments

Comments
 (0)