mirror of
https://github.com/captn3m0/never-say-you-cant-survive.git
synced 2024-09-20 15:57:12 +00:00
Adds docker build support
This commit is contained in:
parent
dc9c720509
commit
192a56960d
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
||||
html/*
|
||||
chapters/*
|
||||
vendor
|
||||
*.epub
|
||||
*.html
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
vendor/
|
||||
*.epub
|
||||
html/*
|
||||
chapters/*
|
||||
*.html
|
||||
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
LABEL maintainer="ebooks@captnemo.in"
|
||||
|
||||
ARG DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
pandoc \
|
||||
ruby \
|
||||
wget \
|
||||
zlib1g-dev bundler \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY . /src/
|
||||
|
||||
RUN bundle install
|
||||
|
||||
ENTRYPOINT ["/src/generate.sh"]
|
||||
|
||||
VOLUME ["/output"]
|
@ -33,6 +33,7 @@ Your generated ebook should be available at never-say-you-cant-survive.epub
|
||||
<li>Embrace Uncertainty: The Joy of Making a Giant Mess</li>
|
||||
<li>Everything Is Broken! What Should I Write About?</li>
|
||||
</ol></details>
|
||||
|
||||
<details><summary>Section II - What’s A Story, and How Do You Find One?</summary><ol>
|
||||
<li>Don’t Be Afraid to Go on Lots of First Dates With Story Ideas</li>
|
||||
<li>The Secret to Storytelling? Just One Good Scene, and Then Another, and Another.</li>
|
||||
@ -41,6 +42,7 @@ Your generated ebook should be available at never-say-you-cant-survive.epub
|
||||
<li>How to Tell a Thrilling Story Without Breaking Your Own Heart</li>
|
||||
<li>The Ending Is The Beginning</li>
|
||||
</ol></details>
|
||||
|
||||
<details><summary>Section III - Your Feelings are Valid—and Powerful</summary><ol>
|
||||
<li>Hold On To Your Anger. It’s a Storytelling Goldmine</li>
|
||||
<li>People Are Only as Interesting as Their Relationships</li>
|
||||
@ -48,12 +50,16 @@ Your generated ebook should be available at never-say-you-cant-survive.epub
|
||||
<li>Revision Is the Process of Turning Fake Emotion Into Real Emotion</li>
|
||||
<li>Twelve Ways to Keep the Fun of Writing Alive</li>
|
||||
</ol></details>
|
||||
|
||||
<details><summary>Section IV - What We Write About When We Write About Spaceships</summary><ol>
|
||||
<li>How to Write a Political Story Without Falling on Your Face</li>
|
||||
<li>Good Worldbuilding Shows How Things Could Be Different</li>
|
||||
<li>The Unexamined Story Is Not Worth Writing</li>
|
||||
<li>Weirdness Gives Me the Strength To Keep Going</li>
|
||||
<li>When Is It Okay To Write About Someone Else’s Culture or Experience?</li>
|
||||
</ol></details>
|
||||
|
||||
<details><summary>Section V: How to Use Writerly Tricks to Gain Unstoppable Powers</summary><ol>
|
||||
<li>Find Your Voice and Make It LOUD</li>
|
||||
</ol></details>
|
||||
|
||||
|
@ -52,7 +52,9 @@ for i in Dir.glob('html/*.html')
|
||||
end
|
||||
end
|
||||
fn = File.basename(i)
|
||||
File.write("chapters/#{fn}", html)
|
||||
File.open("chapters/#{fn}", "w:UTF-8") do |f|
|
||||
f.write html
|
||||
end
|
||||
end
|
||||
|
||||
html = ""
|
||||
@ -61,8 +63,7 @@ File.open("urls.txt").each_with_index do |url, index|
|
||||
unless section_headers[index].nil?
|
||||
html += "<h1>#{section_headers[index]}</h1>\n\n"
|
||||
end
|
||||
html += File.read("chapters/#{title}.html")
|
||||
html += "\n\n"
|
||||
html += File.open("chapters/#{title}.html", "r:UTF-8", &:read)
|
||||
end
|
||||
|
||||
File.write("never-say-you-cant-survive.html", html)
|
||||
|
@ -19,4 +19,8 @@ do
|
||||
wget --no-clobber --no-verbose --output-document="html/$FILENAME.html" --timeout=10 "$line"
|
||||
done < "$INPUT_FILE"
|
||||
|
||||
bundle exec ruby generate.rb
|
||||
bundle exec ruby generate.rb
|
||||
|
||||
if [ -f /.dockerenv ]; then
|
||||
cp never-say-you-cant-survive.epub /output
|
||||
fi
|
Loading…
Reference in New Issue
Block a user