Class: Hackademic::Compile

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hackademic/compile.rb

Instance Method Summary collapse

Instance Method Details

#allObject



7
8
9
10
11
# File 'lib/hackademic/compile.rb', line 7

def all
  latex
  docx
  pdf
end

#docxObject



32
33
34
35
36
37
# File 'lib/hackademic/compile.rb', line 32

def docx
  read_draft_file
  write_master_markdown_file
  system docx_command
  say "Writing out DOCX file: #{config.output_directory}/#{config.draft_name.gsub(/\..*$/, '')}.docx"
end

#latexObject



40
41
42
43
44
45
# File 'lib/hackademic/compile.rb', line 40

def latex
  read_draft_file
  write_master_markdown_file
  %x[pandoc #{config.output_directory}/#{config.transcluded_draft} --from=markdown+#{pandoc_from_options.join("+")} --filter pandoc-citeproc --bibliography=#{config.bibliography} --csl=#{config.citation_style} --latex-engine=xelatex --template=#{config.latex_template} -s -o "#{latex_file}"]
  say "Writing out LaTeX file: #{config.output_directory}/#{config.draft_name.gsub(/\..*$/, '')}.tex"
end

#pdfObject



14
15
16
17
18
19
# File 'lib/hackademic/compile.rb', line 14

def pdf
  read_draft_file
  write_master_markdown_file
  system pdf_command
  say "Writing out PDF file: #{config.output_directory}/#{config.transcluded_draft.gsub(/\..*$/, '')}.pdf"
end

#show_docx_commandObject



27
28
29
# File 'lib/hackademic/compile.rb', line 27

def show_docx_command
  say docx_command, :blue
end

#show_pdf_commandObject



22
23
24
# File 'lib/hackademic/compile.rb', line 22

def show_pdf_command
  say pdf_command, :blue
end