Class: Md2Pdf::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/md2pdf/cli.rb

Instance Method Summary collapse

Instance Method Details

#create_template(template) ⇒ Object



17
18
19
20
# File 'lib/md2pdf/cli.rb', line 17

def create_template(template)
    Template.new(template, 
                 TemplateLocation.new(File.expand_path('~/.md2doc'))).create(Shell.new) 
end

#list_templatesObject



23
24
25
# File 'lib/md2pdf/cli.rb', line 23

def list_templates
    puts TemplateLocation.new(File.expand_path('~/.md2doc')).list.join($/)
end

#pdf(input_file, template = 'default') ⇒ Object



8
9
10
11
12
13
14
# File 'lib/md2pdf/cli.rb', line 8

def pdf(input_file, template='default')
  Converter.new(
    Shell.new, 
    Template.new(template, 
                 TemplateLocation.new(File.expand_path('~/.md2doc'))), 
    TempFileCreator.new).convert(input_file, output_file(input_file))
end