Class: Jekyll::Commands::NotionImportCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/jekyll/commands/notion_import.rb

Class Method Summary collapse

Class Method Details

.init_with_program(prog) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/jekyll/commands/notion_import.rb', line 6

def self.init_with_program(prog)
  prog.command(:notion_import) do |c|
    c.syntax "notion_import"
    c.description "Imports posts from notion"

    options.each { |opt| c.option(*opt) }

    c.action { |args, options| process(args, options) }
  end
end

.optionsObject



17
18
19
# File 'lib/jekyll/commands/notion_import.rb', line 17

def self.options
  []
end

.process(args = [], options = {}) ⇒ Object



21
22
23
24
25
# File 'lib/jekyll/commands/notion_import.rb', line 21

def self.process(args = [], options = {})
  config = Jekyll.configuration(options)

  Jekyll::NotionImport::Import.perform(config:)
end