diff options
author | AndrewMurrell <ImFromNASA@gmail.com> | 2017-12-24 21:16:48 -0500 |
---|---|---|
committer | AndrewMurrell <ImFromNASA@gmail.com> | 2017-12-24 21:16:48 -0500 |
commit | 37cf878b62c49d23cdc0cf09b972456bb98b2736 (patch) | |
tree | 11efcf65d45de738c4082e6658b2bc355b22f48b /lib/page_local.rb | |
parent | 517aec2364abb99431cfe91f318b2fb109226db5 (diff) | |
parent | bdb62265c5e0f8cbaa647479e10549f324e0712c (diff) |
Merge remote-tracking branch 'ls/master'
Diffstat (limited to 'lib/page_local.rb')
-rw-r--r-- | lib/page_local.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/page_local.rb b/lib/page_local.rb index e13fa33..6c70ac3 100644 --- a/lib/page_local.rb +++ b/lib/page_local.rb @@ -9,6 +9,21 @@ require 'pandoc' require 'person' class LocalPage < Page + def self.load(inpath) + case + when Dir::exist?(inpath) + require 'page_index' + return IndexPage::new(inpath) + when [".md", ".org"].include?(File::extname(inpath)) + return LocalPage::new(inpath) + when ".pdf" == File::extname(inpath) + require 'page_pdf' + return PdfPage::new(inpath) + else + return nil + end + end + def initialize(infile) @infile = infile super() |