lib/rdoc/generator/markdown.rb in rdoc-markdown-0.1.4 vs lib/rdoc/generator/markdown.rb in rdoc-markdown-0.1.5
- old
+ new
@@ -2,10 +2,11 @@
gem "rdoc"
require "pathname"
require "erb"
+require "reverse_markdown"
# Markdown generator.
# Registers command line options and generates markdown files
# RDoc documentation and options.
class RDoc::Generator::Markdown
@@ -112,11 +113,20 @@
template = ERB.new File.read(File.join(TEMPLATE_DIR, "classfile.md.erb"))
out_file = Pathname.new("#{output_dir}/#{klass.full_name}.md")
out_file.dirname.mkpath
- File.write(out_file, template.result(binding))
+ result = template.result(binding)
+
+ File.write(out_file, result)
end
+ end
+
+
+ private
+
+ def h(string)
+ ReverseMarkdown.convert string.strip, github_flavored: true
end
def setup
return if instance_variable_defined?(:@output_dir)