Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

README.md

Markdown Class for mruby

Build Status

mruby markdown class. convert markdown to html using discount

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

    # ... (snip) ...

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

example

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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>titlehoge</title>
<link rel="stylesheet" href="http://kevinburke.bitbucket.org/markdowncss/markdown.css" type="text/css" />
</head>
<body>
<a name="title"></a>
<h1>title</h1>

<p>title</p>

<a name="subtitle"></a>
<h2>subtitle</h2>

<ul>
<li>hoge</li>
<li>fuga</li>
</ul>
<a name="subtitle2"></a>
<h2>subtitle2</h2>
<ul>
<li>foo</li>
</ul>

</body>
</html>

License

under the MIT License:

About

mruby html generater from markdown

Resources

Releases

No releases published

Packages

No packages published