From 66d3b0e06b9886f170e3a70d6939a7449ee2e0c9 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 15 Aug 2020 13:01:18 +0530 Subject: [PATCH] Removes wok-prime, runs RoW and mythwalker in bootstrap --- HACKING.md | 8 +++--- README.md | 38 +++++++++++++++--------- bootstrap.sh | 3 +- wok-prime.rb | 81 ---------------------------------------------------- 4 files changed, 30 insertions(+), 100 deletions(-) delete mode 100644 wok-prime.rb diff --git a/HACKING.md b/HACKING.md index 5acd72a..6290e59 100644 --- a/HACKING.md +++ b/HACKING.md @@ -53,11 +53,11 @@ To generate the book: 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 +### Warbreaker Prime: Mythwalker - ruby wok-prime.rb + ruby mythwalker.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. +All the generated files will be saved with the filename `books/mythwalker.{epub|pdf|mobi|html}`. This generation might take a while the script attempts to strip out unnecessary HTML. ### Oathbringer Reread @@ -75,4 +75,4 @@ All the generated files will be saved with the filename `books/skyward.{epub|pdf 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 + 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 diff --git a/README.md b/README.md index 0d94bca..defee80 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,15 @@ Scripts to generate books from the [Cosmere](https://coppermind.net/wiki/Cosmere) using various public sources. Currently supports the following books: 1. Oathbringer (Serialized till Chapter 32) -2. Way of Kings Reread -3. Words of Radiance Reread -4. Edgedancer Reread -5. ~~Way of Kings Prime~~ -6. Oathbringer Reread -7. Skyward (Serialized till Chapter 15) -8. Defending Elysium -9. Dark One (Preview Chapter) -10. Rhythm of War (Serialized publication on tor.com in progress) +1. Way of Kings Reread +1. Words of Radiance Reread +1. Edgedancer Reread +1. Oathbringer Reread +1. Skyward (Serialized till Chapter 15) +1. Defending Elysium +1. Dark One (Preview Chapter) +1. Rhythm of War (Serialized publication on tor.com in progress) +1. Warbreaker Prime: Mythwalker For obvious reasons, the converted ebooks are not part of this repo. You must download and run the script on your own machine to generate the copies. @@ -33,19 +33,19 @@ Tor.com is publishing Oathbringer in serialized form till Chapter 32. This scrip Join Michael Pye (aka The Mad Hatter) and Carl Engle-Laird as they dive into the details of Sanderson’s complex new world of Roshar. -Find out more at https://www.tor.com/features/series/the-way-of-kings-reread-on-torcom/ +Find out more at . ## Words of Radiance Reread Welcome to the reread of Brandon Sanderson’s second Stormlight Archive series book Words of Radiance! This reread will be a collaborative effort between Tor.com’s own editorial assistant Carl Engle-Laird and long-time Tor.com commenter and Sanderson beta-reader Alice Arneson. This new partnership promises to be as potent as that between spren and Radiant. Join them in the Storm Cellar as they evaluate, discuss, question, and generally kibitz their way through the Words of Radiance. -More details at https://www.tor.com/series/words-of-radiance-reread-on-torcom/ +More details at ## Edgedancer Reread Join Alice Arneson and Lyndsey Luther for a reread of Brandon Sanderson’s Cosmere novella, Edgedancer, which fills in some of the details for Lift and Nalan between their appearances in Words of Radiance and the next time we see them in Oathbringer. -More details at https://www.tor.com/series/edgedancer-reread-brandon-sanderson/ +More details at ## Way of Kings: Prime @@ -87,6 +87,16 @@ More details at When Brandon shelved Mythwalker in August 2001 because he felt it wasn’t working (one of its issues was that it felt clichéd, but there are other issues that I’ll discuss following later chapters), he planned to get back to it eventually. +But there were still elements and characters left over in those books that could be used to tell other stories. Warbreaker follows one of the storylines from Mythwalker that was left when the elements used in the Mistborn trilogy were taken out. +But that is not all that Mythwalker is. Its main character and its magic system have not been cannibalized. What you will read here [...] is an interesting story in its own right, even though it has problems. And some of you will be frustrated that the story remains unfinished. + +>So it is probably best to view these chapters just as a window on early Brandon Sanderson, when he tried something and failed. This was the first novel in Brandon’s adult writing career that he started writing but never finished. If you want insight into his creative process, I think this is a great place to look. + ## Requirements [Docker](https://docs.docker.com/install/) installed. @@ -108,16 +118,16 @@ edgedancer-reread oathbringer oathbringer-reread skyward -wok-prime wok-reread wor-reread dark-one row +mythwalker ``` 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). -So if you'd like to get a ebook for the Way of Kings re-read, run the following command: +As an example, you'd like to get a ebook for the Way of Kings re-read, run the following command: docker run --rm --volume "$(pwd):/output" captn3m0/cosmere-books:latest wok-reread diff --git a/bootstrap.sh b/bootstrap.sh index 7a4ca2c..aed14cb 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -8,10 +8,11 @@ if [ -z "$1" ] bundle exec ruby edgedancer-reread.rb bundle exec ruby oathbringer.rb bundle exec ruby oathbringer-reread.rb - bundle exec ruby wok-prime.rb bundle exec ruby wok-reread.rb bundle exec ruby wor-reread.rb bundle exec ruby skyward.rb + bundle exec ruby row.rb + bundle exec ruby mythwalker.rb pandoc -t epub https://brandonsanderson.com/defending-elysium/ \ --output=books/defending-elysium.epub \ --epub-cover-image=covers/defending-elysium.jpg \ diff --git a/wok-prime.rb b/wok-prime.rb deleted file mode 100644 index 71d0405..0000000 --- a/wok-prime.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -require 'date' -require 'fileutils' -require 'nokogiri' -require_relative './methods' - -FileUtils.mkdir_p('wok-prime') - -BASE = 'https://brandonsanderson.com/' - -links = [ - 'the-way-of-kings-prime-jeksonsonvallano/', - 'way-of-kings-prime-chapter-1-dalenar-1/', - 'way-of-kings-prime-chapter-3-merin-1/', - 'way-of-kings-prime-chapter-5-merin-2/', - 'way-of-kings-prime-chapter-12-merin-3/', - 'way-of-kings-prime-chapter-17-merin-4/', - 'way-of-kings-prime-chapter-22-merin-5/', - 'dragonsteel-prime-chapter-25-bridge-four-1/', - 'dragonsteel-prime-chapter-28-bridge-four-2/', - 'dragonsteel-prime-chapter-30-bridge-four-3/', - 'dragonsteel-prime-chapter-31-bridge-four-4/', - 'dragonsteel-prime-chapter-33-bridge-four-5/', - 'dragonsteel-prime-chapter-35-bridge-four-6/', - 'dragonsteel-prime-chapter-37-bridge-four-7/', - 'the-way-of-kings-chapter-13-d/', - 'the-way-of-kings-chapter-15-d/', - 'the-way-of-kings-chapter-16-d/', - 'the-way-of-kings-chapter-18-d/', - 'the-way-of-kings-chapter-20-d/', - 'the-way-of-kings-chapters-23-and-24-d/', - 'the-way-of-kings-chapter-26-d/', - 'the-way-of-kings-chapter-28-d/', - 'the-way-of-kings-early-brainstorms-outlines/', - 'the-way-of-kings-tiens-death-attempt-1/' -] - -episode = 1 - -links.each do |link| - url = BASE + link - puts "Download #{url}" - unless File.exist? "wok-prime/#{episode}.html" - `wget --no-clobber "#{url}" --output-document "wok-prime/#{episode}.html" -o /dev/null` - end - episode += 1 -end - -html = 'Way of Kings Prime' - -(1..(links.length)).each do |i| - complete_html = Nokogiri::HTML(open("wok-prime/#{i}.html")) - page = complete_html.css('.vc_col-sm-7 .vc_column-inner .wpb_content_element .wpb_wrapper')[0] - - ending = false - - begin - page.traverse do |e| - whitelist = %w[p div span article h1 h2 h3 h4 a h5 h6 i text] - blacklist = ['.post-meta', '.addthis_toolbox', '.book-links', 'post-nav'] - e.remove if whitelist.include?(e.name) == false - - blacklist.each do |selector| - page.css(selector).each(&:remove) - end - end - rescue Exception => e - puts e - puts page.class - end - - html += "

#{links[i - 1][0...-1]}

" + page.inner_html -end - -html += '' - -File.open('books/wok-prime.html', 'w') { |file| file.write(html) } -puts '[html] Generated HTML file' - -generate('wok-prime', :all)