Removes wok-prime, runs RoW and mythwalker in bootstrap

This commit is contained in:
Nemo 2020-08-15 13:01:18 +05:30
parent afc3286fa7
commit 66d3b0e06b
4 changed files with 30 additions and 100 deletions

View File

@ -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
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

@ -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 Sandersons 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 <https://www.tor.com/features/series/the-way-of-kings-reread-on-torcom/>.
## Words of Radiance Reread
Welcome to the reread of Brandon Sandersons second Stormlight Archive series book Words of Radiance! This reread will be a collaborative effort between Tor.coms 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 <https://www.tor.com/series/words-of-radiance-reread-on-torcom/>
## Edgedancer Reread
Join Alice Arneson and Lyndsey Luther for a reread of Brandon Sandersons 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 <https://www.tor.com/series/edgedancer-reread-brandon-sanderson/>
## Way of Kings: Prime
@ -87,6 +87,16 @@ More details at <https://www.hollywoodreporter.com/heat-vision/dark-one-excerpt-
The script generates a CBZ file.
# Warbreaker Prime: Mythwalker
Below description from [Sanderson's website](https://www.brandonsanderson.com/warbreaker-prime-mythwalker-prologue/), written by Peter:
>When Brandon shelved Mythwalker in August 2001 because he felt it wasnt working (one of its issues was that it felt clichéd, but there are other issues that Ill 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 Brandons 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

View File

@ -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 \

View File

@ -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 = '<html lang=en><head><title>Way of Kings Prime</title></head><body>'
(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 += "<h1>#{links[i - 1][0...-1]}</h1>" + page.inner_html
end
html += '</body></html>'
File.open('books/wok-prime.html', 'w') { |file| file.write(html) }
puts '[html] Generated HTML file'
generate('wok-prime', :all)