Improve build-syllabus script

This commit is contained in:
Glenn Y. Rolland 2020-11-09 10:04:40 +01:00
parent e09e70a0c6
commit 21f4828e98

View file

@ -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)