lib/renuo/cli/app/create_slidev_presentation.rb in renuo-cli-4.5.0 vs lib/renuo/cli/app/create_slidev_presentation.rb in renuo-cli-4.5.1
- old
+ new
@@ -1,41 +1,41 @@
# frozen_string_literal: true
-require 'commander'
+require "commander"
class CreateSlidevPresentation
- EXAMPLE_SLIDES_URL = 'https://raw.githubusercontent.com/renuo/slidev-theme-renuo/main/example.md'
- SLIDEV_THEME_NAME = 'renuo'
- TEMPLATE_DIRECTORY = 'templates/slidev'
+ EXAMPLE_SLIDES_URL = "https://raw.githubusercontent.com/renuo/slidev-theme-renuo/main/example.md"
+ SLIDEV_THEME_NAME = "renuo"
+ TEMPLATE_DIRECTORY = "templates/slidev"
attr_accessor :presentation_name, :presentation_author
def initialize
@presentation_name = nil
@presentation_author = nil
end
def run(args)
presentation_name = args[0]
- abort('>> No presentation name given.') unless presentation_name
+ abort(">> No presentation name given.") unless presentation_name
- say '# Commands to setup Slidev project with the Renuo theme:'.colorize :green
+ say "# Commands to setup Slidev project with the Renuo theme:".colorize :green
@presentation_name = presentation_name
- @presentation_author = args[1] || 'Renuo AG'
+ @presentation_author = args[1] || "Renuo AG"
print_slidev_project_commands
end
private
def print_slidev_project_commands
say "mkdir #{@presentation_name}"
say "cd #{@presentation_name}"
say "curl -o slides.md #{EXAMPLE_SLIDES_URL}"
- say "echo '#{render('README.md.erb')}' > README.md"
+ say "echo '#{render("README.md.erb")}' > README.md"
say "sed -ig 's/theme: .\\//theme: renuo/' slides.md"
- say "echo '#{render('package.json.erb')}' > package.json"
- say 'npm install'
- say 'npm run dev'
+ say "echo '#{render("package.json.erb")}' > package.json"
+ say "npm install"
+ say "npm run dev"
end
def render(filename)
file_path = File.join(File.dirname(__FILE__), TEMPLATE_DIRECTORY, filename)
template = File.read(file_path)