Improve build-syllabus script
This commit is contained in:
parent
e09e70a0c6
commit
21f4828e98
1 changed files with 12 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'sanitize'
|
require 'sanitize'
|
||||||
|
require 'thor'
|
||||||
|
|
||||||
class Syllabus
|
class Syllabus
|
||||||
def initialize
|
def initialize
|
||||||
|
@ -51,12 +52,19 @@ class Syllabus
|
||||||
end
|
end
|
||||||
|
|
||||||
def syllabus_dir(dir)
|
def syllabus_dir(dir)
|
||||||
Dir['slides/**/*.md'].sort.each do |name|
|
Dir[dir + '/**/*.md'].sort.each do |name|
|
||||||
syllabus_file(name)
|
syllabus_file(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class SyllabusCli < Thor
|
||||||
|
desc 'extract DIR', 'Extract data from DIR'
|
||||||
|
def extract dir
|
||||||
s = Syllabus.new
|
s = Syllabus.new
|
||||||
s.syllabus_dir(nil)
|
s.syllabus_dir(dir)
|
||||||
s.display
|
s.display
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
SyllabusCli.start(ARGV)
|
||||||
|
|
Loading…
Reference in a new issue