From 29e0ed13f596c6bcd5a2f7d0046c5c81717b56de Mon Sep 17 00:00:00 2001 From: tamarr Date: Mon, 19 Nov 2018 18:59:52 +0200 Subject: allow right to left styling of docs (#3) * adding rtl css main file and logic to use --- guides/rails_guides/generator.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'guides/rails_guides') diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb index c83538ad48..5eee15b2ec 100644 --- a/guides/rails_guides/generator.rb +++ b/guides/rails_guides/generator.rb @@ -17,13 +17,14 @@ module RailsGuides class Generator GUIDES_RE = /\.(?:erb|md)\z/ - def initialize(edge:, version:, all:, only:, kindle:, language:) + def initialize(edge:, version:, all:, only:, kindle:, language:, rtl: false) @edge = edge @version = version @all = all @only = only @kindle = kindle @language = language + @rtl = rtl if @kindle check_for_kindlegen @@ -116,6 +117,10 @@ module RailsGuides def copy_assets FileUtils.cp_r(Dir.glob("#{@guides_dir}/assets/*"), @output_dir) + if (@rtl) + FileUtils.rm(Dir.glob("#{@output_dir}/stylesheets/main.css")) + FileUtils.mv("#{@output_dir}/stylesheets/main.rtl.css", "#{@output_dir}/stylesheets/main.css") + end end def output_file_for(guide) @@ -198,7 +203,7 @@ module RailsGuides def check_fragment_identifiers(html, anchors) html.scan(/ Levenshtein.distance(fragment_identifier, b) } -- cgit v1.2.3