Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matsumotory/mruby-discount

mruby html generater from markdown
https://github.com/matsumotory/mruby-discount

Last synced: about 2 months ago
JSON representation

mruby html generater from markdown

Awesome Lists containing this project

README

        

# Markdown Class for mruby

[![Build Status](https://travis-ci.org/matsumoto-r/mruby-discount.svg?branch=master)](https://travis-ci.org/matsumoto-r/mruby-discount)

mruby Markdown class. Convert Markdown to HTML using [discount](https://github.com/Orc/discount)

## Install by mrbgems
- add conf.gem line to `build_config.rb`
```ruby
MRuby::Build.new do |conf|

# ... (snip) ...

conf.gem :github => 'matsumoto-r/mruby-discount'
end
```

## Example

```ruby
m = Discount.new("http://kevinburke.bitbucket.org/markdowncss/markdown.css", "titlehoge")

markdown = '
# title
title
## subtitle
- hoge
- fuga
'

puts m.header
puts markdown.to_html
puts "## subtitle2".to_html
puts "- foo".to_html
puts m.footer

# # Or
# puts m.md2html(markdown + "\n" + "## subtitle2" + "- foo")
```

```html

titlehoge


title

title


subtitle


  • hoge

  • fuga



subtitle2



  • foo

```

# License
under the MIT License:

* http://www.opensource.org/licenses/mit-license.php