Make Docker official, and move ruby instructions

This commit is contained in:
Nemo 2019-12-31 00:04:36 +05:30
parent e7288d6cb3
commit ddb9cae791
2 changed files with 79 additions and 72 deletions

78
HACKING.md Normal file
View File

@ -0,0 +1,78 @@
# Local Development
If you are interested in just generating the books, follow the guide on the README instead.
## Requirements
- Ruby
- Nokogiri gem installed (`gem install nokogiri`)
- `pandoc` installed and available (for all 3 formats)
- Paru gem installed (`gem install paru`)
- (mobi only): `ebook-convert` (from calibre) available to generate the mobi file
- (pdf) `wkhtmltopdf` for converting html to pdf
- (pdf) `pdftk` to stitch the final PDF file
### Notes
- The final 2 tools can be skipped if you don't care about the PDF generation.
- You can also skip calibre if you only want the EPUB file.
- Edit the last line in `*.rb` to `:epub` / `:mobi`, `:pdf` to only trigger the specific builds
- Windows users need wget. Download the latest wget.exe from https://eternallybored.org/misc/wget/ and add it's directory to the PATH environment variable or put it directly in C:\Windows.
## Generation
### Oathbringer
After downloading the repo and installing the requirements, just run
ruby oathbringer.rb
All the generated files will be saved with the filename `Oathbringer.{epub|pdf|mobi|html}`
### Way of Kings Reread
To generate the book:
ruby wok-reread.rb
All the generated files will be saved with the filename `wok-reread.{epub|pdf|mobi|html}`
### Words of Radiance Reread
To generate the book:
ruby wor-reread.rb
All the generated files will be saved with the filename `books/wok-reread.{epub|pdf|mobi|html}`. This generation might take a while because it contains a lot of images. It doesn't have the best possible index either, but is still pretty readable.
### Edgedancer Reread
To generate the book:
ruby edgedancer-reread.rb
All the generated files will be saved with the filename `books/edgedancer-reread.{epub|pdf|mobi|html}`. This generation might take a while because it contains a lot of images. It doesn't have the best possible index either, but is still pretty readable.
### Way of Kings Prime
ruby wok-prime.rb
All the generated files will be saved with the filename `books/wok-prime.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML.
### Oathbringer Reread
ruby oathbringer-reread.rb
All the generated files will be saved with the filename `books/oathbringer-reread.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML.
### Skyward
ruby skyward.rb
All the generated files will be saved with the filename `books/skyward.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML.
### Defending Elysium
This is just lazily using Pandoc, since there is just a single page.
pandoc -t epub https://brandonsanderson.com/defending-elysium/ -o defending-elysium.epub --epub-cover-image=covers/defending-elysium.jpg --epub-metadata=metadata/defending-elysium.xml

View File

@ -73,22 +73,7 @@ More details at https://brandonsanderson.com/defending-elysium/. Annotations at
## Requirements
Either [Docker](https://docs.docker.com/install/) installed or the following setup:
- Ruby
- Nokogiri gem installed (`gem install nokogiri`)
- `pandoc` installed and available (for all 3 formats)
- Paru gem installed (`gem install paru`)
- (mobi only): `ebook-convert` (from calibre) available to generate the mobi file
- (pdf) `wkhtmltopdf` for converting html to pdf
- (pdf) `pdftk` to stitch the final PDF file
### Notes
- The final 2 tools can be skipped if you don't care about the PDF generation.
- You can also skip calibre if you only want the EPUB file.
- Edit the last line in `*.rb` to `:epub` / `:mobi`, `:pdf` to only trigger the specific builds
- Windows users need wget. Download the latest wget.exe from https://eternallybored.org/misc/wget/ and add it's directory to the PATH environment variable or put it directly in C:\Windows.
[Docker](https://docs.docker.com/install/) installed.
## Generation
@ -111,62 +96,6 @@ wor-reread
If none is passed, all books will be generated. The entire build (for all books combined) roughly takes 15 minutes on a single core system (excluding the Docker pull).
## Oathbringer
After downloading the repo and installing the requirements, just run
ruby oathbringer.rb
All the generated files will be saved with the filename `Oathbringer.{epub|pdf|mobi|html}`
## Way of Kings Reread
To generate the book:
ruby wok-reread.rb
All the generated files will be saved with the filename `wok-reread.{epub|pdf|mobi|html}`
## Words of Radiance Reread
To generate the book:
ruby wor-reread.rb
All the generated files will be saved with the filename `books/wok-reread.{epub|pdf|mobi|html}`. This generation might take a while because it contains a lot of images. It doesn't have the best possible index either, but is still pretty readable.
## Edgedancer Reread
To generate the book:
ruby edgedancer-reread.rb
All the generated files will be saved with the filename `books/edgedancer-reread.{epub|pdf|mobi|html}`. This generation might take a while because it contains a lot of images. It doesn't have the best possible index either, but is still pretty readable.
## Way of Kings Prime
ruby wok-prime.rb
All the generated files will be saved with the filename `books/wok-prime.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML.
## Oathbringer Reread
ruby oathbringer-reread.rb
All the generated files will be saved with the filename `books/oathbringer-reread.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML.
## Skyward
ruby skyward.rb
All the generated files will be saved with the filename `books/skyward.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML.
## Defending Elysium
This is just lazily using Pandoc, since there is just a single page.
pandoc -t epub https://brandonsanderson.com/defending-elysium/ -o defending-elysium.epub --epub-cover-image=covers/defending-elysium.jpg --epub-metadata=metadata/defending-elysium.xml
## Extra
If you'd like to see any other books covered here, please [create an issue](https://github.com/captn3m0/cosmere-books/issues/new), or reach out to me: <https://captnemo.in/contact/>