Skip to content

Commit

Permalink
電書協フォーマットへの対応(revison)
Browse files Browse the repository at this point in the history
電書協フォーマットの改造版(v1.1.1以降)に対応(revison)
  • Loading branch information
happynow committed Mar 12, 2024
1 parent 325a65d commit de42514
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/aozoraepub3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ def clear_log
end
attr_reader :updated_file_paths, :copied_file_paths

def self.get_custom_file_path(file_path)
File.join(File.dirname(file_path) + "_custom", File.basename(file_path))
def self.get_custom_file_path(file_path, should_create_directory)
dir_path = File.dirname(file_path) + "_custom"
if should_create_directory
FileUtils.mkdir_p(dir_path)
end
File.join(dir_path, File.basename(file_path))
end

# iniファイルのコピー
Expand Down Expand Up @@ -197,7 +201,7 @@ def create_css_text2(original_css_path, css_template_path, yokogaki, use_dakuten

# カスタムCSSファイルの配置
def create_custom_css_file(dst_css_file_path, css)
custom_css_file_path = AozoraResourceUpdater.get_custom_file_path(dst_css_file_path)
custom_css_file_path = AozoraResourceUpdater.get_custom_file_path(dst_css_file_path, true)
file_write(custom_css_file_path, css)
@copied_file_paths << custom_css_file_path
end
Expand Down

0 comments on commit de42514

Please sign in to comment.