Class: Md2Pdf::CLI
- Inherits:
-
Thor
- Object
- Thor
- Md2Pdf::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/md2pdf/cli.rb
Instance Method Summary collapse
- #create_template(template) ⇒ Object
- #list_templates ⇒ Object
- #pdf(input_file, template = 'default') ⇒ Object
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.('~/.md2doc'))).create(Shell.new) end |
#list_templates ⇒ Object
23 24 25 |
# File 'lib/md2pdf/cli.rb', line 23 def list_templates puts TemplateLocation.new(File.('~/.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.('~/.md2doc'))), TempFileCreator.new).convert(input_file, output_file(input_file)) end |