Skip to content
forked from mdiep/MMMarkdown

An Objective-C framework for converting Markdown to HTML.

License

Notifications You must be signed in to change notification settings

ynie/MMMarkdown

 
 

Repository files navigation

MMMarkdown

MMMarkdown is an Objective-C framework for converting Markdown to HTML. It is compatible with OS X 10.7+, iOS 8.0+, tvOS, and watchOS.

Unlike other Markdown libraries, MMMarkdown implements an actual parser. It is not a port of the original Perl implementation and does not use regular expressions to transform the input into HTML. MMMarkdown tries to be efficient and minimize memory usage.

API

Using MMMarkdown is simple. The main API is a single class method:

#import <MMMarkdown/MMMarkdown.h>

NSError  *error;
NSString *markdown   = @"# Example\nWhat a library!";
NSString *htmlString = [MMMarkdown HTMLStringWithMarkdown:markdown error:&error];
// Returns @"<h1>Example</h1>\n<p>What a library!</p>"

The markdown string that is passed in must be non-nil.

MMMarkdown also supports a number of Markdown extensions:

#import <MMMarkdown/MMMarkdown.h>

NSString *markdown   = @"~~Mistaken~~";
NSString *htmlString = [MMMarkdown HTMLStringWithMarkdown:markdown extensions:MMMarkdownExtensionsGitHubFlavored error:NULL];
// Returns @"<p><del>Mistaken</del></p>"

Setup

Adding MMMarkdown to your project is easy.

If you’d like to use Carthage, add the following line to your Cartfile:

github "mdiep/MMMarkdown"

Otherwise, you can:

  1. Add MMMarkdown as a git submodule. (git submodule add https://github.com/mdiep/MMMarkdown <path>)

  2. Add MMMarkdown.xcodeproj to your project or workspace

  3. Add MMMarkdown.framework to the ”Link Binary with Libraries" section of your project's “Build Phases”.

  4. Add MMMarkdown.framework to a ”Copy Files” build phase that copies it to the Frameworks destination.

License

MMMarkdown is available under the MIT License.

About

An Objective-C framework for converting Markdown to HTML.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 81.0%
  • HTML 17.7%
  • Perl 1.1%
  • Ruby 0.2%