Sha256: af524f1d165f46189f645d74b189fac62d9e2727df8f6f9c97fed685c8689523
Contents?: true
Size: 1.21 KB
Versions: 113
Compression:
Stored size: 1.21 KB
Contents
# frozen_string_literal: true module Avm module EacLatexBase0 module Sources class Build class << self def chapter_filename(chapter_name) "chapter_#{chapter_name}" end end module ChaptersContent private def chapter options[:chapter] end def chapter_filename(chapter_name) ::Avm::EacLatexBase0::Sources::Build.chapter_filename(chapter_name) end def check_chapter return unless chapter return if project.chapters.include?(chapter) fatal_error("Chapter not found: \"#{chapter}\" (List: #{project.chapters})") end def include_content main_path = source_temp_dir.join('main.tex') main_path.write(main_path.read.gsub(CONTENT_VAR, include_chapters_content)) end def include_chapters_content r = chapters_content r = "\\maketitle\n\n#{r}" if chapter.blank? r end def chapters_content project.chapters.map { |c| "\\include{#{chapter_filename(c)}}" }.join("\n") end end end end end end
Version data entries
113 entries across 113 versions & 2 rubygems