This repository contains the book Software Engineering at Google to be read on a Kindle. Not the ideal result but it's something.
Note Maybe there is a way to tell
pandoc
to recursively read everything in a URL and convert it to an epub. If you know how to do it, contribute and claim your 🍺!
- wget
- Docker
- Calibre
-
I extracted the main links like parts, chapters, preface, conclusion, etc.
ol = document.getElementsByTagName("ol")[0]; links = Array.from(ol.children).map((a) => a.children[0].href);
-
Copied the links to a text file (links.txt). I did it by copying object in the Firefox console.
-
This ends up being the input for
wget
, with which we download all the pages of the book with images, css, etc.```shell # -p - get all the images needed to display the page # --convert-links - convert links to be relative wget -p --convert-links -i links.txt # At the end you should see something like this lsd --tree --depth=5 . ├── abseil.io │ ├── cdn-cgi -> You can delete this │ │ └── scripts │ │ └── 5c5dd728 │ │ └── cloudflare-static │ └── resources │ └── swe-book │ └── html │ ├── ch01.html │ ├── chN.html ```
-
Use
pandoc
to download the book index with the --embed-resources option so that the result is self-contained . Possibly it can be done withwget
Note Noted the index was a bit wrong so I copied it from the website (everything inside
<nav>
) and pasted into index.html.
```shell
docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/latex -s -f html https://abseil.io/resources/swe-book/html/toc.html -t html --embed-resources -o index.html
```
- Moved the
index.html
file along with the chapters to/abseil.io/resources/swe-book/html/
- Using Calibre, I added a book, selected the
index.html
file and converted it to EPUB and from there to AZW3.