class JekyllDocs::DocsCommand

Public Class Methods

init_with_program(prog) click to toggle source
# File lib/jekyll-docs.rb, line 8
def init_with_program(prog)
  prog.command(:docs) do |cmd|
    cmd.description "Start a local server for the Jekyll documentation"
    cmd.syntax "docs [options]"
    cmd.alias :d

    cmd.option "port", "-P [PORT]", "--port [PORT]", "Port to listen on."

    cmd.action do |_, opts|
      JekyllDocs::DocsCommand.process(opts)
    end
  end
end
process(opts) click to toggle source
# File lib/jekyll-docs.rb, line 22
def process(opts)
  options = opts.merge(
    "serving"            => true,
    "watch"              => false,
    "destination"        => File.expand_path("../site", __dir__),
    "skip_initial_build" => true
  )
  Jekyll::Commands::Serve.process(options)
end