class CreateSlidevPresentation

Constants

EXAMPLE_SLIDES_URL
SLIDEV_THEME_NAME
TEMPLATE_DIRECTORY

Attributes

presentation_author[RW]
presentation_name[RW]

Public Class Methods

new() click to toggle source
# File lib/renuo/cli/app/create_slidev_presentation.rb, line 12
def initialize
  @presentation_name = nil
  @presentation_author = nil
end

Public Instance Methods

run(args) click to toggle source
# File lib/renuo/cli/app/create_slidev_presentation.rb, line 17
def run(args)
  presentation_name = args[0]
  abort(">> No presentation name given.") unless presentation_name

  say "# Commands to setup Slidev project with the Renuo theme:".colorize :green
  @presentation_name = presentation_name
  @presentation_author = args[1] || "Renuo AG"
  print_slidev_project_commands
end

Private Instance Methods

print_slidev_project_commands() click to toggle source
render(filename) click to toggle source
# File lib/renuo/cli/app/create_slidev_presentation.rb, line 40
def render(filename)
  file_path = File.join(File.dirname(__FILE__), TEMPLATE_DIRECTORY, filename)
  template = File.read(file_path)
  renderer = ERB.new(template)
  renderer.result(binding)
end