From ddb9cae79164508150736ecfc114ed321e43a2fe Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 31 Dec 2019 00:04:36 +0530 Subject: [PATCH] Make Docker official, and move ruby instructions --- HACKING.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 73 +------------------------------------------------- 2 files changed, 79 insertions(+), 72 deletions(-) create mode 100644 HACKING.md diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 0000000..5acd72a --- /dev/null +++ b/HACKING.md @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index f93879b..01e1c0d 100644 --- a/README.md +++ b/README.md @@ -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: