Class: Texas::Template::Runner::Markdown

Inherits:
Base
  • Object
show all
Includes:
Helper::Markdown
Defined in:
lib/texas/template/runner/md.rb

Instance Attribute Summary

Attributes inherited from Base

#build, #content, #filename

Instance Method Summary collapse

Methods included from Helper::Markdown

#bold, #h1, #italic

Methods inherited from Base

#__path__, #__render__, #__run__, #after_render, #append_to_output, #build_path, #document, #initialize, #o, #root, #store, #write

Methods included from Helper::Info

#abstract, #info, #marked_for_rewrite?, #summary

Methods included from Helper::Base

#default_search_paths, #find_template_file, #find_template_file!, #partial, #path_with_templates_basename, #render, #render_as_array, #template_extensions, #templates_by_glob

Constructor Details

This class inherits a constructor from Texas::Template::Runner::Base

Instance Method Details

#after_writeObject



6
7
8
9
10
11
12
13
# File 'lib/texas/template/runner/md.rb', line 6

def after_write
  if `which pandoc`.empty?
    puts "\nAborting build: pandoc not found in PATH (required for Markdown rendering)"
    exit
  end
  tex_filename = Texas::Template.basename(@output_filename) + ".tex"
  `pandoc -S "#{@output_filename}" -o "#{tex_filename}"`
end