AsFoo
Convert Ruby String object to something.
Installation
Add this line to your application's Gemfile:
gem 'as_foo'
And then execute:
$ bundle
Or install it yourself as:
$ gem install as_foo
Requirement
w3m,lynx,linksorelinkscommand to useas_html(The command used to render html is autodetected.)redcarpetgem to useas_markdown
Usage
>> require 'as_foo'
=> true
>> md = "# Sample\n- a\n- b\n"
=> "# Sample\n- a\n- b\n"
>> md.as_markdown
=> "<h1>Sample</h1>\n\n<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n"
>> puts md.as_markdown.as_html
Sample
Contributing
- Fork it ( https://github.com/tmaeda/as_foo/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request