lib/octopress-ink.rb in octopress-ink-1.0.0.alpha.37 vs lib/octopress-ink.rb in octopress-ink-1.0.0.alpha.38
- old
+ new
@@ -131,9 +131,25 @@
plugins.each { |plugin| puts plugin.name }
else
puts "You have no plugins installed."
end
end
+
+ def self.copy_doc(source, dest)
+ contents = File.open(source).read
+ contents.sub!(/^# (.*)$/, "#{title('\1').strip}")
+ FileUtils.mkdir_p File.dirname(dest)
+ File.open(dest, 'w') {|f| f.write(contents) }
+ puts "Updated #{dest} from #{source}"
+ end
+
+ def sefl.doc_title(input)
+ <<-YAML
+---
+title: "#{input.strip}"
+---
+ YAML
+ end
end
end
Liquid::Template.register_filter Octopress::Ink::Filters