From 25816b996b94eb1bb0516819ea4c9299feedc1e7 Mon Sep 17 00:00:00 2001 From: NikaZhenya Date: Sun, 7 Oct 2018 20:04:08 -0500 Subject: [PATCH] Now it is possible to add images for ebooks --- build.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build.rb b/build.rb index 587c1bb..8e7e9ef 100644 --- a/build.rb +++ b/build.rb @@ -13,11 +13,11 @@ Dir.chdir(File.dirname(__FILE__)) #=> Variables $language = 'en-US' -$mariana = 'Mariana Eguaras\'s blog' +$mariana = 'Mariana Eguaras\' blog' $author_name = 'Nika Zhenya' $author_email = 'nika.zhenya@cliteratu.re' $site_name = 'Publishing is Coding: Change My Mind' -$site_description = 'A broken english version of some ' + $author_name + '\'s entries published in ' + $mariana + '.' +$site_description = $author_name + '\'s entries from ' + $mariana + ' in broken english.' $site_keywords = 'publishing, blog, book, ebook, methodology, foss, libre-software, format, markdown, html, epub, pdf, mobi, latex, tex' $site_link = 'https://blog.cliteratu.re' $site_img = 'icon.png' @@ -145,7 +145,7 @@ def convert_md md 'MD / ' + 'EPUB / ' + 'MOBI / ' + - 'spanish source' + + 'spanish version' + '

' ) else @@ -189,6 +189,13 @@ def convert_md md Dir.mkdir(cover_url + 'img') quiet = `inkscape -z -e #{cover_url}img/cover.png #{cover_url}svg/cover_tmp.svg` + # Copies the images + Dir.glob('../../img/*.*').each do |img| + if File.basename(img) =~ /^e#{File.basename(md)[5..7]}/ + FileUtils.cp(img, cover_url + 'img') + end + end + # Creates the ebooks system("pc-automata -f ../#{html_name} -i #{cover_url}img -c #{cover_url}img/cover.png -s ../../css/core.css -x ../../template/ebooks/xhtml --no-pre --no-analytics --no-ace")