Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-discount
- Owner: matsumotory
- Created: 2013-02-12T02:44:04.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2021-04-17T04:36:59.000Z (over 3 years ago)
- Last Synced: 2024-10-18T18:17:29.910Z (3 months ago)
- Language: C
- Size: 18.6 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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