From 1f82d4ff98c3a5a8863ffb9c9c1fcf32046505cb Mon Sep 17 00:00:00 2001 From: Sergey Kuznetsov Date: Sat, 23 Jan 2021 21:41:39 -0800 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=BA=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0?= =?UTF-8?q?=D1=80=D1=82=D0=BD=D1=8B=D1=85=20=D0=B0=D1=82=D1=80=D0=B8=D0=B1?= =?UTF-8?q?=D1=83=D1=82=D0=BE=D0=B2=20=D0=B8=20=D0=B4=D0=B0=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Table of Context → Содержание Figure → Рисунок Version → Версия и др. --- Rakefile | 16 ++++++++++++++-- progit.asc | 1 - 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index fb79a8c7..2d8263c2 100644 --- a/Rakefile +++ b/Rakefile @@ -10,12 +10,24 @@ namespace :book do task :build do begin + lang = "ru" + begin + l10n_text = open("https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/data/locale/attributes-#{lang}.adoc").read + File.open('attributes.asc', 'w') { |file| file.puts l10n_text} + progit_txt = File.open('progit.asc').read + if not progit_txt.include?("attributes.asc") + progit_txt.gsub!('include::book/license.asc', "include::attributes.asc[]\ninclude::book/license.asc") + File.open('progit.asc', 'w') {|file| file.puts progit_txt } + end + rescue + end version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp if version_string.empty? version_string = '0' end - date_string = Time.now.strftime("%Y-%m-%d") - params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}'" + date_string = Time.now.strftime("%d-%m-%Y") + params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang=#{lang} " + puts "Generating contributors list" `git shortlog -s | grep -v -E "(Straub|Chacon|dependabot)" | cut -f 2- | column -c 96 > book/contributors.txt` diff --git a/progit.asc b/progit.asc index 43687db3..ede99752 100644 --- a/progit.asc +++ b/progit.asc @@ -8,7 +8,6 @@ $$VERSION$$, $$DATE$$ :toclevels: 2 :pdf-page-size: A4 :front-cover-image: image:book/cover.png[width=1050,height=1600] -:figure-caption: Рисунок ifdef::ebook-format[:leveloffset: -1]