Ruby gem to convert html into markdown
Ruby
Switch branches/tags
Pull request Compare This branch is 130 commits behind xijo:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
License-MIT
README.md
Rakefile
reverse_markdown.gemspec

README.md

Summary

Transform existing html into markdown in a simple way, for example if you want to import existings tags into your markdown based application.

Build Status

Installation

Install the gem:

[sudo] gem install reverse_markdown

If you want to use it in Rails context, add it to your Gemfile:

gem 'reverse_markdown'

Synopsis

Given you have html content as string or Nokogiri document or element just pass it over to the module like this:

ReverseMarkdown.parse content

However, the old syntax is still supported:

ReverseMarkdown.parse_element content
ReverseMarkdown.parse_string content

Tag support

Only basic html tags are supported right now. However, it should not be to difficult to add some. Feel free to contribute or notify me about missing stuff.

  • supported tags: h1, h2, h3, h4, h5, h6, p, em, strong, blockquote, code, img, a, hr, li, ol, ul
  • nested lists
  • inline and block code

See as well

Thanks

..to Ben Woosley for his improvements to the first version.

..to Harlan T. Wood for his help with the newer versions.