karnov / multimarkdown-ffi

A Multimarkdown wrapper for Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ruby Multimarkdown 5

Build Status

An FFI extension library around the Fletcher Penney's MultiMarkdown C-library. It is based upon the multimarkdown4 ruby wrapper rmultimarkdown by Till Schulte-Coerne, which was inspired by rpeg-markdown and rpeg-multimarkdown libraries by Ryan Tomayko and Oliver "djungelvral".

Synopsis

>> require 'multimarkdown-ffi'

>> Multimarkdown.new('Hello, world.').to_html
#=> "<p>Hello, world.</p>"

>> Multimarkdown.new('_Hello World!_', :smart, :filter_html).to_html
#=> "<p><em>Hello World!</em></p>"

>> Multimarkdown.new('_Hello World!_').to_latex
#=> "\emph{Hello World!}"

>> doc = Multimarkdown.new("Title: Some document  \n\nSome text in the document")

>> doc.metadata
#=> {"title" => "Some document"}

>> doc.metadata("Title")
#=> "Some document"

See MultiMarkdown documentation.

Installation

The library has been tested with later versions of Ruby MRI and JRuby

Install from Rubygems:

$ [sudo] gem install multimarkdown-ffi

Or add to your projects Gemfile Bundler:

gem 'multimarkdown-ffi'

Development

$ git clone git://github.com/jakobjanot/multimarkdown-ffi.git
$ cd multimarkdown-ffi
$ bundle install
$ bundle exec rake

Changes

Beware: The versioning scheme isn't based upon Semantic Versioning, but inherits from the underlying C library. Only the last number is used to indicate changes in the Ruby wrapper itself.

COPYING

MultiMarkdown-5, multimarkdown-ffi are both licensed under the MIT License. See LICENSE for more information.

About

A Multimarkdown wrapper for Ruby

License:MIT License


Languages

Language:C 98.2%Language:Ruby 1.7%Language:Shell 0.1%