From 380027cd7588c961271f34b7dc189ad7a54b4e8c Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 26 Aug 2017 17:26:08 +0100 Subject: [PATCH] Add script to generate book PDF --- .gitignore | 79 +++++++++++++++++++++++++++++++++++++++-- utils/convert_to_pdf.sh | 10 ++++++ 2 files changed, 86 insertions(+), 3 deletions(-) create mode 100755 utils/convert_to_pdf.sh diff --git a/.gitignore b/.gitignore index 25b78cb..46e77f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,77 @@ -_site -.directory +book.pdf + +# Created by https://www.gitignore.io/api/ruby,linux,jekyll + +### Jekyll ### +_site/ +.sass-cache/ .jekyll-metadata -*~* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Ruby ### +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# End of https://www.gitignore.io/api/ruby,linux,jekyll diff --git a/utils/convert_to_pdf.sh b/utils/convert_to_pdf.sh new file mode 100755 index 0000000..41380de --- /dev/null +++ b/utils/convert_to_pdf.sh @@ -0,0 +1,10 @@ +--- +--- +#!/bin/sh + +oldCWD="$PWD" +cd $(dirname $0) +cd ../en/ + +wkhtmltopdf --print-media-type {% for link in site.data.links_en %}{% if link.link %}{{ link.link }} {% endif %}{% endfor %} out.pdf +mv out.pdf $oldCWD/book.pdf