class Renuo::Cli::Commands::CreateSlidevPresentation
Constants
- EXAMPLE_SLIDES_URL
- SLIDEV_THEME_NAME
- TEMPLATE_DIRECTORY
Attributes
Public Instance Methods
Source
# File lib/renuo/cli/commands/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_author = args[1] || "Renuo AG" print_slidev_project_commands end
Private Instance Methods
Source
# File lib/renuo/cli/commands/create_slidev_presentation.rb, line 28 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 "sed -ig 's/theme: .\\//theme: renuo/' slides.md" say "echo '#{render("package.json.erb")}' > package.json" say "npm install" say "npm run dev" end
Source
# File lib/renuo/cli/commands/create_slidev_presentation.rb, line 39 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