Skip to content

Instantly share code, notes, and snippets.

@lucascaton
Forked from teeparham/rdoc2md.rb
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucascaton/377e329c6f7ef0d16a7a to your computer and use it in GitHub Desktop.
Save lucascaton/377e329c6f7ef0d16a7a to your computer and use it in GitHub Desktop.
require 'rdoc'
converter = RDoc::Markup::ToMarkdown.new
rdoc = File.read(ARGV[0] || 'README.rdoc')
puts converter.convert(rdoc)
# ruby rdoc2md.rb > README.md
# ruby rdoc2md.rb ABC.rdoc > abc.md
alias rdoc2md='ruby ~/.ruby/rdoc2md.rb $1'
# rdoc2md > README.md
# rdoc2md ABC.rdoc > ABC.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment